How to run each test several times ?
See original GitHub issueHello !
We’re writing our tests mobile-first with cypress-cucumber-preprocessor. By default, all the tests are run with a mobile viewport. But on some specific cases, we want to run them on desktop viewport.
This is possible since this PR : https://github.com/TheBrainFamily/cypress-cucumber-preprocessor/pull/216.
We’re just using the Before to adapt the viewport depending on tags :
Before({ tags: '@desktop' }, () => {
cy.viewport(desktopWidth, desktopHeight);
});
This is doing the job, but now we would like to enable the tests on both desktop and mobile viewports. Some tests are not mobile or desktop only, we want to run them on both viewports. So we will have three cases of tests :
- Mobile only => the test is not tagged
- Desktop only => the test is tagged with @desktop
- Mobile AND Desktop => the test is tagged with @all-viewport
We could implement this duplicating the tests by ourself (writing the wanted tests two times, with a different tag on each), but we’re looking for a better way (and easier to maintain).
Do someone know if it’s possible to implement this with the plugin ? Or natively with Cypress ? @jcundill any idea ? 😏
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:7 (6 by maintainers)

Top Related StackOverflow Question
If you only have few scenarios that you want to try in different viewports, then you can create a Scenario Outline with a table of your different viewports. It will run your scenario with as many arguments as you got. 🙂 Hope it can help !
Example:
Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I’m very excited about. Furthermore, I’d like to thank @lgandecki ++ for all the work that they’ve done so far.
Read more about the transfer of ownership here.
The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.