Best way to run the same set of tests for different environments #25766
Replies: 6 comments
-
@mschile @marktnoonan This discussion has been opened for quite a while and I presumed there should be a relatively simple. Can any of you share their thoughts on this or possibly redirect us to somewhere else? |
Beta Was this translation helpful? Give feedback.
-
Hi @tachojelev 👋, I would suggest reading our Configuration API documentation that includes an example on how to Switch between multiple configuration files. Gleb also has a post showing a similar method. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am also struggling with running the same test which are really data dependent in different environment. I tried to mock the data and was assuming if mock the data, we would be able to use the same data in different environment, but unfortunately its not working. I mocked the graphql callsand used fixture to call the data and then navigate to the application and do some assertion. Would appreciate if share your thoughts and knowledge. |
Beta Was this translation helpful? Give feedback.
-
I found using 'cypress-dotenv' plugin as a better solution to running the tests for different environments on Cypress. Ref url : my sample project Not sure if its just me but I find Cypress documentation bad, I prefer to google at other places or self try to find a solution which exactly defeats the purpose of the documentation |
Beta Was this translation helpful? Give feedback.
-
Hello, I am using Cypress and I have to implement a set of tests which will run on different environments (DEV, PROD, etc.) I am having trouble running the same tests on these different environments which have data different because they are connected to different databases. @mschile @marktnoonan I would appreciate sharing your thoughts and knowledge |
Beta Was this translation helpful? Give feedback.
-
I would recommend to have a look to this blog: https://medium.com/@dingraham01/cypress-easy-multi-environment-configuration-c18ac94971d5 |
Beta Was this translation helpful? Give feedback.
-
Hello, our organisation is using Cypress and we need to implement a set of tests that will run against different environments (DEV, PROD, etc.) and the difference between them will be mostly configuration variables like urls, boolean flags, etc.
We noticed there is a big amount of tutorials for this, but some of them differ quite a lot from each other. We are currently looking at the environment variables documentation - https://docs.cypress.io/guides/guides/environment-variables.
It would be ideal if we can dynamically get the necessary configuration into the tests themselves, so they know what urls are hitting or what specifics they need based on the environment. Can you suggest us the best way to do this?
Beta Was this translation helpful? Give feedback.
All reactions