-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: LBAC-1704 tests end to end sur la recette (#825)
* feat: suppression inutilisé * feat: gitignore here * feat: gitignore * feat: env passé par yarn params * feat: ajout dans la ci recette * feat: tests ok * feat: test pas encore ok * feat: cleaning * feat: essai workflow preview * feat: syntax * feat: correct e2e action * feat: test prdv ok * Update .github/workflows/cypress.yml Co-authored-by: Moroine Bentefrit <[email protected]> * feat: ajustements * Update .github/workflows/cypress.yml Co-authored-by: Moroine Bentefrit <[email protected]> * fix: irrelevant here * feat: suppression vieux poc et mise en commentaire temp --------- Co-authored-by: Moroine Bentefrit <[email protected]>
- Loading branch information
Showing
16 changed files
with
229 additions
and
302 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,67 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
cypress_host: | ||
description: host name | ||
type: string | ||
required: true | ||
secrets: | ||
CODECOV_TOKEN: | ||
description: Code coverrage token | ||
required: true | ||
SLACK_WEBHOOK: | ||
description: Webhook slack | ||
required: true | ||
workflow_call: | ||
inputs: | ||
cypress_host: | ||
description: host name | ||
type: string | ||
required: true | ||
secrets: | ||
CODECOV_TOKEN: | ||
description: Code coverrage token | ||
required: true | ||
SLACK_WEBHOOK: | ||
description: Webhook slack | ||
required: true | ||
jobs: | ||
concurrency: | ||
group: "cypress-${{ github.workflow }}-${{ github.ref }}" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
**/node_modules | ||
.yarn/install-state.gz | ||
.yarn/cache | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: yarn- | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Run cypress e2e tests | ||
run: yarn e2e:headless --env ui=${{inputs.cypress_host}},server=${{inputs.cypress_host}} | ||
|
||
- name: Notify failure on Slack | ||
uses: ravsamhq/notify-slack-action@v2 | ||
if: ${{ failure() }} && ${{ inputs.environment }} == 'recette' | ||
with: | ||
status: ${{ job.status }} | ||
notification_title: "Les tests e2e ne sont pas passés : ${{ inputs.app_version }} en ${{ inputs.environment }}" | ||
message_format: "{emoji} *[${{ inputs.environment }}]* *{workflow}* {status_message} in <{repo_url}|{branch}> on <{commit_url}|{commit_sha}>. You can get error logs using `.bin/mna-lba deploy:log:decrypt ${{ github.run_id }}`" | ||
notify_when: "failure" | ||
mention_groups: "!channel" | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -166,3 +166,5 @@ SEED_PASSPHRASE.txt | |
seed.gz | ||
|
||
cypress.env.json | ||
|
||
assets/* |
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,2 @@ | ||
/screenshots/* | ||
/videos/* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,37 +1,45 @@ | ||
describe("send-job-application", () => { | ||
it("tests send-job-application", () => { | ||
cy.viewport(1254, 704) | ||
cy.visit("https://labonnealternance-recette.apprentissage.beta.gouv.fr/") | ||
cy.get("form > div > div.css-0 input").click() | ||
cy.get("form > div > div.css-0 input").type("ress") | ||
cy.get("#lang-switcher-item-0").click() | ||
cy.get("div.css-1kw2fa0 div.containerIdentity").click() | ||
cy.get("div.css-1kw2fa0 input").click() | ||
cy.get("div.css-1kw2fa0 input").type("pari") | ||
cy.get("#lang-switcher-item-0 > strong").click() | ||
cy.get("div.css-6st093 div:nth-of-type(3) select").click() | ||
cy.get("div.css-6st093 div:nth-of-type(3) select").type("60") | ||
cy.get("div.css-uos98o img").click() | ||
cy.get("div.css-gmd149 button:nth-of-type(2)").click() | ||
cy.get("#matcha648adcb8258b0842bb1afcc1 > div").click() | ||
cy.get("[data-testid='CandidatureSpontanee'] button").click() | ||
cy.get("[data-testid='lastName']").click() | ||
cy.get("[data-testid='lastName']").type("Doe") | ||
cy.get("[data-testid='firstName']").click() | ||
cy.get("[data-testid='firstName']").type("John") | ||
cy.get("[data-testid='email']").click() | ||
cy.get("[data-testid='email']").type("[email protected]") | ||
cy.get("[data-testid='phone']").click() | ||
cy.get("[data-testid='phone']").type("0700000000") | ||
cy.get("[data-testid='message']").click() | ||
cy.get("[data-testid='message']").rightclick() | ||
cy.get("[data-testid='message']").type( | ||
"Madame, Monsieur,\nEtant actuellement à la recherche d’un emploi, je me permets de vous proposer ma candidature au poste de (emploi).\n\nEn effet, mon profil correspond à la description recherchée sur l’offre d’emploi (préciser où l’annonce a été vue). (Si le candidat possède peu d’expérience professionnelle) Ma formation en (préciser la formation) m'a permis d'acquérir de nombreuses compétences parmi celles que vous recherchez. Je possède tous les atouts qui me permettront de réussir dans le rôle que vous voudrez bien me confier. Motivation, rigueur et écoute sont les maîtres mots de mon comportement professionnel.(Si le candidat possède une expérience significative dans le poste à pourvoir). Mon expérience en tant que (emploi) m’a permis d’acquérir toutes les connaissances nécessaires à la bonne exécution des tâches du poste à pourvoir. Régulièrement confronté aux aléas du métier, je suis capable de répondre aux imprévus en toute autonomie. Intégrer votre entreprise représente pour moi un réel enjeu d’avenir dans lequel mon travail et mon honnêteté pourront s’exprimer pleinement.\n\nRestant à votre disposition pour toute information complémentaire, je suis disponible pour vous rencontrer lors d’un entretien à votre convenance\n\nVeuillez agréer, Madame, Monsieur, l’expression de mes sincères salutations." | ||
) | ||
cy.get("p.css-1egmowt").click() | ||
cy.get("[data-testid='fileDropzone']").type("C:\\fakepath\\CV - John Doe.pdf") | ||
cy.get("[data-testid='candidature-not-sent']").click() | ||
cy.get("p.css-x9fc5p").click() | ||
it("tests send-job-application on " + Cypress.env("ui") + " --- " + Cypress.env("server"), () => { | ||
cy.on("uncaught:exception", () => { | ||
return false | ||
}) | ||
|
||
cy.intercept("GET", Cypress.env("server") + "/api/v1/jobs?*").as("submitJobCall") | ||
cy.intercept("POST", Cypress.env("server") + "/api/v1/application").as("submitApplication") | ||
|
||
cy.generateRandomEmail("test-auto-", "@nexistepas.fr", 10).then((randomEmail) => { | ||
cy.viewport(1254, 704) | ||
cy.visit(Cypress.env("ui") + "?displayMap=false") | ||
cy.get("#headerFormJobField-input").click() | ||
cy.get("#headerFormJobField-input").type("gestion inf") | ||
cy.get("#headerFormJobField-item-0").click() | ||
cy.get("#headerFormJobField-input").should("have.value", "Gestion de projets informatiques") | ||
cy.get("#headerFormPlaceField-input").click() | ||
cy.get("#headerFormPlaceField-input").type("lill") | ||
cy.get("#headerFormPlaceField-item-0").click() | ||
cy.get("[data-testid='widget-form'] select[data-testid='locationRadius']").select("60") | ||
cy.get("[data-testid='widget-form'] button").click() | ||
|
||
cy.wait("@submitJobCall").then(() => { | ||
cy.get(".resultCard.matcha").first().click() | ||
cy.get("[data-testid='CandidatureSpontanee'] button").click() | ||
cy.get("[data-testid='lastName']").click() | ||
cy.get("[data-testid='lastName']").type("Doe") | ||
cy.get("[data-testid='firstName']").click() | ||
cy.get("[data-testid='firstName']").type("John") | ||
cy.get("[data-testid='email']").click() | ||
cy.get("[data-testid='email']").type(randomEmail) | ||
cy.get("[data-testid='phone']").click() | ||
cy.get("[data-testid='phone']").type("0700000000") | ||
cy.get("[data-testid='message']").click() | ||
cy.get("[data-testid='message']").type("Madame, Monsieur,\nEtant actuellement à la recherche d’un emploi, ...") | ||
cy.get("[data-testid='fileDropzone']").selectFile("cypress/fixtures/CV - John Doe.docx", { action: "drag-drop" }) | ||
cy.get("[data-testid='candidature-not-sent']").click() | ||
|
||
cy.wait("@submitApplication").then(() => { | ||
cy.get("[data-testid='CandidatureSpontaneeWorked']") | ||
}) | ||
}) | ||
}) | ||
}) | ||
}) | ||
//# recorderSourceMap=BCBDBEBFBGBHBIBJBKBLBMBNBOAOBPBQAQAQBRARBSBTBUBVBWBXBYBZBaBbBcBdBeBfAfB |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.