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

免费学习该课程!

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

Automatic retries

Automatic retries

- [Instructor] All right, at this point, we've covered quite a few concepts in Cypress, but there's still one very important aspect that we haven't covered yet and that is the concept of automatic retrying. You see, one of the biggest difficulties with end-to-end testing is what are called flaky tests. Now, flaky tests are just tests that pass most of the time, but occasionally, or in certain environments, they will fail unexpectedly. Now, quite often the cause of these flaky tests is just some sort of timing issue. So, for example, the application might be making some network call that's taking longer than usual. And Cypress has a built-in way of avoiding this difficulty, which is that it will automatically retry commands and assertions if they fail until they pass. Now, that might sound a little bit confusing at first, so let's just think about a simple example. Let's imagine that our app displays a list of people that it populates from the server. Now, loading the information for…

内容