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
This commit is contained in:
Mitch-Budibase 2022-09-06 12:14:17 +01:00
parent 2278494817
commit d7c55b0968
1 changed files with 10 additions and 11 deletions

View File

@ -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")
}