Changing how connection is waited for.
This commit is contained in:
parent
3a9a32f5f6
commit
85102fab4e
|
@ -68,9 +68,13 @@ function waitForConnection() {
|
||||||
resolve()
|
resolve()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
CLIENT.on("connect", () => {
|
// check if the connection is ready
|
||||||
resolve()
|
const interval = setInterval(() => {
|
||||||
})
|
if (CONNECTED) {
|
||||||
|
clearInterval(interval)
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
}, 500)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,23 @@ Cypress.Commands.add("login", () => {
|
||||||
if (cookie) return
|
if (cookie) return
|
||||||
|
|
||||||
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
|
||||||
cy.contains("Create Test User").click()
|
|
||||||
cy.get("input").first().type("test@test.com")
|
|
||||||
|
|
||||||
cy.get('input[type="password"]').type("test")
|
cy.get("button").then(btn => {
|
||||||
|
const adminUserButton = "Create super admin user"
|
||||||
|
console.log(btn.first().first())
|
||||||
|
if (!btn.first().contains(adminUserButton)) {
|
||||||
|
// create admin user
|
||||||
|
cy.get("input").first().type("test@test.com")
|
||||||
|
cy.get('input[type="password"]').first().type("test")
|
||||||
|
cy.get('input[type="password"]').eq(1).type("test")
|
||||||
|
cy.contains(adminUserButton).click()
|
||||||
|
}
|
||||||
|
|
||||||
cy.contains("Login").click()
|
// login
|
||||||
|
cy.get("input").first().type("test@test.com")
|
||||||
|
cy.get('input[type="password"]').type("test")
|
||||||
|
cy.contains("Login").click()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue