fix user test
This commit is contained in:
parent
ffd586780c
commit
a72d772f44
|
@ -9,9 +9,9 @@ context('Create a User', () => {
|
||||||
|
|
||||||
// https://on.cypress.io/interacting-with-elements
|
// https://on.cypress.io/interacting-with-elements
|
||||||
it('should create a user', () => {
|
it('should create a user', () => {
|
||||||
cy.addRow(["Users", "bbuser", "test", "POWER_USER"])
|
cy.createUser("bbuser", "test", "ADMIN")
|
||||||
|
|
||||||
// // Check to make sure user was created!
|
// // Check to make sure user was created!
|
||||||
// cy.get("input[disabled]").should('have.value', 'bbuser')
|
cy.contains("bbuser").should('be.visible')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -113,24 +113,27 @@ Cypress.Commands.add("addRow", values => {
|
||||||
|
|
||||||
Cypress.Commands.add("createUser", (username, password, accessLevel) => {
|
Cypress.Commands.add("createUser", (username, password, accessLevel) => {
|
||||||
// Create User
|
// Create User
|
||||||
cy.get(".toprightnav > .settings").click()
|
|
||||||
cy.contains("Users").click()
|
cy.contains("Users").click()
|
||||||
|
|
||||||
cy.get("[name=Name]")
|
cy.contains("Create New Row").click()
|
||||||
.first()
|
|
||||||
.type(username)
|
cy.get(".modal").within(() => {
|
||||||
cy.get("[name=Password]")
|
cy.get("input")
|
||||||
.first()
|
.first()
|
||||||
.type(password)
|
.type(password)
|
||||||
|
cy.get("input")
|
||||||
|
.eq(1)
|
||||||
|
.type(username)
|
||||||
cy.get("select")
|
cy.get("select")
|
||||||
.first()
|
.first()
|
||||||
.select(accessLevel)
|
.select(accessLevel)
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
cy.get(".inputs")
|
cy.get(".buttons")
|
||||||
.contains("Create")
|
.contains("Create Row")
|
||||||
.click()
|
.click()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("addHeadlineComponent", text => {
|
Cypress.Commands.add("addHeadlineComponent", text => {
|
||||||
cy.get(".switcher > :nth-child(2)").click()
|
cy.get(".switcher > :nth-child(2)").click()
|
||||||
|
|
Loading…
Reference in New Issue