From e7089a26cd520668d5bc373cda912681ebf1f006 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 28 Apr 2021 14:56:31 +0100 Subject: [PATCH] Update cpyress tests so create and delete app helpers work again --- packages/builder/cypress/support/commands.js | 47 ++++++++++++------- .../src/components/settings/Link.svelte | 4 +- .../builder/[application]/data/_layout.svelte | 2 +- 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 9cebfd81dc..8f89cfc925 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -40,20 +40,29 @@ Cypress.Commands.add("createApp", name => { } }) .then(() => { - cy.get("input[name=applicationName]") - .type(name) - .should("have.value", name) - cy.contains("Next").click() - cy.get("input[name=email]") - .click() - .type("test@test.com") - cy.get("input[name=password]") - .click() - .type("test") - cy.contains("Submit").click() - cy.get("[data-cy=new-table]", { - timeout: 20000, - }).should("be.visible") + cy.get(".spectrum-Modal") + .within(() => { + cy.get("input") + .eq(0) + .type(name) + .should("have.value", name) + .blur() + cy.contains("Next").click() + cy.get("input") + .eq(1) + .type("test@test.com") + .blur() + cy.get("input") + .eq(2) + .type("test") + .blur() + cy.contains("Submit").click() + }) + .then(() => { + cy.get("[data-cy=new-table]", { + timeout: 20000, + }).should("be.visible") + }) }) }) @@ -62,11 +71,15 @@ Cypress.Commands.add("deleteApp", name => { cy.get(".apps").then($apps => { cy.wait(1000) if ($apps.find(`[data-cy="app-${name}"]`).length) { - cy.get(`[data-cy="app-${name}"] a`).click() + cy.get(`[data-cy="app-${name}"]`) + .contains("Open") + .click() cy.get("[data-cy=settings-icon]").click() - cy.get(".modal-content").within(() => { + cy.get(".spectrum-Dialog").within(() => { cy.contains("Danger Zone").click() - cy.get("input").type("DELETE") + cy.get("input") + .type("DELETE") + .blur() cy.contains("Delete Entire App").click() }) } diff --git a/packages/builder/src/components/settings/Link.svelte b/packages/builder/src/components/settings/Link.svelte index 41e09104f9..fdfc8bb613 100644 --- a/packages/builder/src/components/settings/Link.svelte +++ b/packages/builder/src/components/settings/Link.svelte @@ -1,6 +1,6 @@ @@ -9,7 +9,7 @@ class="topnavitemright settings" data-cy="settings-icon" on:click={modal.show}> - + diff --git a/packages/builder/src/pages/builder/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/[application]/data/_layout.svelte index 5bc50b9afd..18f81114b2 100644 --- a/packages/builder/src/pages/builder/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/builder/[application]/data/_layout.svelte @@ -54,7 +54,7 @@
+ data-cy={`new-${selected === 'External' ? 'datasource' : 'table'}`}>