Ability to call another spec/test in different spec file #9428
-
We are testing multiple views (ie desktopView, tabletView, and mobileView). In some cases, tests end up being the same (ie element selectors) for these views. The only thing that is different is width and height. Each view has its own *.json config file where it specifies the width and height. So to avoid writing same tests, it would be great to utilize existing ones. Could someone please provide some inputs on how I can achieve this? Any feedback is appreciated. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
See how we recommend reusing test code from different specs here https://www.cypress.io/blog/2019/12/06/use-meaningful-smoke-tests/ TLDR: you import and run a common function that has spec commands |
Beta Was this translation helpful? Give feedback.
See how we recommend reusing test code from different specs here https://www.cypress.io/blog/2019/12/06/use-meaningful-smoke-tests/
TLDR: you import and run a common function that has spec commands