From 7d99427b17960de19c84a396c75527393222724b Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Tue, 6 Sep 2022 12:14:17 +0100 Subject: [PATCH] Updating commands.js - createDatasourceScreen These changes are related to the autoScreensUI tests failing on the smoke build CI run. I've changed timeout values and reworking data-cy IDs --- packages/builder/cypress/support/commands.js | 21 ++++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 651ff7eabe..e7f753fdb0 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -637,21 +637,20 @@ Cypress.Commands.add( (datasourceNames, accessLevelLabel) => { cy.contains("Design").click() cy.get(".spectrum-Button").contains("Add screen").click({ force: true }) - cy.get(".spectrum-Modal").within(() => { - cy.get(".item").contains("Autogenerated screens").click() + cy.get(".spectrum-Dialog-grid").within(() => { + cy.get("[data-cy='autogenerated-screens']").click() cy.get(".spectrum-Button").contains("Continue").click({ force: true }) }) - cy.get(".spectrum-Modal [data-cy='data-source-modal']", { - timeout: 20000, - }).within(() => { + cy.get("[data-cy='autogenerated-screens']").should("not.exist") + cy.get("[data-cy='data-source-modal']", { timeout: 10000 }).within(() => { for (let i = 0; i < datasourceNames.length; i++) { - cy.get(".data-source-entry", { timeout: 10000 }) - .contains(datasourceNames[i], { timeout: 10000 }) - .click({ force: true }) - //Ensure the check mark is visible cy.get(".data-source-entry") - .contains(datasourceNames[i], { timeout: 10000 }) - .get(".data-source-check", { timeout: 10000 }) + .contains(datasourceNames[i], { timeout: 20000 }) + .click({ force: true }) + // Ensure the check mark is visible + cy.get(".data-source-entry") + .contains(datasourceNames[i]) + .get(".data-source-check", { timeout: 20000 }) .should("exist") }