1
0
Fork 0
mirror of synced 2024-07-01 12:30:41 +12:00
budibase/packages/builder/cypress/integration/createScreen.spec.js
Mitch-Budibase 7495b859c8 Cypress Tests Refactoring
Refactoring a large portion of tests - necessary updates to have them working (may still be timing issues on the smoke build)
2022-06-29 18:28:32 +01:00

42 lines
1.2 KiB
JavaScript

import filterTests from "../support/filterTests"
filterTests(["smoke", "all"], () => {
context("Screen Tests", () => {
before(() => {
cy.login()
cy.createTestApp()
cy.navigateToFrontend()
})
it("Should successfully create a screen", () => {
cy.createScreen("test")
cy.get(".nav-items-container").within(() => {
cy.contains("/test").should("exist")
})
})
it("Should update the url", () => {
cy.createScreen("test with spaces")
cy.get(".nav-items-container").within(() => {
cy.contains("/test-with-spaces").should("exist")
})
})
it("Should create a blank screen with the selected access level", () => {
cy.createScreen("admin only", "Admin")
cy.get(".nav-items-container").within(() => {
cy.contains("/admin-only").should("exist")
})
cy.createScreen("open to all", "Public")
cy.get(".nav-items-container").within(() => {
cy.contains("/open-to-all").should("exist")
//The access level should now be set to admin. Previous screens should be filtered.
cy.get(".nav-item").contains("/test-screen").should("not.exist")
})
})
})
})