Text Inputs
HTML-код
- Опубликовано: 8 фев 2025
- We will work through creating our first real test and implementing the feature under test as we go. We will see how to find and interact with elements on the page and how to make assertions about their behavior. We will also look into some best practices like using beforeEach and defining our application’s baseUrl to remove duplicated code. Follow along at on.cypress.io/tutorials
Thank you for the tutorial, it was very useful. It went a little outdated, because react changed a lot in the meantime, but still useful.
Will I need to write a test for each field if I have 10 input fields in my form?
this is a nice tutorial for automated test, but I'm facing an error
FOCUSED
2 ASSERT
expected { Object (selector) } to have class new-todo. can someone help me out
well, if you click on the element in the failing assertion you can inspect it - to see which element is focused. It probably focuses on the wrong element (not on the input box). Just be aware: `cy.focused()` is REALLY dependent on how you change focus while the test is running. Let's say during the test you click on your code editor - this takes the focus away from Cypress browser and away from the focused element, or even if you click somewhere in the Cypress browser during the test. Then the focused element will NOT be the input box anymore and the test will fail.
@@gleb thank you for your help
I got the same problem. You just need to stop your app and run it again for saving all changes.
Can you please show deleting a task testing please or give code for that
Beware that he is getting elements using classes not data attributes which is the standard today.