1
0
Fork 0
mirror of synced 2024-06-23 08:30:31 +12:00

fix user test

This commit is contained in:
Martin McKeaveney 2020-11-27 13:17:31 +00:00
parent 792eac2ca5
commit 1014437d42
2 changed files with 19 additions and 16 deletions

View file

@ -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')
})
})

View file

@ -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 => {