课程: End-to-End JavaScript Testing with Cypress.io
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Triggering other actions
- [Instructor] All right. So we've seen how to test clicking and double clicking. And just as a reminder, we only tested double click here, but if you wanted to test clicking behavior, you could just change that to click. So let's see how to do some other things, right, such as checking and unchecking check boxes, selecting things from a dropdown and more. So the first thing that we'll take a look at here is the check boxes. And in theory, what you could do is just find these checkbox elements and call a click on them. But Cypress provides a slightly more explicit way of doing this. This really just makes sure that your tests are clear on what it is you really want to do when interacting with these elements. So here's what this is going to look like. We're going to go back and we're going to add a test case here. We'll say it. And let's just take a look at what this .check() and .uncheck() things do. Basically this just changes the number of checked boxes that are selected so we'll…
内容
-
-
-
-
-
(已锁定)
Interacting with elements6 分钟 6 秒
-
(已锁定)
Triggering other actions8 分钟 46 秒
-
(已锁定)
Common assertions8 分钟 46 秒
-
(已锁定)
Automatic retries3 分钟 21 秒
-
(已锁定)
Debugging Cypress tests5 分钟 41 秒
-
(已锁定)
Setting environment variables6 分钟 10 秒
-
(已锁定)
Working with test doubles4 分钟 34 秒
-
(已锁定)
Challenge 2: Writing your own tests1 分钟 20 秒
-
(已锁定)
Solution 2: Writing your own tests3 分钟 29 秒
-
(已锁定)
-
-