codeceptjs / codeceptjs/CodeceptJS

Run Selected/Failed Tests or combine Tests which doesn't fall under a pattern

Ouverte
#2,776 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
4.2k
Forks
757
Merge moyen
2 j 9 h
PR mergées (30 j)
16

Description

What are you trying to achieve?

Adding new option to run and run-workers to rerun the failed tests or the selected tests. Option added in --rerun-tests.

Working Nature :

- When the run is initiated and when script(s) fail, the test script will be added in failedCases.json file.
- When the rerun is initiated with the run --rerun-test or run-workers 2 --rerun-test command, test files will be picked from the json file instead of the config file.
- Failed Tests will be updated from the last execution regardless of the mode it ran(either run or run --rerun-tests)
- When all the tests are passed in the last execution, failesCases.json file be deleted from the project folder.
- We can add files from different folders, files which doesn't falls under a single pattern etc.
- When a invalid files or files are provided in the json file, message will be thrown with the invalid file.
- When there is no failedCases.json file or no tests in the failedCases.json file and the run is initiated, appropriate message will be displayed to the user.

Benefits :

- If the failed scripts need to run against different environments, it could be accomplished with this approach.
- You can create failedCases.json manually and run the specific scripts you want to execute using the above commands.
- This would be much useful, if you want to run the scripts which doesn't come under a pattern and from test files from different folders.

Console Outputs :

**Failed Scripts when run-workers**

![1 Worker Failed Scripts](https://user-images.githubusercontent.com/77319031/105359384-66985b80-5c1d-11eb-9644-5a5870f9b983.png)

**Failed Worker Script In Failed Cases**

![2 Failed Worker Script In Failed Cases JSON](https://user-images.githubusercontent.com/77319031/105359426-72841d80-5c1d-11eb-87c5-af100d24a1b5.png)

**Rerun Of the Failed Script**

![3 Rerun Of the Failed Script](https://user-images.githubusercontent.com/77319031/105359451-7c0d8580-5c1d-11eb-9989-13c6fa51e317.png)

**Failed Cases JSON removed after the Failed Script succeeded**

![4 Failed Cases JSON removed after the Failed Script succeeded](https://user-images.githubusercontent.com/77319031/105359471-80d23980-5c1d-11eb-99c5-f4c34f3426df.png)

**Retries Captured In Allure**

![5 Retries Captured In Allure](https://user-images.githubusercontent.com/77319031/105359491-87f94780-5c1d-11eb-9ae1-45431af56c10.png)

**Invalid Files Identification**

![Invalid Files Identification](https://user-images.githubusercontent.com/77319031/105359513-8d569200-5c1d-11eb-8335-04e9f5830ac2.png)

**Running Files From Two Different Folder**

![Running Files From Two Different Folder](https://user-images.githubusercontent.com/77319031/105359535-92b3dc80-5c1d-11eb-94c7-b45a8fdb81a6.png)

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.