|
|
|
@ -32,7 +32,17 @@ Cypress.Commands.add("login", () => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
Cypress.Commands.add("createApp", name => { |
|
|
|
Cypress.Commands.add("closeModal", () => { |
|
|
|
cy.get(".spectrum-Modal").within(() => { |
|
|
|
cy.get(".close-icon").click() |
|
|
|
cy.wait(500) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
Cypress.Commands.add("createApp", (name, addDefaultTable) => { |
|
|
|
const shouldCreateDefaultTable = |
|
|
|
typeof addDefaultTable != "boolean" ? true : addDefaultTable |
|
|
|
|
|
|
|
cy.visit(`${Cypress.config().baseUrl}/builder`) |
|
|
|
cy.wait(500) |
|
|
|
cy.get(`[data-cy="create-app-btn"]`).click({ force: true }) |
|
|
|
@ -51,7 +61,9 @@ Cypress.Commands.add("createApp", name => { |
|
|
|
cy.get(".spectrum-ButtonGroup").contains("Create app").click() |
|
|
|
cy.wait(10000) |
|
|
|
}) |
|
|
|
cy.createTable("Cypress Tests", true) |
|
|
|
if (shouldCreateDefaultTable) { |
|
|
|
cy.createTable("Cypress Tests", true) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
Cypress.Commands.add("deleteApp", name => { |
|
|
|
@ -293,20 +305,37 @@ Cypress.Commands.add("createScreen", (screenName, route, accessLevelLabel) => { |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
Cypress.Commands.add("createAutogeneratedScreens", screenNames => { |
|
|
|
Cypress.Commands.add("navigateToAutogeneratedModal", () => { |
|
|
|
// Screen name must already exist within data source
|
|
|
|
cy.contains("Design").click() |
|
|
|
cy.get("[aria-label=AddCircle]").click() |
|
|
|
cy.get(".spectrum-Button").contains("Add screens").click({ force: true }) |
|
|
|
cy.wait(500) |
|
|
|
cy.get(".spectrum-Modal").within(() => { |
|
|
|
cy.get(".item").contains("Autogenerated Screens").click() |
|
|
|
cy.get(".spectrum-Button").contains("Add screens").click({ force: true }) |
|
|
|
cy.wait(500) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
for (let i = 0; i < screenNames.length; i++) { |
|
|
|
cy.get(".data-source-entry").contains(screenNames[i]).click() |
|
|
|
} |
|
|
|
Cypress.Commands.add( |
|
|
|
"createAutogeneratedScreens", |
|
|
|
(screenNames, accessLevelLabel) => { |
|
|
|
cy.navigateToAutogeneratedModal() |
|
|
|
|
|
|
|
cy.get(".spectrum-Button").contains("Add screens").click({ force: true }) |
|
|
|
cy.wait(4000) |
|
|
|
}) |
|
|
|
for (let i = 0; i < screenNames.length; i++) { |
|
|
|
cy.get(".data-source-entry").contains(screenNames[i]).click() |
|
|
|
} |
|
|
|
|
|
|
|
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("Confirm").click({ force: true }) |
|
|
|
cy.wait(4000) |
|
|
|
}) |
|
|
|
} |
|
|
|
) |
|
|
|
|
|
|
|
Cypress.Commands.add("addRow", values => { |
|
|
|
cy.contains("Create row").click() |
|
|
|
|