Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1592 from mendix/test/fix-color-picker-flaky-test
Browse files Browse the repository at this point in the history
Add retries to color picker web e2e test
  • Loading branch information
leonardomendix committed Aug 24, 2022
2 parents 292513a + e48a797 commit a9f76d9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
1 change: 1 addition & 0 deletions configs/e2e/cypress/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = defineConfig({
});
},
baseUrl: "http://localhost:8080",
retries: 2,
video: false,
videoUploadOnPasses: false,
viewportHeight: 1080,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,40 @@
describe("color-picker-web", () => {
const cleanMendixSession = () => {
cy.window().then(window => {
// Cypress opens a new session for every test, so it exceeds mendix license limit of 5 sessions, we need to logout after each test.
window.mx.session.logout();
});
};

afterEach(() => cleanMendixSession());

describe("render a picker of mode", () => {
it("button", { browser: "!firefox" }, () => {
cy.visit("/p/modePage");
cy.wait(4000);
cy.get(".mx-name-colorPicker3").should("be.visible", true);
cy.get(".mx-name-colorPicker3 .widget-color-picker-inner").should(
"have.css",
"background",
"rgb(76, 175, 80) none repeat scroll 0% 0% / auto padding-box border-box"
);
});
it("button", { browser: "firefox" }, () => {
it(
"button",
{
retries: {
runMode: 10,
openMode: 10
},
browser: "!firefox"
},
() => {
cy.visit("/p/modePage");
cy.wait(5000);
cy.get(".mx-name-colorPicker3 .widget-color-picker-inner", { timeout: 10000 }).should(
"be.visible",
true
);
cy.get(".mx-name-navigationTree3-2").click({ force: true });
cy.wait(5000);
cy.get(".mx-name-colorPicker3 .widget-color-picker-inner", { timeout: 10000 }).should(
"have.css",
"background",
"rgba(0, 0, 0, 0) none repeat scroll 0% 0% / auto padding-box border-box"
);
}
);
it("button(Firefox)", { browser: "firefox" }, () => {
cy.visit("/p/modePage");
cy.wait(1000);
cy.get(".mx-name-colorPicker3 .widget-color-picker-inner").should(
Expand Down

0 comments on commit a9f76d9

Please sign in to comment.