课程: End-to-End JavaScript Testing with Cypress.io

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Testing text inputs

Testing text inputs

- [Instructor] All right, so at this point, we've written our first test with Cypress.io, which checked the text inside a header element. Now, this was a great way to get a better feel for the syntax and flow of Cypress tests, and honestly, this might be something that you want to do a lot of the time, right? Is actually just check to make sure that a certain part of your website has the text that you want it to have, but obviously, once you get past simple tests like this, you're probably going to want to check pieces of functionality on your site that are a little bit more complicated, so if you open up the browser to the example application and go to Example 2, what you'll see is that we have this nice little text input that tells us how many characters we have left that are available to type, right? And you can see that as you type characters in there, it changes that number, and this would probably be a pretty useful feature on a site if you wanted to limit how many characters…

内容