Browse Source

Fixing the creation of user in cypress.

master
mike12345567 5 years ago
parent
commit
921eb39227
  1. 29
      packages/builder/cypress/support/commands.js
  2. 8
      packages/server/src/utilities/redis.js
  3. 8
      packages/worker/src/utilities/redis.js

29
packages/builder/cypress/support/commands.js

@ -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
// } cy.get("input").first().type("test@test.com")
cy.get('input[type="password"]').type("test")
// login cy.get("button").first().click()
cy.get("input").first().type("test@test.com") })
cy.get('input[type="password"]').type("test")
cy.contains("Login").click()
// })
}) })
}) })

8
packages/server/src/utilities/redis.js

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

8
packages/worker/src/utilities/redis.js

@ -51,8 +51,12 @@ exports.init = async () => {
* make sure redis connection is closed. * make sure redis connection is closed.
*/ */
exports.shutdown = async () => { exports.shutdown = async () => {
await pwResetClient.finish() if (pwResetClient != null) {
await invitationClient.finish() await pwResetClient.finish()
}
if (invitationClient != null) {
await invitationClient.finish()
}
} }
/** /**

Loading…
Cancel
Save