-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add mechanism for reusable scenarios, #198
- Loading branch information
1 parent
19f153b
commit 3927124
Showing
32 changed files
with
504 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# Reusable scenarios | ||
|
||
:::caution | ||
**Only available for developers** | ||
|
||
Reusable scenarios cannot be used in conjunction with each other | ||
::: | ||
|
||
## Create file with extension .playbook.feature | ||
File with this extension contains reusable scenarios. | ||
|
||
```gherkin title='uuv/e2e/playbook/template.playbook.feature' | ||
@Ignore //Only used with playwright | ||
Feature: Template | ||
Scenario: I go to town list | ||
When I visit path "https://e2e-test-quest.github.io/weather-app/" | ||
And Within a button named "Get started" | ||
And I click | ||
Scenario: I select douala | ||
When I visit path "https://e2e-test-quest.github.io/weather-app/" | ||
And Within a button named "Get started" | ||
And I click | ||
And I reset context | ||
And Within a list named "Available Towns" | ||
And Within a list item named "Douala" | ||
And I click | ||
And I reset context | ||
``` | ||
|
||
## Create a file with extension .playbooked.feature | ||
Files with this extension contains scenarios using reusable scenarios. | ||
|
||
```gherkin title='uuv/e2e/playbook/weatherApp.playbooked.feature' | ||
@Ignore //Only used with playwright | ||
Feature: Feature using reusable scenarios | ||
Scenario: vital check on first page | ||
Given I go to town list | ||
Then I should see a title named "Nothing to display" | ||
Scenario: vital check on second page | ||
Given I select douala | ||
Then Within the element with aria-label "Weather of Douala" | ||
And I should see a title named "Douala" | ||
And I should see an element with content "min: 10.8 °c" | ||
``` | ||
|
||
## Launch script to generate executable feature | ||
this script replace playbook scenarios name by playbook scenarios steps. | ||
|
||
<Tabs> | ||
<TabItem value="Npm" label="Npm"> | ||
|
||
```shell | ||
npx uuv playbook | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="Yarn" label="Yarn"> | ||
|
||
```shell | ||
yarn uuv playbook | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
71 changes: 71 additions & 0 deletions
71
.../fr/docusaurus-plugin-content-docs/current/03-wordings/03-reusable-scenarios.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# Scénarios réutilisables | ||
|
||
:::caution | ||
**Disponible seulement pour les développeurs** | ||
|
||
Les scénarios réutilisables ne peuvent être utilisés entre eux. | ||
::: | ||
|
||
## Créer un fichier avec l'extension .playbook.feature | ||
Les fichiers avec cette extension contiennent des scénarios réutilisables | ||
|
||
```gherkin title='uuv/e2e/playbook/template.playbook.feature' | ||
@Ignore //Seulement utile avec playwright | ||
#language: fr | ||
Fonctionnalité: Template | ||
Scénario: j'aille à la liste des villes | ||
Lorsque je visite l'Url "https://e2e-test-quest.github.io/weather-app/" | ||
Et je vais à l'intérieur de bouton nommé "Get started" | ||
Et je clique | ||
Scénario: je sélectionne douala | ||
Lorsque je visite l'Url "https://e2e-test-quest.github.io/weather-app/" | ||
Et je vais à l'intérieur de bouton nommé "Get started" | ||
Et je clique | ||
Et je reinitialise le contexte | ||
Et je vais à l'intérieur de liste nommée "Available Towns" | ||
Et je vais à l'intérieur de élément de liste nommé "Douala" | ||
Et je clique | ||
Et je reinitialise le contexte | ||
``` | ||
|
||
## Créer un fichier avec l'extension .playbooked.feature | ||
Les fichiers avec cet extension contiennent des scénarios utilisant les scénarios réutilisables | ||
|
||
```gherkin title='uuv/e2e/playbook/weatherApp.playbooked.feature' | ||
@Ignore //Seulement utile avec playwright | ||
#language: fr | ||
Fonctionnalité: Fonctionnalité utilisant les scénarios réutilisables | ||
Scénario: vérification vital de la première page | ||
Etant donné que j'aille à la liste des villes | ||
Alors je dois voir un titre nommé "Nothing to display" | ||
Scénario: vérification vital de la seconde page | ||
Etant donné que je sélectionne douala | ||
Lorsque je vais à l'intérieur de l'élément ayant pour aria-label "Weather of Douala" | ||
Alors je dois voir un titre nommé "Douala" | ||
Et je dois voir un élément qui contient "min: 10.8 °c" | ||
``` | ||
|
||
## Lancement du script de génération de feature éxecutable | ||
Ce script remplace les noms de scénarios des playbooks par les étapes de scénarios des playbooks. | ||
|
||
<Tabs> | ||
<TabItem value="Npm" label="Npm"> | ||
|
||
```shell | ||
npx uuv playbook | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="Yarn" label="Yarn"> | ||
|
||
```shell | ||
yarn uuv playbook | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.