In the first post, details were given on how to install and get Cypress running in your new Angular project.
The first question of importance, is "how do we get addressibility to the elements within the Cypress Test?"
Answer: Cy.get('')
cy.get('body').then(function(body){...}
But notice that to get the children; we must call a function, and not a property. This is because Cypress uses JQuery under the hood. Which means we have to learn a bit about Cypress internals and how it does things.
var firstelement = body.children()[0]
For now, it's probably a good idea to read up on Cypress' How do I get the native DOM reference? .
Notice in the documentation that the results from a Cypress Get have predefined functions for us to use such as then,shoud,to,not,type These are the commands Cypress uses to effect the tests we are about to write.
More to come...
JWP2020
Top comments (2)
Hi John,
nice article you have there. also can you share how to make the link between your article ( the part one and part 2)
Click on Read Full, you should see them linked now. Regards....