Fixing the creation of user in cypress.

This commit is contained in:
mike12345567 2021-05-25 11:06:50 +01:00
parent b923b63a44
commit 921eb39227
3 changed files with 25 additions and 20 deletions

View File

@ -12,22 +12,19 @@ Cypress.Commands.add("login", () => {
cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.visit(`localhost:${Cypress.env("PORT")}/builder`)
// cy.get("button").then(btn => { cy.url().then(url => {
// const adminUserButton = "Create super admin user" if (url.includes("builder/admin")) {
// console.log(btn.first().first()) // create admin user
// if (!btn.first().contains(adminUserButton)) { cy.get("input").first().type("test@test.com")
// // create admin user cy.get('input[type="password"]').first().type("test")
// cy.get("input").first().type("test@test.com") cy.get('input[type="password"]').eq(1).type("test")
// cy.get('input[type="password"]').first().type("test") cy.contains("Create super admin user").click()
// cy.get('input[type="password"]').eq(1).type("test") }
// cy.contains(adminUserButton).click()
// }
// login // login
cy.get("input").first().type("test@test.com") cy.get("input").first().type("test@test.com")
cy.get('input[type="password"]').type("test") cy.get('input[type="password"]').type("test")
cy.contains("Login").click() cy.get("button").first().click()
// }) })
}) })
}) })

View File

@ -12,9 +12,13 @@ exports.init = async () => {
} }
exports.shutdown = async () => { exports.shutdown = async () => {
if (devAppClient != null) {
await devAppClient.finish() await devAppClient.finish()
}
if (debounceClient != null) {
await debounceClient.finish() await debounceClient.finish()
} }
}
exports.doesUserHaveLock = async (devAppId, user) => { exports.doesUserHaveLock = async (devAppId, user) => {
const value = await devAppClient.get(devAppId) const value = await devAppClient.get(devAppId)

View File

@ -51,9 +51,13 @@ exports.init = async () => {
* make sure redis connection is closed. * make sure redis connection is closed.
*/ */
exports.shutdown = async () => { exports.shutdown = async () => {
if (pwResetClient != null) {
await pwResetClient.finish() await pwResetClient.finish()
}
if (invitationClient != null) {
await invitationClient.finish() await invitationClient.finish()
} }
}
/** /**
* Given a user ID this will store a code (that is returned) for an hour in redis. * Given a user ID this will store a code (that is returned) for an hour in redis.