Skip to content

Commit 71199a4

Browse files
Merge pull request #13506 from rabbitmq/mergify/bp/v4.0.x/pr-13501
Add missing selenium function (backport #13493) (backport #13501)
2 parents 15443b1 + 4604bcf commit 71199a4

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-1
lines changed

selenium/bin/suite_template

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,12 @@ runWith() {
479479
run_local_with $@
480480
fi
481481
}
482+
initOnly() {
483+
if [[ "$COMMAND" == "initOnly" ]]
484+
then
485+
init_only $@
486+
fi
487+
}
482488

483489
run_local_with() {
484490
export PROFILES="local ${PROFILES}"
@@ -529,6 +535,15 @@ determine_required_components_excluding_rabbitmq() {
529535
fi
530536
}
531537
}
538+
initOnly() {
539+
for (( i=1; i<=$#; i++)) {
540+
eval val='$'$i
541+
if [[ $val != "rabbitmq" ]]; then
542+
init="init_$val"
543+
$init
544+
fi
545+
}
546+
}
532547
run_on_docker_with() {
533548
determine_required_components_including_rabbitmq $@
534549
export PROFILES=`profiles_with_local_or_docker`

selenium/suites/authnz-mgt/multi-oauth-with-basic-auth-when-idps-down.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ TEST_CONFIG_PATH=/multi-oauth
77
PROFILES="devkeycloak prodkeycloak enable-basic-auth with-resource-label with-resource-scopes tls"
88

99
source $SCRIPT/../../bin/suite_template $@
10+
initOnly devkeycloak prodkeycloak
1011
run

selenium/test/oauth/with-idp-down/landing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('When UAA is down', function () {
2626

2727
it('should not be presented with a login button to log in', async function () {
2828
await homePage.isLoaded()
29-
assert.equal(false, await homePage.isLoginButtonVisible())
29+
assert.ok(await homePage.isLoginButtonNotVisible())
3030
})
3131

3232
after(async function () {

selenium/test/pageobjects/BasePage.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,27 @@ module.exports = class BasePage {
162162
})
163163
*/
164164
}
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+
}
165186
async getPopupWarning() {
166187
let element = await driver.findElement(FORM_POPUP)
167188
return this.driver.wait(until.elementIsVisible(element), this.timeout,

selenium/test/pageobjects/SSOHomePage.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ module.exports = class SSOHomePage extends BasePage {
5151
async getOAuthResourceOptions () {
5252
return this.getSelectableOptions(SELECT_RESOURCES)
5353
}
54+
async isLoginButtonNotVisible() {
55+
return this.isElementNotVisible(OAUTH2_LOGIN_BUTTON)
56+
}
5457
async isLoginButtonVisible() {
5558
try {
5659
await this.waitForDisplayed(OAUTH2_LOGIN_BUTTON)

0 commit comments

Comments
 (0)