AdminAndManagement test changes + Commands update
Specifically changes for accountPortals & userManagement Commands - Delete user function added - Few timing changes
This commit is contained in:
parent
b5ab5014e2
commit
66c3991b55
|
@ -113,7 +113,7 @@ filterTests(["smoke", "all"], () => {
|
||||||
cy.get(".app").should('not.exist') // No apps -> no roles assigned to user
|
cy.get(".app").should('not.exist') // No apps -> no roles assigned to user
|
||||||
cy.get(interact.CONTAINER).should('contain', bbUserEmail) // Message containing users email
|
cy.get(interact.CONTAINER).should('contain', bbUserEmail) // Message containing users email
|
||||||
|
|
||||||
cy.logOut()
|
cy.logoutNoAppGrid()
|
||||||
})
|
})
|
||||||
|
|
||||||
const bbUserLogin = () => {
|
const bbUserLogin = () => {
|
||||||
|
@ -121,5 +121,11 @@ filterTests(["smoke", "all"], () => {
|
||||||
cy.logOut()
|
cy.logOut()
|
||||||
cy.login(bbUserEmail, "test")
|
cy.login(bbUserEmail, "test")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
after(() => {
|
||||||
|
cy.login()
|
||||||
|
// Delete BB user
|
||||||
|
cy.deleteUser(bbUserEmail)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -220,22 +220,7 @@ filterTests(["smoke", "all"], () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should delete a user", () => {
|
it("should delete a user", () => {
|
||||||
// Navigate to test user
|
cy.deleteUser("bbuser@test.com")
|
||||||
cy.contains("Users").click()
|
|
||||||
cy.contains("bbuser").click()
|
|
||||||
|
|
||||||
// Click Delete user button
|
|
||||||
cy.get(interact.SPECTRUM_BUTTON)
|
|
||||||
.contains("Delete user")
|
|
||||||
.click({ force: true })
|
|
||||||
.then(() => {
|
|
||||||
// Confirm deletion within modal
|
|
||||||
cy.get(interact.SPECTRUM_DIALOG_GRID, { timeout: 500 }).within(() => {
|
|
||||||
cy.get(interact.SPECTRUM_BUTTON)
|
|
||||||
.contains("Delete user")
|
|
||||||
.click({ force: true })
|
|
||||||
})
|
|
||||||
})
|
|
||||||
cy.get(interact.SPECTRUM_TABLE, { timeout: 4000 }).should("not.have.text", "bbuser")
|
cy.get(interact.SPECTRUM_TABLE, { timeout: 4000 }).should("not.have.text", "bbuser")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -32,7 +32,7 @@ Cypress.Commands.add("login", (email, password) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("logOut", () => {
|
Cypress.Commands.add("logOut", () => {
|
||||||
cy.visit(`${Cypress.config().baseUrl}/builder`)
|
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 })
|
||||||
cy.get(".user-dropdown .avatar > .icon").click({ force: true })
|
cy.get(".user-dropdown .avatar > .icon").click({ force: true })
|
||||||
cy.get(".spectrum-Popover[data-cy='user-menu']").within(() => {
|
cy.get(".spectrum-Popover[data-cy='user-menu']").within(() => {
|
||||||
cy.get("li[data-cy='user-logout']").click({ force: true })
|
cy.get("li[data-cy='user-logout']").click({ force: true })
|
||||||
|
@ -54,17 +54,39 @@ Cypress.Commands.add("createUser", email => {
|
||||||
// quick hacky recorded way to create a user
|
// quick hacky recorded way to create a user
|
||||||
cy.contains("Users").click()
|
cy.contains("Users").click()
|
||||||
cy.get(`[data-cy="add-user"]`).click()
|
cy.get(`[data-cy="add-user"]`).click()
|
||||||
|
cy.get(".spectrum-Dialog-grid").within(() => {
|
||||||
cy.get(".spectrum-Picker-label").click()
|
cy.get(".spectrum-Picker-label").click()
|
||||||
cy.get(".spectrum-Menu-item:nth-child(2) > .spectrum-Menu-itemLabel").click()
|
cy.get(
|
||||||
|
".spectrum-Menu-item:nth-child(2) > .spectrum-Menu-itemLabel"
|
||||||
|
).click()
|
||||||
|
|
||||||
// Onboarding type selector
|
// Onboarding type selector
|
||||||
cy.get(
|
cy.get(".spectrum-Textfield-input")
|
||||||
":nth-child(2) > .spectrum-Form-itemField > .spectrum-Textfield > .spectrum-Textfield-input"
|
.eq(0)
|
||||||
)
|
|
||||||
.first()
|
.first()
|
||||||
.type(email, { force: true })
|
.type(email, { force: true })
|
||||||
cy.get(".spectrum-Button--cta").click({ force: true })
|
cy.get(".spectrum-Button--cta").click({ force: true })
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
Cypress.Commands.add("deleteUser", email => {
|
||||||
|
// Assumes user has access to Users section
|
||||||
|
cy.contains("Users", { timeout: 2000 }).click()
|
||||||
|
cy.contains(email).click()
|
||||||
|
|
||||||
|
// Click Delete user button
|
||||||
|
cy.get(".spectrum-Button")
|
||||||
|
.contains("Delete user")
|
||||||
|
.click({ force: true })
|
||||||
|
.then(() => {
|
||||||
|
// Confirm deletion within modal
|
||||||
|
cy.get(".spectrum-Dialog-grid", { timeout: 500 }).within(() => {
|
||||||
|
cy.get(".spectrum-Button")
|
||||||
|
.contains("Delete user")
|
||||||
|
.click({ force: true })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
|
Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
|
||||||
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({
|
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({
|
||||||
|
@ -377,7 +399,8 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => {
|
||||||
cy.navigateToDataSection()
|
cy.navigateToDataSection()
|
||||||
cy.get(`[data-cy="new-table"]`).click()
|
cy.get(`[data-cy="new-table"]`).click()
|
||||||
}
|
}
|
||||||
cy.get(".spectrum-Dialog-grid", { timeout: 5000 })
|
cy.wait(500)
|
||||||
|
cy.get(".spectrum-Dialog-grid")
|
||||||
.contains("Budibase DB")
|
.contains("Budibase DB")
|
||||||
.click({ force: true })
|
.click({ force: true })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|
Loading…
Reference in New Issue