2022-01-21 13:43:27 +01:00
|
|
|
import filterTests from "../support/filterTests"
|
2022-07-20 20:21:30 +02:00
|
|
|
const interact = require('../support/interact')
|
2021-03-05 15:36:38 +01:00
|
|
|
|
2022-01-21 14:12:16 +01:00
|
|
|
filterTests(["smoke", "all"], () => {
|
2023-01-16 12:17:11 +01:00
|
|
|
xcontext("Screen Tests", () => {
|
2022-01-21 13:43:27 +01:00
|
|
|
before(() => {
|
|
|
|
cy.login()
|
|
|
|
cy.createTestApp()
|
|
|
|
cy.navigateToFrontend()
|
2021-07-28 09:09:37 +02:00
|
|
|
})
|
|
|
|
|
2022-11-15 18:59:31 +01:00
|
|
|
it.skip("Should successfully create a screen", () => {
|
2022-05-10 23:40:27 +02:00
|
|
|
cy.createScreen("test")
|
2022-07-20 20:21:30 +02:00
|
|
|
cy.get(interact.BODY).within(() => {
|
2022-01-21 13:43:27 +01:00
|
|
|
cy.contains("/test").should("exist")
|
|
|
|
})
|
2021-07-28 09:09:37 +02:00
|
|
|
})
|
2022-01-21 13:43:27 +01:00
|
|
|
|
|
|
|
it("Should update the url", () => {
|
2022-04-22 15:57:13 +02:00
|
|
|
cy.createScreen("test with spaces")
|
2022-07-20 20:21:30 +02:00
|
|
|
cy.get(interact.BODY).within(() => {
|
2022-01-21 13:43:27 +01:00
|
|
|
cy.contains("/test-with-spaces").should("exist")
|
|
|
|
})
|
|
|
|
})
|
2022-04-07 13:22:16 +02:00
|
|
|
|
2022-11-15 18:59:31 +01:00
|
|
|
it.skip("should delete all screens then create first screen via button", () => {
|
2022-07-20 20:21:30 +02:00
|
|
|
cy.deleteAllScreens()
|
2023-01-16 12:17:11 +01:00
|
|
|
|
2022-07-20 20:21:30 +02:00
|
|
|
cy.contains("Create first screen").click()
|
|
|
|
cy.get(interact.BODY, { timeout: 2000 }).should('contain', '/home')
|
|
|
|
})
|
2022-04-08 10:56:20 +02:00
|
|
|
|
2022-07-20 20:21:30 +02:00
|
|
|
it("Should create and filter screens by access level", () => {
|
|
|
|
const accessLevels = ["Basic", "Admin", "Public", "Power"]
|
2022-04-08 10:56:20 +02:00
|
|
|
|
2023-01-16 12:17:11 +01:00
|
|
|
for (const access of accessLevels) {
|
2022-07-20 20:21:30 +02:00
|
|
|
// Create screen with specified access level
|
|
|
|
cy.createScreen(access, access)
|
|
|
|
// Filter by access level and confirm screen visible
|
|
|
|
cy.filterScreensAccessLevel(access)
|
|
|
|
cy.get(interact.BODY).within(() => {
|
|
|
|
cy.get(interact.NAV_ITEM).should('contain', access.toLowerCase())
|
|
|
|
})
|
|
|
|
}
|
2022-04-08 10:56:20 +02:00
|
|
|
|
2022-07-20 20:21:30 +02:00
|
|
|
// Filter by All screens - Confirm all screens visible
|
|
|
|
cy.filterScreensAccessLevel("All screens")
|
|
|
|
cy.get(interact.BODY).should('contain', accessLevels[0])
|
2023-01-16 12:17:11 +01:00
|
|
|
.and('contain', accessLevels[1])
|
|
|
|
.and('contain', accessLevels[2])
|
|
|
|
.and('contain', accessLevels[3])
|
2022-04-07 13:22:16 +02:00
|
|
|
})
|
2022-01-21 14:12:16 +01:00
|
|
|
})
|
2021-03-05 15:36:38 +01:00
|
|
|
})
|