Skip to content

Commit 4603901

Browse files
Merge pull request #13501 from rabbitmq/mergify/bp/v4.1.x/pr-13493
Add missing selenium function (backport #13493)
2 parents 7e37404 + c66bb40 commit 4603901

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
@@ -486,6 +486,12 @@ runWith() {
486486
run_local_with $@
487487
fi
488488
}
489+
initOnly() {
490+
if [[ "$COMMAND" == "initOnly" ]]
491+
then
492+
init_only $@
493+
fi
494+
}
489495

490496
run_local_with() {
491497
export PROFILES="local ${PROFILES}"
@@ -536,6 +542,15 @@ determine_required_components_excluding_rabbitmq() {
536542
fi
537543
}
538544
}
545+
initOnly() {
546+
for (( i=1; i<=$#; i++)) {
547+
eval val='$'$i
548+
if [[ $val != "rabbitmq" ]]; then
549+
init="init_$val"
550+
$init
551+
fi
552+
}
553+
}
539554
run_on_docker_with() {
540555
determine_required_components_including_rabbitmq $@
541556
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
@@ -163,6 +163,27 @@ module.exports = class BasePage {
163163
})
164164
*/
165165
}
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+
}
166187
async getPopupWarning() {
167188
let element = await driver.findElement(FORM_POPUP)
168189
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)