课程: End-to-End JavaScript Testing with Cypress.io
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Common assertions
- [Instructor] All right, so now that we've taken a look at a few different interactions that we can use with Cypress, let's take a look at a few different types of assertions, right? So, so far, we've been primarily concerned with things like checking whether text is equal to some value or checking whether a text input has some value. But the fact is that there's a lot of other assertions that we'll want to make in Cypress in order to make sure that a website is behaving in the way that we want it to. So the first thing that I'm going to do here is I'm actually just going to create a new file for the code that I'm going to write here. We'll call this assertions.cy.js. We're just going to say describe, and we'll say something like different types of assertions. And then for the test cases here, the first one we're going to do is checking to see whether there are a certain number of a type of element on a page, right? So checking the number of items is a pretty common thing that we…
内容
-
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-
-