课程: End-to-End JavaScript Testing with Cypress.io
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Setting environment variables
- [Instructor] All right, so the next thing that we're going to take a look at is another very helpful thing to know when doing any kind of Cyprus testing, and that is how to set up and use environment variables. Right now, environment variables, just to show you what this might look like. Environment variables are certain points in our tests that will change depending on where our tests are running. So one example of this might be that maybe the paths that our different pages have in our application will change depending on whether our app is running locally or in production or on a dev server. So what you might see are things like this where we say CYPRESS and then we'll say something like, EXAMPLE_2_PATH. This is what's known as an environment variable. And among other things, it also gives us a place to specify things like secret keys or usernames and passwords If we have a site that we need to log into so that we don't have to specify things like passwords in our code and…
内容
-
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-
-