-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
035f259
commit acd9938
Showing
8 changed files
with
5,275 additions
and
2 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
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,35 @@ | ||
// | ||
|
||
import { addCucumberPreprocessorPlugin } from "@badeball/cypress-cucumber-preprocessor"; | ||
import { createEsbuildPlugin } from "@badeball/cypress-cucumber-preprocessor/esbuild"; | ||
import createBundler from "@bahmutov/cypress-esbuild-preprocessor"; | ||
import { defineConfig } from "cypress"; | ||
|
||
// | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
baseUrl: "http://localhost:3000", | ||
specPattern: "**/*.feature", | ||
setupNodeEvents, | ||
supportFile: false, | ||
}, | ||
}); | ||
|
||
// | ||
|
||
async function setupNodeEvents( | ||
on: Cypress.PluginEvents, | ||
config: Cypress.PluginConfigOptions | ||
) { | ||
await addCucumberPreprocessorPlugin(on, config); | ||
|
||
on( | ||
"file:preprocessor", | ||
createBundler({ | ||
plugins: [createEsbuildPlugin(config)], | ||
}) | ||
); | ||
|
||
return config; | ||
} |
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,16 @@ | ||
#language: fr | ||
Fonctionnalité: Connexion de [email protected] | ||
|
||
Scénario: Connexion d'un utilisateur | ||
Etant donné que je navigue sur la page | ||
Alors je vois "Bonjour monde !" | ||
Quand je clique sur le bouton MonComptePro | ||
|
||
Quand je me connecte en tant que user@yopmail.com sur moncomptepro | ||
Et je vois "Votre organisation de rattachement" sur moncomptepro | ||
Et je click sur "Continuer" sur moncomptepro | ||
|
||
Alors je suis redirigé sur "/" | ||
Et je vois "Information utilisateur" | ||
Et je vois "[email protected]" | ||
Et je vois "International knowledge practice leader" |
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,58 @@ | ||
// | ||
|
||
import { Given, Then, When } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
// | ||
|
||
Given("je navigue sur la page", () => { | ||
cy.visit("/"); | ||
}); | ||
|
||
When("je clique sur le bouton MonComptePro", () => { | ||
cy.get(".moncomptepro-button").click(); | ||
}); | ||
|
||
When("je suis redirigé sur {string}", (path: string) => { | ||
cy.url().should("contain", path); | ||
}); | ||
|
||
Then("je vois {string}", function (text: string) { | ||
cy.contains(text); | ||
}); | ||
|
||
// | ||
|
||
When("je vois {string} sur moncomptepro", (_text: string) => { | ||
cy.origin( | ||
"https://app-test.moncomptepro.beta.gouv.fr", | ||
{ args: _text }, | ||
(text) => { | ||
cy.contains(text); | ||
} | ||
); | ||
}); | ||
|
||
When("je click sur {string} sur moncomptepro", (_text: string) => { | ||
cy.origin( | ||
"https://app-test.moncomptepro.beta.gouv.fr", | ||
{ args: _text }, | ||
(text) => { | ||
cy.contains(text).click(); | ||
} | ||
); | ||
}); | ||
|
||
When( | ||
"je me connecte en tant que [email protected] sur moncomptepro", | ||
(path: string) => { | ||
cy.origin("https://app-test.moncomptepro.beta.gouv.fr", () => { | ||
cy.get('[name="login"]').type("[email protected]"); | ||
cy.get('[type="submit"]').click(); | ||
|
||
cy.get('[name="password"]').type("[email protected]"); | ||
cy.get('[action="/users/sign-in"] [type="submit"]') | ||
.contains("Se connecter") | ||
.click(); | ||
}); | ||
} | ||
); |
Oops, something went wrong.