How to Run List of random multiple test cases in Cypress and how to make command string shorten

Viewed 22

Lets say i have 300 test cases and among them 100 are failing now i want to run those 100 test cases again (Note: i have even rerun the cypress test cases with appropriate option and it even run the test cases for finding flaky test cases)

Now i have a list of failing 100 test cases in a notepad or Excel sheet now is there any mechanism to run this test cases in CYPRESS

if i go with

cypress run --spec=cypress/integration/one.sepc.ts,cypress/integration/two.spec.ts"

that 100 test cases will cause a big string and it looks like

cypress run --spec=cypress/integration/one.sepc.ts,cypress/integration/two.spec.ts, ..... hundread.spec.ts"

this will leave that command is a huge text and complex to maintain so is there any way to run the list of failing test cases only at whatever time I want to run after fixing the application code or data

any suggestions will be helpful

More info I was looking for the way it runs multiple test cases mentioned in one text file reference or dictionary reference

For Example, if I run all 100 test cases and 20 among them failed so I would maintain the file names and paths which are failing in the file or dictionary

and now I want cypress to take this file and run all the test cases references which are failing thereby running those specific test cases which are failing

(Note: i am aware of retrys to be placed for the execution

1 Answers

npx cypress run --spec "cypress/e2e/folderName" in cmd run all the specs in cypress folder.

Related