Fix landing.js

This commit is contained in:
Marcial Rosales 2024-01-28 12:12:55 +01:00
parent d69fc0e8b9
commit 0e759efdf7
2 changed files with 7 additions and 5 deletions

View File

@ -18,8 +18,7 @@ describe('A user which accesses any protected URL without a session where basic
})
it('should be presented with a login button to log in using OAuth 2.0', async function () {
assert.ok(await homePage.getOAuth2Section())
console.log("had oauth section")
await homePage.getOAuth2Section()
assert.equal(await homePage.getLoginButton(), 'Click here to log in')
})
@ -34,7 +33,7 @@ describe('A user which accesses any protected URL without a session where basic
it('should be presented with a login button to log in using Basic Auth', async function () {
await homePage.toggleBasicAuthSection()
assert.ok(await homePage.isBasicAuthSectionVisible())
await homePage.getBasicAuthSection()
assert.equal(await homePage.getBasicAuthLoginButton(), 'Login')
})

View File

@ -72,12 +72,15 @@ module.exports = class SSOHomePage extends BasePage {
return this.isDisplayed(SECTION_LOGIN_WITH_OAUTH)
}
async getOAuth2Section() {
await this.waitForDisplayed(SECTION_LOGIN_WITH_OAUTH)
return this.waitForDisplayed(SECTION_LOGIN_WITH_OAUTH)
}
async isBasicAuthSectionVisible() {
return this.isDisplayed(SECTION_LOGIN_WITH_BASIC_AUTH)
}
async getBasicAuthSection() {
return this.waitForDisplayed(SECTION_LOGIN_WITH_BASIC_AUTH)
}
async toggleBasicAuthSection() {
await this.click(SECTION_LOGIN_WITH_BASIC_AUTH)
}