Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA : Tooling (Test Scenarios) #236

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ title: Tooling

* [Nightly Board](./nightly-board)
* [PrestHubot](./presthubot)
<!-- * [Test Scenarios](./test-scenarios) -->
* [Test Scenarios](./test-scenarios)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The API has several endpoints:

### Nightly board

![Nightly ](images/nightly-board-1.png)
![Nightly ](../images/nightly-board-1.png)

The nightly board is based on Nuxt 2 & Vue 2.7.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ We can divide the process in two parts : QA Functional & QA Automation.
### QA Functional

#### PR Stats for QA
![PR Stats for QA](images/presthubot-1.png)
![PR Stats for QA](../images/presthubot-1.png)

This returns the number of Pull Requests that are pending:
* on the various branches under development
Expand All @@ -33,35 +33,35 @@ This returns the number of Pull Requests that are pending:
But also the PRs awaiting their author, and those that are blocked.

#### PR Ready to Test
![PR Ready to Test](images/presthubot-2.png)
![PR Ready to Test](../images/presthubot-2.png)

This returns Pull Requests that are awaiting QA on the various branches under development and on the modules.

### QA Automation

#### Nightly Board
![Nightly Board](images/presthubot-3.png)
![Nightly Board](../images/presthubot-3.png)

This returns the nightly status of the various branches under development and the autoupgrade module.

By status, we mean the number of tests that have passed, failed and are skipped, as well as the processing time.

#### PR Ready to Test
![PR Ready to Test](images/presthubot-4.png)
![PR Ready to Test](../images/presthubot-4.png)

This returns the various Pull Requests to be reviewed by the project's Software Developers in Test. It also indicates which maintainers have already approved them.

#### JIRA (Need a Github Path)
![JIRA (Need a Github Path)](images/presthubot-5.png)
![JIRA (Need a Github Path)](../images/presthubot-5.png)

This returns the various scenarios on JIRA which have been automated but which have not defined the test URL.

#### JIRA (Have an invalid Github Path)
![JIRA (Have an invalid Github Path)](images/presthubot-6.png)
![JIRA (Have an invalid Github Path)](../images/presthubot-6.png)

This returns the various scenarios on JIRA which have been automated but which have an invalid URL for the test.

#### Github issues (ToDo exist but GH are closed)
![Github issues (ToDo exist but GH are closed)](images/presthubot-7.png)
![Github issues (ToDo exist but GH are closed)](../images/presthubot-7.png)

In UI tests, the Software Developer in Test skips some tests due to the presence of bugs. To do this, they add a comment with the link to the issue representing the bug. Presthubot checks every day that the issues remain open as long as the comments are present. This means that a test can be activated as soon as the bug has been corrected (when the developer has not activated the test).
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
title: Test Scenarios
---

# Test Scenarios

## Goal

The Test Scenarios repository focuses on scenarios written by Software Testers (on a JIRA, not accessible to the public). Several tools have been developed:

* a tool for generating Markdown pages from XRay scenarios on JIRA
* a tool for synchronizing scenarios to be automated or in the process of being automated in issues
* a tool for updating a kanban based on the status of scenarios

## Schedule

* Every week day at 06:00 AM (for the generation of Markdown pages)
* Every week day at 07:00 AM (for the synchronization of scenarios in issues)

## Code

You can find workflows :

* Generate Markdown pages from XRay scenarios ([Github](https://github.com/PrestaShop/test-scenarios/blob/master/.github/workflows/gh-pages.yml))
* Synchronize XRay scenarios and Github Issues ([Github](https://github.com/PrestaShop/test-scenarios/blob/master/.github/workflows/sync-jira-gh.yml))
* Update Kanban based on the status of scenarios ([Github](https://github.com/PrestaShop/test-scenarios/blob/master/.github/workflows/gh-project-test.yml))

## How it works

### Generate Markdown pages from XRay scenarios

Two folders (**Core** and **Modules**) on JIRA are exported. The script uses the XRay API to retrieve the scenarios and their folders. Each XRay folder corresponds to a Hugo content directory. Each XRay scenario corresponds to a page of Hugo content.

**From XRay...**

![XRay : Page with a scenario](../images/test-scenarios-xray.png)

**... to Hugo.**
![Hugo : Page with a scenario](../images/test-scenarios-hugo.png)

### Synchronize XRay scenarios and Github Issues

The script use the following process:

* Fetch all XRay scenarios (To Be Automated / Automation In Progress / Automated)
* For each scenario:
* IF the XRay scenario has not linked Github issue
* THEN the script create a new issue;
* IF the XRay scenario has been updated (title or description)
* THEN the script update the Github issue (title & description);
* IF the linked Github issue has not the good assignee from JIRA,
* THEN the script update the Github issue (assignee);
* IF the linked Github issue has no label, or the linked Github issue has late labels,
* THEN the script update the Github issue (labels);
* IF the Github label is different of the XRay status
* THEN the script update the XRay scenario (status).


### Update Kanban based on the status of scenarios

The workflow use the `Machine-Maker/add-to-project-action` action to move in [Github project](https://github.com/orgs/PrestaShop/projects/30) some issues based on their labels:

* Label "`STATE : To Be Automated`" : Column "`Todo`"
* Label "`STATE : Automation in progress`" : Column "`In Progress`"
* Label "`STATE : Automated`" : Column "`Done`"

![Github project](../images/test-scenarios-github-project.png)