课程: End-to-End JavaScript Testing with Cypress.io
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Typing special characters
- [Instructor] The next thing that we're going to talk about here is how to type special characters in Cypress. And to show you what I mean here, let's go to our, let's see here, let's open up our max character input test, which should help us demonstrate this. And let's say, that in addition to testing, what happens when we type regular characters such as "Hello" into the text box. We also want to test what happens when we type something like the Enter key or Tab. Now, our page currently doesn't have any functionality set up for that, but I'll just show you how to do this in case you want to test, for example, to make sure that hitting Enter submits the page, or something like that. Well, all you have to do in Cypress when you want to type a special character, is put a pair of curly braces into the string that you're typing, and say "{enter}" or "{tab}" or really anything else. And in fact, there's a full list of these things on Cypress' website, if you go to the Cypress…