1
0
Fork 0
mirror of synced 2024-06-28 11:00:55 +12:00

Smoke build test changes - adminAndManagement

Some test changes for test files within the adminAndManagement folder

- Changes related to UI
- Restructured accountPortals tests
- Changes related to changing passwords (flow is different now)
This commit is contained in:
Mitch-Budibase 2022-08-11 12:28:20 +01:00
parent eb0086e532
commit f70a04090b
4 changed files with 30 additions and 29 deletions

View file

@ -23,7 +23,7 @@ filterTests(["smoke", "all"], () => {
cy.get(interact.SPECTRUM_ICON).click({ force: true }) cy.get(interact.SPECTRUM_ICON).click({ force: true })
}) })
cy.get(interact.SPECTRUM_MENU).within(() => { cy.get(interact.SPECTRUM_MENU).within(() => {
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Force Password Reset").click({ force: true }) cy.get(interact.SPECTRUM_MENU_ITEM).contains("Force password reset").click({ force: true })
}) })
cy.get(interact.SPECTRUM_DIALOG_GRID) cy.get(interact.SPECTRUM_DIALOG_GRID)
@ -41,10 +41,25 @@ filterTests(["smoke", "all"], () => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).eq(i).type("test") cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).eq(i).type("test")
} }
cy.get(interact.SPECTRUM_BUTTON).contains("Reset your password").click({ force: true }) cy.get(interact.SPECTRUM_BUTTON).contains("Reset your password").click({ force: true })
//cy.logoutNoAppGrid()
})
it("should verify Standard Portal", () => {
// Development access should be disabled (Admin access is already disabled)
cy.login()
cy.setUserRole("bbuser", "App User")
bbUserLogin()
// Verify Standard Portal
cy.get(interact.SPECTRUM_SIDENAV).should('not.exist') // No config sections
cy.get(interact.CREATE_APP_BUTTON).should('not.exist') // No create app button
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.logoutNoAppGrid() cy.logoutNoAppGrid()
}) })
xit("should verify Admin Portal", () => { it("should verify Admin Portal", () => {
cy.login() cy.login()
// Configure user role // Configure user role
cy.setUserRole("bbuser", "Admin") cy.setUserRole("bbuser", "Admin")
@ -86,21 +101,6 @@ filterTests(["smoke", "all"], () => {
cy.logOut() cy.logOut()
}) })
it("should verify Standard Portal", () => {
// Development access should be disabled (Admin access is already disabled)
cy.login()
cy.setUserRole("bbuser", "App User")
bbUserLogin()
// Verify Standard Portal
cy.get(interact.SPECTRUM_SIDENAV).should('not.exist') // No config sections
cy.get(interact.CREATE_APP_BUTTON).should('not.exist') // No create app button
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.logoutNoAppGrid()
})
const bbUserLogin = () => { const bbUserLogin = () => {
// Login as bbuser // Login as bbuser
cy.logOut() cy.logOut()

View file

@ -17,7 +17,7 @@ filterTests(["smoke", "all"], () => {
it("should confirm App User role for a New User", () => { it("should confirm App User role for a New User", () => {
cy.contains("bbuser").click() cy.contains("bbuser").click()
cy.get(".spectrum-Form-itemField").eq(2).should('contain', 'App User') cy.get(".spectrum-Form-itemField").eq(3).should('contain', 'App User')
// User should not have app access // User should not have app access
cy.get(interact.LIST_ITEMS, { timeout: 500 }).should("contain", "No apps") cy.get(interact.LIST_ITEMS, { timeout: 500 }).should("contain", "No apps")
@ -166,12 +166,12 @@ filterTests(["smoke", "all"], () => {
it("Should edit user details within user details page", () => { it("Should edit user details within user details page", () => {
// Add First name // Add First name
cy.get(interact.FIELD, { timeout: 1000 }).eq(0).within(() => { cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => {
cy.wait(500) cy.wait(500)
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).wait(500).clear().click().type("bb") cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).wait(500).clear().click().type("bb")
}) })
// Add Last name // Add Last name
cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => { cy.get(interact.FIELD, { timeout: 1000 }).eq(2).within(() => {
cy.wait(500) cy.wait(500)
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).click().wait(500).clear().type("test") cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).click().wait(500).clear().type("test")
}) })
@ -180,10 +180,10 @@ filterTests(["smoke", "all"], () => {
cy.reload() cy.reload()
// Confirm details have been saved // Confirm details have been saved
cy.get(interact.FIELD, { timeout: 1000 }).eq(0).within(() => { cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', "bb") cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', "bb")
}) })
cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => { cy.get(interact.FIELD, { timeout: 1000 }).eq(2).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).should('have.value', "test") cy.get(interact.SPECTRUM_TEXTFIELD_INPUT, { timeout: 1000 }).should('have.value', "test")
}) })
}) })
@ -193,13 +193,14 @@ filterTests(["smoke", "all"], () => {
cy.get(interact.SPECTRUM_ICON).click({ force: true }) cy.get(interact.SPECTRUM_ICON).click({ force: true })
}) })
cy.get(interact.SPECTRUM_MENU).within(() => { cy.get(interact.SPECTRUM_MENU).within(() => {
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Force Password Reset").click({ force: true }) cy.get(interact.SPECTRUM_MENU_ITEM).contains("Force password reset").click({ force: true })
}) })
// Reset password modal // Reset password modal
cy.get(interact.SPECTRUM_DIALOG_GRID) cy.get(interact.SPECTRUM_DIALOG_GRID)
.find(interact.SPECTRUM_TEXTFIELD_INPUT).invoke('val').as('pwd') .find(interact.SPECTRUM_TEXTFIELD_INPUT).invoke('val').as('pwd')
cy.get(interact.SPECTRUM_BUTTON).contains("Reset password").click({ force: true }) cy.get(interact.SPECTRUM_BUTTON).contains("Reset password").click({ force: true })
cy.get(interact.SPECTRUM_BUTTON).contains("Reset password").should('not.exist')
// Logout, then login with new password // Logout, then login with new password
cy.logOut() cy.logOut()
@ -214,6 +215,7 @@ filterTests(["smoke", "all"], () => {
cy.get(interact.SPECTRUM_BUTTON).contains("Reset your password").click({ force: true }) cy.get(interact.SPECTRUM_BUTTON).contains("Reset your password").click({ force: true })
// Confirm user logged in afer password change // Confirm user logged in afer password change
cy.login("bbuser@test.com", "test")
cy.get(".avatar > .icon").click({ force: true }) cy.get(".avatar > .icon").click({ force: true })
cy.get(".spectrum-Menu-item").contains("Update user information").click({ force: true }) cy.get(".spectrum-Menu-item").contains("Update user information").click({ force: true })

View file

@ -19,10 +19,10 @@ filterTests(["smoke", "all"], () => {
cy.contains("Users").click() cy.contains("Users").click()
cy.contains("test@test.com").click() cy.contains("test@test.com").click()
cy.get(interact.FIELD, { timeout: 1000 }).eq(0).within(() => { cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', fname) cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', fname)
}) })
cy.get(interact.FIELD).eq(1).within(() => { cy.get(interact.FIELD).eq(2).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', lname) cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', lname)
}) })
}) })
@ -72,7 +72,7 @@ filterTests(["smoke", "all"], () => {
}) })
// Logout & in with new password // Logout & in with new password
cy.logOut() //cy.logOut()
cy.login("test@test.com", "newpwd") cy.login("test@test.com", "newpwd")
}) })
@ -90,7 +90,6 @@ filterTests(["smoke", "all"], () => {
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Open developer mode").click({ force: true }) cy.get(interact.SPECTRUM_MENU_ITEM).contains("Open developer mode").click({ force: true })
cy.get(interact.SPECTRUM_SIDENAV).should('exist') // config sections available cy.get(interact.SPECTRUM_SIDENAV).should('exist') // config sections available
cy.get(interact.CREATE_APP_BUTTON).should('exist') // create app button available cy.get(interact.CREATE_APP_BUTTON).should('exist') // create app button available
cy.get(interact.APP_TABLE).should('exist') // App table available
}) })
after(() => { after(() => {

View file

@ -140,14 +140,14 @@ Cypress.Commands.add("setUserRole", (user, role) => {
// Set Role // Set Role
cy.wait(500) cy.wait(500)
cy.get(".spectrum-Form-itemField") cy.get(".spectrum-Form-itemField")
.eq(2) .eq(3)
.within(() => { .within(() => {
cy.get(".spectrum-Picker-label").click({ force: true }) cy.get(".spectrum-Picker-label").click({ force: true })
}) })
cy.get(".spectrum-Menu").within(() => { cy.get(".spectrum-Menu").within(() => {
cy.get(".spectrum-Menu-itemLabel").contains(role).click({ force: true }) cy.get(".spectrum-Menu-itemLabel").contains(role).click({ force: true })
}) })
cy.get(".spectrum-Form-itemField").eq(2).should("contain", role) cy.get(".spectrum-Form-itemField").eq(3).should("contain", role)
}) })
// APPLICATIONS // APPLICATIONS