课程: End-to-End JavaScript Testing with Cypress.io
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Challenge 2: Writing your own tests
课程: End-to-End JavaScript Testing with Cypress.io
Challenge 2: Writing your own tests
(upbeat music) - [Instructor] All right, well now that we've seen a number of other topics in Cyprus, it's time for you to do a challenge. Now, in this challenge, you're going to need to use something that I showed you a little bit earlier in order to write some tests and you can actually write these tests in the interactions file. So let's just go into here, we'll open up interactions.cy.js. I mentioned earlier that there were a number of different events that you could trigger in Cyprus, and I also mentioned that it was possible to test the styles of different things. So what I would like you to do for this challenge is write a test that makes sure that when the user single clicks on one of these elements in this first box, it turns the background gray. And just as a side note here, if you inspect that to see what the exact style is there, you'll see that the background color is set to #DDD. So anyway, that's what you're going to need to test for. And you may recall that the…
内容
-
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-
-