From a72d772f44c79f6314eb1a172dede6cf24450317 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 27 Nov 2020 13:17:31 +0000 Subject: [PATCH] fix user test --- .../cypress/integration/createUser.spec.js | 4 +-- packages/builder/cypress/support/commands.js | 31 ++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packages/builder/cypress/integration/createUser.spec.js b/packages/builder/cypress/integration/createUser.spec.js index ca2fa225da..cbde6179b2 100644 --- a/packages/builder/cypress/integration/createUser.spec.js +++ b/packages/builder/cypress/integration/createUser.spec.js @@ -9,9 +9,9 @@ context('Create a User', () => { // https://on.cypress.io/interacting-with-elements it('should create a user', () => { - cy.addRow(["Users", "bbuser", "test", "POWER_USER"]) + cy.createUser("bbuser", "test", "ADMIN") // // Check to make sure user was created! - // cy.get("input[disabled]").should('have.value', 'bbuser') + cy.contains("bbuser").should('be.visible') }) }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 15564083ba..76f3417eac 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -113,23 +113,26 @@ Cypress.Commands.add("addRow", values => { Cypress.Commands.add("createUser", (username, password, accessLevel) => { // Create User - cy.get(".toprightnav > .settings").click() cy.contains("Users").click() - cy.get("[name=Name]") - .first() - .type(username) - cy.get("[name=Password]") - .first() - .type(password) - cy.get("select") - .first() - .select(accessLevel) + cy.contains("Create New Row").click() - // Save - cy.get(".inputs") - .contains("Create") - .click() + cy.get(".modal").within(() => { + cy.get("input") + .first() + .type(password) + cy.get("input") + .eq(1) + .type(username) + cy.get("select") + .first() + .select(accessLevel) + + // Save + cy.get(".buttons") + .contains("Create Row") + .click() + }) }) Cypress.Commands.add("addHeadlineComponent", text => {