1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00
budibase/packages/builder/cypress/integration/createScreen.spec.js

55 lines
1.7 KiB
JavaScript
Raw Normal View History

import filterTests from "../support/filterTests"
const interact = require('../support/interact')
2022-01-22 02:12:16 +13:00
filterTests(["smoke", "all"], () => {
context("Screen Tests", () => {
before(() => {
cy.login()
cy.createTestApp()
cy.navigateToFrontend()
})
it("Should successfully create a screen", () => {
2022-05-11 09:40:27 +12:00
cy.createScreen("test")
cy.get(interact.BODY).within(() => {
cy.contains("/test").should("exist")
})
})
it("Should update the url", () => {
cy.createScreen("test with spaces")
cy.get(interact.BODY).within(() => {
cy.contains("/test-with-spaces").should("exist")
})
})
2022-04-07 23:22:16 +12:00
it("should delete all screens then create first screen via button", () => {
cy.deleteAllScreens()
cy.contains("Create first screen").click()
cy.get(interact.BODY, { timeout: 2000 }).should('contain', '/home')
})
2022-04-08 20:56:20 +12:00
it("Should create and filter screens by access level", () => {
const accessLevels = ["Basic", "Admin", "Public", "Power"]
2022-04-08 20:56:20 +12:00
for (const access of accessLevels){
// 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 20:56:20 +12:00
// Filter by All screens - Confirm all screens visible
cy.filterScreensAccessLevel("All screens")
cy.get(interact.BODY).should('contain', accessLevels[0])
.and('contain', accessLevels[1])
.and('contain', accessLevels[2])
.and('contain', accessLevels[3])
2022-04-07 23:22:16 +12:00
})
2022-01-22 02:12:16 +13:00
})
})