1
0
Fork 0
mirror of synced 2024-06-16 09:25:12 +12:00

Cypress: Test changes for UI + Components

Mainly updating the searchAndAddComponent test command

- Removing skips from a few tests also
This commit is contained in:
Mitch-Budibase 2022-08-01 17:29:56 +01:00
parent 328c3a8754
commit cacb0e88a4
5 changed files with 21 additions and 16 deletions

View file

@ -10,10 +10,8 @@ filterTests(['smoke', 'all'], () => {
it("should disable the autogenerated screen options if no sources are available", () => {
cy.createApp("First Test App", false)
cy.closeModal();
cy.contains("Design").click()
cy.navigateToAutogeneratedModal()
cy.get(interact.CONFIRM_WRAP_SPE_BUTTON).should('be.disabled')

View file

@ -179,7 +179,7 @@ filterTests(["all"], () => {
cy.get(".nav-item").should("contain", queryName)
})
xit("should duplicate a query", () => {
it("should duplicate a query", () => {
/// Get query nav item - QueryName
cy.get(".nav-item")
.contains(queryName)

View file

@ -204,7 +204,7 @@ filterTests(["all"], () => {
cy.get(".spectrum-Table").eq(1).should("contain", queryName)
})
xit("should duplicate a query", () => {
it("should duplicate a query", () => {
// Locate previously created query
cy.get(".nav-item")
.contains(queryName)

View file

@ -2,7 +2,7 @@ import filterTests from "../support/filterTests"
const interact = require('../support/interact')
filterTests(["smoke", "all"], () => {
xcontext("Query Level Transformers", () => {
context("Query Level Transformers", () => {
before(() => {
cy.login()
cy.createTestApp()

View file

@ -543,15 +543,22 @@ Cypress.Commands.add("addCustomSourceOptions", totalOptions => {
// DESIGN SECTION
Cypress.Commands.add("searchAndAddComponent", component => {
// Open component menu
cy.get(".spectrum-Button").contains("Component").click({ force: true })
cy.get(".icon-side-nav").within(() => {
cy.get(".icon-side-nav-item").eq(1).click()
})
cy.get(".add-component > .spectrum-Button")
.contains("Add component")
.click({ force: true })
cy.get(".container", { timeout: 1000 }).within(() => {
cy.get(".title").should("contain", "Add component")
// Search and add component
cy.wait(500)
cy.get(".spectrum-Textfield-input").clear().type(component)
cy.get(".body").within(() => {
cy.get(".component")
.contains(new RegExp("^" + component + "$"), { timeout: 3000 })
.click({ force: true })
// Search and add component
cy.get(".spectrum-Textfield-input").clear().type(component)
cy.get(".body").within(() => {
cy.get(".component")
.contains(new RegExp("^" + component + "$"), { timeout: 3000 })
.click({ force: true })
})
})
cy.wait(1000)
cy.location().then(loc => {
@ -597,7 +604,7 @@ Cypress.Commands.add("getComponent", componentId => {
Cypress.Commands.add("createScreen", (route, accessLevelLabel) => {
// Blank Screen
cy.contains("Design").click()
cy.get(".header > .add-button").click()
cy.get(".spectrum-Button").contains("Add screen").click({ force: true })
cy.get(".spectrum-Modal").within(() => {
cy.get("[data-cy='blank-screen']").click()
cy.get(".spectrum-Button").contains("Continue").click({ force: true })
@ -622,7 +629,7 @@ Cypress.Commands.add(
"createDatasourceScreen",
(datasourceNames, accessLevelLabel) => {
cy.contains("Design").click()
cy.get(".header > .add-button").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-Button").contains("Continue").click({ force: true })
@ -742,7 +749,7 @@ Cypress.Commands.add("navigateToDataSection", () => {
Cypress.Commands.add("navigateToAutogeneratedModal", () => {
// Screen name must already exist within data source
cy.contains("Design").click()
cy.get(".header > .add-button").click()
cy.get(".spectrum-Button").contains("Add screen").click({ force: true })
cy.get(".spectrum-Modal").within(() => {
cy.get(".item", { timeout: 2000 })
.contains("Autogenerated screens")