|
|
@ -142,7 +142,7 @@ Cypress.Commands.add("createTestApp", () => { |
|
|
const appName = "Cypress Tests" |
|
|
const appName = "Cypress Tests" |
|
|
cy.deleteApp(appName) |
|
|
cy.deleteApp(appName) |
|
|
cy.createApp(appName, "This app is used for Cypress testing.") |
|
|
cy.createApp(appName, "This app is used for Cypress testing.") |
|
|
cy.createScreen("home", "home") |
|
|
cy.createScreen("home") |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
Cypress.Commands.add("createTestTableWithData", () => { |
|
|
Cypress.Commands.add("createTestTableWithData", () => { |
|
|
@ -283,28 +283,59 @@ Cypress.Commands.add("navigateToDataSection", () => { |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
//Blank
|
|
|
//Blank
|
|
|
Cypress.Commands.add("createScreen", (screenName, route, accessLevelLabel) => { |
|
|
Cypress.Commands.add("createScreen", (route, accessLevelLabel) => { |
|
|
cy.contains("Design").click() |
|
|
cy.contains("Design").click() |
|
|
cy.get("[aria-label=AddCircle]").click() |
|
|
cy.get("[aria-label=AddCircle]").click() |
|
|
cy.get(".spectrum-Modal").within(() => { |
|
|
cy.get(".spectrum-Modal").within(() => { |
|
|
cy.get(".item").contains("Blank").click() |
|
|
cy.get(".item").contains("Blank screen").click() |
|
|
cy.get(".spectrum-Button").contains("Continue").click({ force: true }) |
|
|
cy.get(".spectrum-Button").contains("Continue").click({ force: true }) |
|
|
cy.wait(500) |
|
|
cy.wait(500) |
|
|
}) |
|
|
}) |
|
|
cy.get(".spectrum-Dialog-grid").within(() => { |
|
|
cy.get(".spectrum-Dialog-grid").within(() => { |
|
|
cy.get(".spectrum-Form-itemField").eq(0).type(route) |
|
|
cy.get(".spectrum-Form-itemField").eq(0).type(route) |
|
|
|
|
|
cy.get(".spectrum-Button").contains("Continue").click({ force: true }) |
|
|
|
|
|
cy.wait(1000) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
cy.get(".spectrum-Modal").within(() => { |
|
|
if (accessLevelLabel) { |
|
|
if (accessLevelLabel) { |
|
|
cy.get(".spectrum-Picker-label").click() |
|
|
cy.get(".spectrum-Picker-label").click() |
|
|
cy.wait(500) |
|
|
cy.wait(500) |
|
|
cy.contains(accessLevelLabel).click() |
|
|
cy.contains(accessLevelLabel).click() |
|
|
} |
|
|
} |
|
|
|
|
|
cy.get(".spectrum-Button").contains("Done").click({ force: true }) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("createDatasourceScreen", (datasourceName, accessLevelLabel) => { |
|
|
|
|
|
cy.contains("Design").click() |
|
|
|
|
|
cy.get("[aria-label=AddCircle]").click() |
|
|
|
|
|
cy.get(".spectrum-Modal").within(() => { |
|
|
|
|
|
cy.get(".item").contains("Autogenerated screens").click() |
|
|
cy.get(".spectrum-Button").contains("Continue").click({ force: true }) |
|
|
cy.get(".spectrum-Button").contains("Continue").click({ force: true }) |
|
|
cy.wait(1000) |
|
|
cy.wait(500) |
|
|
|
|
|
}) |
|
|
|
|
|
cy.get(".spectrum-Modal [data-cy='data-source-modal']").within(() => { |
|
|
|
|
|
cy.get(".data-source-entry").contains(datasourceName).should("exist") |
|
|
|
|
|
cy.get(".data-source-entry").contains(datasourceName).click({ force: true }) |
|
|
|
|
|
|
|
|
|
|
|
cy.get(".data-source-entry").contains(datasourceName).get(".data-source-check").should("exist") |
|
|
|
|
|
cy.get(".spectrum-Button").contains("Confirm").click({ force: true }) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
cy.get(".spectrum-Modal").within(() => { |
|
|
|
|
|
if (accessLevelLabel) { |
|
|
|
|
|
cy.get(".spectrum-Picker-label").click() |
|
|
|
|
|
cy.wait(500) |
|
|
|
|
|
cy.contains(accessLevelLabel).click() |
|
|
|
|
|
} |
|
|
|
|
|
cy.get(".spectrum-Button").contains("Done").click({ force: true }) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
cy.contains("Design").click() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cypress.Commands.add("navigateToAutogeneratedModal", () => { |
|
|
Cypress.Commands.add("navigateToAutogeneratedModal", () => { |
|
|
// Screen name must already exist within data source
|
|
|
// Screen name must already exist within data source
|
|
|
cy.contains("Design").click() |
|
|
cy.contains("Design").click() |
|
|
|