File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ describe('When UAA is down', function () {
26
26
27
27
it ( 'should not be presented with a login button to log in' , async function ( ) {
28
28
await homePage . isLoaded ( )
29
- assert . equal ( false , await homePage . isLoginButtonVisible ( ) )
29
+ assert . ok ( await homePage . isLoginButtonNotVisible ( ) )
30
30
} )
31
31
32
32
after ( async function ( ) {
Original file line number Diff line number Diff line change @@ -162,6 +162,27 @@ module.exports = class BasePage {
162
162
})
163
163
*/
164
164
}
165
+
166
+ async isPopupWarningNotDisplayed ( ) {
167
+ return this . isElementNotVisible ( FORM_POPUP )
168
+ }
169
+
170
+ async isElementNotVisible ( locator ) {
171
+ try {
172
+ await this . driver . wait ( async ( ) => {
173
+ try {
174
+ const element = await this . driver . findElement ( locator )
175
+ const visible = await element . isDisplayed ( )
176
+ return ! visible
177
+ } catch ( error ) {
178
+ return true
179
+ }
180
+ } , this . timeout )
181
+ return true
182
+ } catch ( error ) {
183
+ return false
184
+ }
185
+ }
165
186
async getPopupWarning ( ) {
166
187
let element = await driver . findElement ( FORM_POPUP )
167
188
return this . driver . wait ( until . elementIsVisible ( element ) , this . timeout ,
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ module.exports = class SSOHomePage extends BasePage {
51
51
async getOAuthResourceOptions ( ) {
52
52
return this . getSelectableOptions ( SELECT_RESOURCES )
53
53
}
54
+ async isLoginButtonNotVisible ( ) {
55
+ return this . isElementNotVisible ( OAUTH2_LOGIN_BUTTON )
56
+ }
54
57
async isLoginButtonVisible ( ) {
55
58
try {
56
59
await this . waitForDisplayed ( OAUTH2_LOGIN_BUTTON )
You can’t perform that action at this time.
0 commit comments