-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(e2e): modification du test e2e integration afin d'enlever les fai…
…lure aléatoires (#5847)
- Loading branch information
1 parent
4ca3b9e
commit 7e5ad15
Showing
2 changed files
with
53 additions
and
26 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...e-du-travail-frontend/cypress/integration/light/integration-convention-collective.spec.ts
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,41 @@ | ||
Cypress.Commands.add("getIframe" as any, () => { | ||
return cy | ||
.get("iframe") | ||
.its("0.contentDocument.body") | ||
.should("not.be.empty") | ||
.then(cy.wrap); | ||
}); | ||
|
||
describe("Pages integration convention collective", () => { | ||
it("should display iframe convention collective", () => { | ||
cy.visit("/integration/convention-collective", { | ||
onBeforeLoad(win) { | ||
cy.spy(win, "postMessage").as("postMessage"); | ||
}, | ||
}); | ||
|
||
// @ts-ignore | ||
cy.getIframe().as("iframe"); | ||
|
||
cy.get("@iframe").contains("Trouver sa convention collective"); | ||
cy.get("@iframe").find("#enterprise-search").as("entreprise-search"); | ||
cy.get("@entreprise-search").type("carrefour"); | ||
cy.get("@iframe").find("button[type=submit]").as("button-submit"); | ||
cy.get("@button-submit").click(); | ||
cy.get("@iframe").contains("CARREFOUR HYPERMARCHES").as("entreprise"); | ||
cy.get("@entreprise").click(); | ||
cy.get("@iframe").contains("Conventions collectives").as("cc"); | ||
cy.get("@cc").click(); | ||
cy.get("@postMessage") | ||
.should("have.been.calledOnce") | ||
.and("have.been.calledWithExactly", { | ||
name: "agreement", | ||
kind: "select", | ||
extra: { | ||
idcc: 2216, | ||
title: | ||
"Convention collective nationale du commerce de détail et de gros à prédominance alimentaire du 12 juillet 2001. Etendue par arrêté du 26 juillet 2002 JORF 6 août 2002.", | ||
}, | ||
}, "*"); | ||
}); | ||
}); |
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