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 @@ -163,6 +163,27 @@ module.exports = class BasePage {
163
163
})
164
164
*/
165
165
}
166
+
167
+ async isPopupWarningNotDisplayed ( ) {
168
+ return this . isElementNotVisible ( FORM_POPUP )
169
+ }
170
+
171
+ async isElementNotVisible ( locator ) {
172
+ try {
173
+ await this . driver . wait ( async ( ) => {
174
+ try {
175
+ const element = await this . driver . findElement ( locator )
176
+ const visible = await element . isDisplayed ( )
177
+ return ! visible
178
+ } catch ( error ) {
179
+ return true
180
+ }
181
+ } , this . timeout )
182
+ return true
183
+ } catch ( error ) {
184
+ return false
185
+ }
186
+ }
166
187
async getPopupWarning ( ) {
167
188
let element = await driver . findElement ( FORM_POPUP )
168
189
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