Adding tags to tests

Currently there is 'smoke' and 'all' tags
This commit is contained in:
Mitch-Budibase 2022-01-21 12:43:27 +00:00
parent 9034f23fde
commit 8b8cb21ec3
22 changed files with 1770 additions and 1669 deletions

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['all'], () => {
context("Add Multi-Option Datatype", () => { context("Add Multi-Option Datatype", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -39,4 +42,4 @@ context("Add Multi-Option Datatype", () => {
}) })
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['all'], () => {
context("Add Radio Buttons", () => { context("Add Radio Buttons", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -33,3 +36,4 @@ it("should add Radio Buttons options picker on form, add data, and confirm", ()
cy.addCustomSourceOptions(totalRadioButtons) cy.addCustomSourceOptions(totalRadioButtons)
} }
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Auto Screens UI", () => { context("Auto Screens UI", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -45,3 +48,4 @@ context("Auto Screens UI", () => {
}) })
} }
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['all'], () => {
context("Change Application Icon and Colour", () => { context("Change Application Icon and Colour", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -37,3 +40,4 @@ context("Change Application Icon and Colour", () => {
}) })
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from '../support/filterTests'
filterTests(['smoke', 'all'], () => {
context("Create an Application", () => { context("Create an Application", () => {
it("should create a new application", () => { it("should create a new application", () => {
cy.login() cy.login()
@ -6,3 +9,4 @@ context("Create an Application", () => {
cy.contains("Cypress Tests").should("exist") cy.contains("Cypress Tests").should("exist")
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Create a automation", () => { context("Create a automation", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -63,3 +66,4 @@ context("Create a automation", () => {
cy.contains("automationGoodboy") cy.contains("automationGoodboy")
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Create Bindings", () => { context("Create Bindings", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -56,3 +59,4 @@ const addSettingBinding = (setting, bindingText, clickOption = true) => {
cy.contains("Save").click() cy.contains("Save").click()
}) })
} }
})

View File

@ -1,4 +1,8 @@
// TODO for now components are skipped, might not be good to keep doing this // TODO for now components are skipped, might not be good to keep doing this
import filterTests from "../support/filterTests"
filterTests(['all'], () => {
xcontext("Create Components", () => { xcontext("Create Components", () => {
let headlineId let headlineId
@ -90,3 +94,4 @@ xcontext("Create Components", () => {
}) })
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Screen Tests", () => { context("Screen Tests", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -19,3 +22,4 @@ context("Screen Tests", () => {
}) })
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Create a Table", () => { context("Create a Table", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -101,3 +104,4 @@ context("Create a Table", () => {
cy.contains("dog").should("not.exist") cy.contains("dog").should("not.exist")
}) })
}) })
})

View File

@ -1,3 +1,7 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Create a User and Assign Roles", () => { context("Create a User and Assign Roles", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -126,3 +130,4 @@ context("Create a User and Assign Roles", () => {
cy.get(".spectrum-Table-body").should("not.have.text", "bbuser") cy.get(".spectrum-Table-body").should("not.have.text", "bbuser")
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Create a View", () => { context("Create a View", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -150,3 +153,4 @@ function removeSpacing(headers) {
} }
return newHeaders return newHeaders
} }
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['all'], () => {
xcontext("Custom Theming Properties", () => { xcontext("Custom Theming Properties", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -81,3 +84,4 @@ xcontext("Custom Theming Properties", () => {
.get('[title="Gray 800"]').children().find('[aria-label="Checkmark"]') .get('[title="Gray 800"]').children().find('[aria-label="Checkmark"]')
} }
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../../support/filterTests"
filterTests(['all'], () => {
context("Datasource Wizard", () => { context("Datasource Wizard", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -35,3 +38,4 @@ context("Datasource Wizard", () => {
.should('have.property', 'status', 500) .should('have.property', 'status', 500)
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../../support/filterTests"
filterTests(['all'], () => {
context("MySQL Datasource Testing", () => { context("MySQL Datasource Testing", () => {
if (Cypress.env("TEST_ENV")) { if (Cypress.env("TEST_ENV")) {
@ -185,3 +188,4 @@ context("MySQL Datasource Testing", () => {
}) })
} }
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../../support/filterTests"
filterTests(['all', 'smoke'], () => {
context("Oracle Datasource Testing", () => { context("Oracle Datasource Testing", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -189,3 +192,4 @@ context("Oracle Datasource Testing", () => {
cy.get(".nav-item").should('not.contain', queryName) cy.get(".nav-item").should('not.contain', queryName)
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../../support/filterTests"
filterTests(['all'], () => {
context("PostgreSQL Datasource Testing", () => { context("PostgreSQL Datasource Testing", () => {
if (Cypress.env("TEST_ENV")) { if (Cypress.env("TEST_ENV")) {
@ -235,3 +238,4 @@ context("PostgreSQL Datasource Testing", () => {
} }
} }
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("REST Datasource Testing", () => { context("REST Datasource Testing", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -37,3 +40,4 @@ context("REST Datasource Testing", () => {
.should('contain', 200) .should('contain', 200)
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Query Level Transformers", () => { context("Query Level Transformers", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -110,3 +113,4 @@ context("Query Level Transformers", () => {
}) })
}) })
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['all'], () => {
context("Rename an App", () => { context("Rename an App", () => {
beforeEach(() => { beforeEach(() => {
cy.login() cy.login()
@ -125,3 +128,4 @@ it("should validate application names", () => {
}) })
} }
}) })
})

View File

@ -1,3 +1,6 @@
import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => {
context("Revert apps", () => { context("Revert apps", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -60,3 +63,4 @@ context("Revert apps", () => {
}) })
}) })
}) })
})

View File

@ -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;