login step configured correctly
This commit is contained in:
parent
015bb72daf
commit
4c20427c33
|
@ -1,5 +1,6 @@
|
|||
context("Create an Application", () => {
|
||||
it("should create a new application", () => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
||||
cy.contains("Cypress Tests").should("exist")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
context("Create a automation", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
})
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
context("Create Bindings", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
cy.navigateToFrontend()
|
||||
})
|
||||
|
|
|
@ -2,6 +2,7 @@ context("Create Components", () => {
|
|||
let headlineId
|
||||
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
cy.createTable("dog")
|
||||
cy.addColumn("dog", "name", "string")
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
context("Screen Tests", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
cy.navigateToFrontend()
|
||||
})
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
context("Create a Table", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
})
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
context("Create a User", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
})
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
context("Create a View", () => {
|
||||
before(() => {
|
||||
cy.login()
|
||||
cy.createTestApp()
|
||||
cy.createTable("data")
|
||||
cy.addColumn("data", "group", "Text")
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
||||
|
||||
Cypress.Commands.add("login", () => {
|
||||
if (cy.getCookie("budibase:auth")) return
|
||||
cy.getCookie("budibase:auth").then(cookie => {
|
||||
// Already logged in
|
||||
if (cookie) return
|
||||
|
||||
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
||||
cy.contains("Create Test User").click()
|
||||
|
@ -36,11 +38,11 @@ Cypress.Commands.add("login", () => {
|
|||
cy.get('input[type="password"]').type("test")
|
||||
|
||||
cy.contains("Login").click()
|
||||
cy.wait(1000)
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
Cypress.Commands.add("createApp", name => {
|
||||
cy.login()
|
||||
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
||||
// wait for init API calls on visit
|
||||
cy.wait(100)
|
||||
|
|
Loading…
Reference in New Issue