0

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

ksk
  • 165
  • 14
  • Why does test retries not work for you situation? – jjhelguero Sep 23 '22 at 13:34
  • because the failing tests due to flaky reason will be handled by retries but my intension is different example if i wrote 10 test cases and 5 got failed so i will try to check the Data in the application side or i will inform the Dev team to fix it so when they they fixed the issue i want to run only failing test cases so for that if the feature or any idea kind of thing exist which helps only a set of test cases will be helpful so i was ignoring retries in this i hope you got my requirement for the story :) waiting for your opinions on it – ksk Sep 23 '22 at 15:07
  • For the scenario where Dev team will add fix, you may want to run more tests than just the failed ones to ensure nothing else was broken. If you have parallelized execution the feedback shouldn't be too long. – jjhelguero Sep 23 '22 at 16:46
  • @jjhelguero but we have around 3000 test cases to check and only 20 are failing so that is the reason we are looking for it as it takes a lot of time to execute everything again instead if we test those 20 first and have confirmation finally we will again try to run them in total else it will be a problem if some of them again fail while retesting it i hope you got my problem :) waiting for your valuable suggesion – ksk Sep 30 '22 at 17:33

2 Answers2

1

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

  • Actually, I am not looking for this I was looking for the way it runs multiple test cases mentioned in one text file reference For Example, if I run all my 100 test cases and 20 among them failed so I would maintain the file names and paths which are failing in one file and I want cypress to take this file and run all the test cases references and run those specific test cases @madhuri varada answer given by you is specific to the project I was looking beyond it please share your thoughts about it, thank you :) – ksk Sep 23 '22 at 12:27
  • create One spec file like main.cy.ts then import all the test failed testfiles in main.cy.ts file and run only main.cy.ts file. I think it will work. create folder for all the failed test cases then run the cypress without headless in cmd. npx cypress run --spec "cypress/e2e/failedTest" – madhuri varada Oct 18 '22 at 09:20
0

describe.only("2nd describe", () => { it("Should check xx",() =>{ }); it("Should check yy", () => { }); }); it can only run the specific suit. Run specific test case use it.only("Should check yy", () => { });