Testing · Middle · Question 56 of 75
Why can't you write const text = cy.get("h1").text() in Cypress?
- ✓Correct answer: Cypress commands are enqueued and run later; they don't return values - use
.then()or.should() - 2
text()is a jQuery method - 3Cypress doesn't support headings
Explanation
Commands are chained and executed asynchronously by Cypress; they are not promises and can't be awaited.