课程: End-to-End JavaScript Testing with Cypress.io
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Working with test doubles
- [Instructor] All right, so the next thing that we're going to talk about here is working with something called test doubles in Cypress. As a general rule, when we're end-to-end testing, as we almost always are with Cypress, we want the app that we're testing to mimic the production environment as closely as possible. This means that we want to be very careful about using techniques that are popular in unit and integration testing, such as mocking, or stubbing, or other test doubles. These are meant in unit and integration testing to make it easier to test individual pieces of our app in isolation. So, usually, using test doubles in end-to-end testing is going to kind of ruin the point of end-to-end testing in the first place. Now, that being said, there are times when using test doubles is the best option, even in end-to-end testing. For example, if we need to see how our app works when it encounters a server error, it's usually much easier to simply create a server stub that…
内容
-
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-
-