Skip to content

Commit

Permalink
Merge pull request #27 from DEFRA/updates-to-login-work
Browse files Browse the repository at this point in the history
Updates to login work
  • Loading branch information
feedmypixel authored Dec 18, 2024
2 parents 7ce8428 + 203bffc commit 3d04f98
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test/page-objects/login-stub.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ class LoginStubPage extends Page {

async loginAsAdmin() {
await super.login()
await this.onLoginStubsPage()
return await this.adminUserLink().click()
await expect(browser).toHaveTitle('CDP-Portal-Stubs - Login Stub')

const adminUserLink = this.adminUserLink()
await expect(adminUserLink).toExist()

await adminUserLink.click()
}

async loginAsNonAdmin() {
await super.login()
await this.onLoginStubsPage()
return await this.nonAdminUserLink().click()
}
await expect(browser).toHaveTitle('CDP-Portal-Stubs - Login Stub')

const nonAdminUserLink = this.nonAdminUserLink()
await expect(nonAdminUserLink).toExist()

onLoginStubsPage() {
return expect(browser).toHaveTitle('CDP-Portal-Stubs - Login Stub')
await nonAdminUserLink.click()
}
}

Expand Down
4 changes: 4 additions & 0 deletions test/specs/admin.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ describe('Admin', () => {
await expect(await AdminPage.navIsActive()).toBe(true)
await expect(PageHeadingComponent.title('Users')).toExist()
})

after(async () => {
await AdminPage.logOut()
})
})
})

0 comments on commit 3d04f98

Please sign in to comment.