Adding tags to tests
Currently there is 'smoke' and 'all' tags
This commit is contained in:
parent
9034f23fde
commit
8b8cb21ec3
|
@ -1,4 +1,7 @@
|
|||
context("Add Multi-Option Datatype", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
context("Add Multi-Option Datatype", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -39,4 +42,4 @@ context("Add Multi-Option Datatype", () => {
|
|||
})
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
context("Add Radio Buttons", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
context("Add Radio Buttons", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
})
|
||||
|
||||
it("should add Radio Buttons options picker on form, add data, and confirm", () => {
|
||||
it("should add Radio Buttons options picker on form, add data, and confirm", () => {
|
||||
cy.navigateToFrontend()
|
||||
cy.addComponent("Form", "Form")
|
||||
cy.addComponent("Form", "Options Picker").then((componentId) => {
|
||||
|
@ -32,4 +35,5 @@ it("should add Radio Buttons options picker on form, add data, and confirm", ()
|
|||
})
|
||||
cy.addCustomSourceOptions(totalRadioButtons)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Auto Screens UI", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Auto Screens UI", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -44,4 +47,5 @@ context("Auto Screens UI", () => {
|
|||
.and('contain', 'books/new/row')
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Change Application Icon and Colour", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
context("Change Application Icon and Colour", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
})
|
||||
|
@ -36,4 +39,5 @@ context("Change Application Icon and Colour", () => {
|
|||
.should('have.attr', 'style').and('contains', 'color')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
context("Create an Application", () => {
|
||||
import filterTests from '../support/filterTests'
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Create an Application", () => {
|
||||
it("should create a new application", () => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||
cy.contains("Cypress Tests").should("exist")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Create a automation", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Create a automation", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -62,4 +65,5 @@ context("Create a automation", () => {
|
|||
cy.contains("Data").click()
|
||||
cy.contains("automationGoodboy")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Create Bindings", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Create Bindings", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -42,9 +45,9 @@ context("Create Bindings", () => {
|
|||
cy.getComponent(componentId).should("have.text", "3")
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
const addSettingBinding = (setting, bindingText, clickOption = true) => {
|
||||
const addSettingBinding = (setting, bindingText, clickOption = true) => {
|
||||
cy.get(`[data-cy="setting-${setting}"] [data-cy=text-binding-button]`).click()
|
||||
cy.get(".drawer").within(() => {
|
||||
if (clickOption) {
|
||||
|
@ -55,4 +58,5 @@ const addSettingBinding = (setting, bindingText, clickOption = true) => {
|
|||
}
|
||||
cy.contains("Save").click()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
// TODO for now components are skipped, might not be good to keep doing this
|
||||
xcontext("Create Components", () => {
|
||||
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
xcontext("Create Components", () => {
|
||||
let headlineId
|
||||
|
||||
before(() => {
|
||||
|
@ -89,4 +93,5 @@ xcontext("Create Components", () => {
|
|||
cy.getComponent(componentId).should("not.exist")
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Screen Tests", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Screen Tests", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -18,4 +21,5 @@ context("Screen Tests", () => {
|
|||
cy.contains("/test-with-spaces").should("exist")
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Create a Table", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Create a Table", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -100,4 +103,5 @@ context("Create a Table", () => {
|
|||
cy.contains("Delete Table").click()
|
||||
cy.contains("dog").should("not.exist")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
context("Create a User and Assign Roles", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Create a User and Assign Roles", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
})
|
||||
|
@ -125,4 +129,5 @@ context("Create a User and Assign Roles", () => {
|
|||
})
|
||||
cy.get(".spectrum-Table-body").should("not.have.text", "bbuser")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Create a View", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Create a View", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -141,12 +144,13 @@ context("Create a View", () => {
|
|||
cy.wait(500)
|
||||
cy.contains("TestView Updated").should("not.exist")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
function removeSpacing(headers) {
|
||||
function removeSpacing(headers) {
|
||||
let newHeaders = []
|
||||
for (let header of headers) {
|
||||
newHeaders.push(header.replace(/\s\s+/g, " "))
|
||||
}
|
||||
return newHeaders
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
xcontext("Custom Theming Properties", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
xcontext("Custom Theming Properties", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -80,4 +83,5 @@ xcontext("Custom Theming Properties", () => {
|
|||
.parent().find(".container.svelte-z3cm5a").click()
|
||||
.get('[title="Gray 800"]').children().find('[aria-label="Checkmark"]')
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Datasource Wizard", () => {
|
||||
import filterTests from "../../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
context("Datasource Wizard", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -34,4 +37,5 @@ context("Datasource Wizard", () => {
|
|||
cy.get("@datasourceConnection").its('response.body')
|
||||
.should('have.property', 'status', 500)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("MySQL Datasource Testing", () => {
|
||||
import filterTests from "../../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
context("MySQL Datasource Testing", () => {
|
||||
if (Cypress.env("TEST_ENV")) {
|
||||
|
||||
before(() => {
|
||||
|
@ -184,4 +187,5 @@ context("MySQL Datasource Testing", () => {
|
|||
cy.get(".nav-item").should('not.contain', queryRename)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Oracle Datasource Testing", () => {
|
||||
import filterTests from "../../support/filterTests"
|
||||
|
||||
filterTests(['all', 'smoke'], () => {
|
||||
context("Oracle Datasource Testing", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -188,4 +191,5 @@ context("Oracle Datasource Testing", () => {
|
|||
// Confirm deletion
|
||||
cy.get(".nav-item").should('not.contain', queryName)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("PostgreSQL Datasource Testing", () => {
|
||||
import filterTests from "../../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
context("PostgreSQL Datasource Testing", () => {
|
||||
if (Cypress.env("TEST_ENV")) {
|
||||
|
||||
before(() => {
|
||||
|
@ -234,4 +237,5 @@ context("PostgreSQL Datasource Testing", () => {
|
|||
cy.wait(5000)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("REST Datasource Testing", () => {
|
||||
import filterTests from "../../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("REST Datasource Testing", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -36,4 +39,5 @@ context("REST Datasource Testing", () => {
|
|||
.children()
|
||||
.should('contain', 200)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Query Level Transformers", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Query Level Transformers", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.deleteApp("Cypress Tests")
|
||||
|
@ -109,4 +112,5 @@ context("Query Level Transformers", () => {
|
|||
expect(response.body.message).to.include('Invalid body - "transformer" is not allowed to be empty')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
context("Rename an App", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['all'], () => {
|
||||
context("Rename an App", () => {
|
||||
beforeEach(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
})
|
||||
|
||||
it("should rename an unpublished application", () => {
|
||||
it("should rename an unpublished application", () => {
|
||||
const appName = "Cypress Tests"
|
||||
const appRename = "Cypress Renamed"
|
||||
// Rename app, Search for app, Confirm name was changed
|
||||
|
@ -18,9 +21,9 @@ it("should rename an unpublished application", () => {
|
|||
cy.reload()
|
||||
cy.wait(1000)
|
||||
renameApp(appRename, appName)
|
||||
})
|
||||
})
|
||||
|
||||
xit("Should rename a published application", () => {
|
||||
xit("Should rename a published application", () => {
|
||||
// It is not possible to rename a published application
|
||||
const appName = "Cypress Tests"
|
||||
const appRename = "Cypress Renamed"
|
||||
|
@ -37,9 +40,9 @@ xit("Should rename a published application", () => {
|
|||
renameApp(appName, appRename, true)
|
||||
cy.searchForApplication(appRename)
|
||||
cy.get(".appTable").find(".wrapper").should("have.length", 1)
|
||||
})
|
||||
})
|
||||
|
||||
it("Should try to rename an application to have no name", () => {
|
||||
it("Should try to rename an application to have no name", () => {
|
||||
const appName = "Cypress Tests"
|
||||
cy.get(".home-logo").click()
|
||||
renameApp(appName, " ", false, true)
|
||||
|
@ -50,9 +53,9 @@ it("Should try to rename an application to have no name", () => {
|
|||
cy.wait(1000)
|
||||
cy.searchForApplication(appName)
|
||||
cy.get(".appTable").find(".title").should("have.length", 1)
|
||||
})
|
||||
})
|
||||
|
||||
xit("Should create two applications with the same name", () => {
|
||||
xit("Should create two applications with the same name", () => {
|
||||
// It is not possible to have applications with the same name
|
||||
const appName = "Cypress Tests"
|
||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
||||
|
@ -65,9 +68,9 @@ xit("Should create two applications with the same name", () => {
|
|||
cy.get(".spectrum-ButtonGroup").contains("Create app").click({force: true})
|
||||
cy.get(".error").should("have.text", "Another app with the same name already exists")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
it("should validate application names", () => {
|
||||
it("should validate application names", () => {
|
||||
// App name must be letters, numbers and spaces only
|
||||
// This test checks numbers and special characters specifically
|
||||
const appName = "Cypress Tests"
|
||||
|
@ -87,7 +90,7 @@ it("should validate application names", () => {
|
|||
cy.reload()
|
||||
cy.wait(1000)
|
||||
renameApp(numberName, appName)
|
||||
})
|
||||
})
|
||||
|
||||
const renameApp = (originalName, changedName, published, noName) => {
|
||||
cy.searchForApplication(originalName)
|
||||
|
@ -123,5 +126,6 @@ it("should validate application names", () => {
|
|||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
context("Revert apps", () => {
|
||||
import filterTests from "../support/filterTests"
|
||||
|
||||
filterTests(['smoke', 'all'], () => {
|
||||
context("Revert apps", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
|
@ -59,4 +62,5 @@ context("Revert apps", () => {
|
|||
cy.get(".spectrum-Button").eq(1).should('be.disabled')
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
const filterTests = (testTags, runTest) => {
|
||||
// testTags is an array of tags
|
||||
// runTest is all tests
|
||||
if (Cypress.env('TEST_TAGS')) {
|
||||
const tags = Cypress.env('TEST_TAGS').split('/');
|
||||
const found = testTags.some(($testTags) => tags.includes($testTags));
|
||||
|
||||
if (found) {
|
||||
runTest();
|
||||
}
|
||||
} else {
|
||||
runTest();
|
||||
}
|
||||
};
|
||||
|
||||
export default filterTests;
|
Loading…
Reference in New Issue