课程: End-to-End JavaScript Testing with Cypress.io
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Working with command results
- [Instructor] All right, now that we've seen the main way of aliasing in Cypress, which is to use this .as method, that's chained on the end of any Cypress command. The next thing that we're going to take a look at is another way that we can alias elements in Cypress. But before we do that, what I'm actually going to do is I'm going to duplicate this file. I'm just going to copy everything that's inside of it and we'll create a new file, just so that you have the old stuff around for reference, and we'll call this something like results.cy.js. All right, we're going to paste this inside of there now and we're going to leave the tests the same as what they were before. Let's also just adjust this indentation-thing here, which is a little bit off. There we go. All right, now, previously I mentioned that there was a way that we could get and work with the results of our Cypress commands and that it wasn't by simply saying something like const fnInput equals cy.get, first name input…
内容
-
-
-
-
Installing and running Cypress2 分钟 14 秒
-
Writing and running Cypress tests8 分钟
-
(已锁定)
Testing text inputs7 分钟 53 秒
-
(已锁定)
Selecting elements8 分钟 20 秒
-
(已锁定)
Element aliasing6 分钟 39 秒
-
(已锁定)
Working with command results5 分钟 43 秒
-
(已锁定)
Using beforeEach4 分钟 57 秒
-
(已锁定)
Setting a base URL3 分钟 29 秒
-
(已锁定)
Challenge 1: Writing your own tests1 分钟 46 秒
-
(已锁定)
Solution 1: Writing your own tests6 分钟 38 秒
-
-
-
-