From 32579aede875d361d6c494308a995cceaa5b07ed Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 2 Jun 2021 18:28:05 +0100 Subject: [PATCH] Some fixes after test failures in CI. --- .../cypress/integration/createView.spec.js | 16 ++++++++-------- packages/builder/cypress/support/commands.js | 7 ++++++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index 6c8aa2004d..71c0b52c60 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -17,12 +17,12 @@ context("Create a View", () => { }) it("creates a view", () => { - cy.contains("Create New View").click() - cy.get(".menu-container").within(() => { - cy.get("input").type("Test View") - cy.contains("Save View").click() + cy.contains("Create view").click() + cy.get(".spectrum-Dialog-grid").within(() => { + cy.get("input").type("Test view") + cy.get(".spectrum-Button--cta").click() }) - cy.get(".table-title h1").contains("Test View") + cy.get(".table-title h1").contains("Test view") cy.get("[data-cy=table-header]").then($headers => { expect($headers).to.have.length(3) const headers = Array.from($headers).map(header => @@ -125,7 +125,7 @@ context("Create a View", () => { }) it("renames a view", () => { - cy.contains(".nav-item", "Test View") + cy.contains(".nav-item", "Test view") .find(".ri-more-line") .click({ force: true }) cy.get("[data-cy=edit-view]").click() @@ -134,11 +134,11 @@ context("Create a View", () => { cy.contains("Save").click() }) cy.wait(1000) - cy.contains("Test View Updated").should("be.visible") + cy.contains("Test view Updated").should("be.visible") }) it("deletes a view", () => { - cy.contains(".nav-item", "Test View Updated") + cy.contains(".nav-item", "Test view Updated") .find(".ri-more-line") .click({ force: true }) cy.get("[data-cy=delete-view]").click() diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 70d2f1644a..0626ea03af 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -134,7 +134,11 @@ Cypress.Commands.add("createUser", email => { cy.get(".spectrum-Button--primary").click() cy.get(".spectrum-Picker-label").click() cy.get(".spectrum-Menu-item:nth-child(2) > .spectrum-Menu-itemLabel").click() - cy.get(".spectrum-Modal input").eq(1).type(email, { force: true }) + cy.get( + ":nth-child(2) > .spectrum-Form-itemField > .spectrum-Textfield > .spectrum-Textfield-input" + ) + .first() + .type(email, { force: true }) cy.get(".spectrum-Button--cta").click({ force: true }) }) @@ -164,6 +168,7 @@ Cypress.Commands.add("getComponent", componentId => { }) Cypress.Commands.add("navigateToFrontend", () => { + cy.wait(1000) cy.contains("Design").click() })