diff --git a/selenium/bin/suite_template b/selenium/bin/suite_template index de820ef9dabb..e37db8cfeb32 100644 --- a/selenium/bin/suite_template +++ b/selenium/bin/suite_template @@ -486,6 +486,12 @@ runWith() { run_local_with $@ fi } +initOnly() { + if [[ "$COMMAND" == "initOnly" ]] + then + init_only $@ + fi +} run_local_with() { export PROFILES="local ${PROFILES}" @@ -536,6 +542,15 @@ determine_required_components_excluding_rabbitmq() { fi } } +initOnly() { + for (( i=1; i<=$#; i++)) { + eval val='$'$i + if [[ $val != "rabbitmq" ]]; then + init="init_$val" + $init + fi + } +} run_on_docker_with() { determine_required_components_including_rabbitmq $@ export PROFILES=`profiles_with_local_or_docker` diff --git a/selenium/suites/authnz-mgt/multi-oauth-with-basic-auth-when-idps-down.sh b/selenium/suites/authnz-mgt/multi-oauth-with-basic-auth-when-idps-down.sh index 1bea7e906036..8b46c5e0d7fc 100755 --- a/selenium/suites/authnz-mgt/multi-oauth-with-basic-auth-when-idps-down.sh +++ b/selenium/suites/authnz-mgt/multi-oauth-with-basic-auth-when-idps-down.sh @@ -7,4 +7,5 @@ TEST_CONFIG_PATH=/multi-oauth PROFILES="devkeycloak prodkeycloak enable-basic-auth with-resource-label with-resource-scopes tls" source $SCRIPT/../../bin/suite_template $@ +initOnly devkeycloak prodkeycloak run diff --git a/selenium/test/oauth/with-idp-down/landing.js b/selenium/test/oauth/with-idp-down/landing.js index 5e23e8df807c..a096e11f6ada 100644 --- a/selenium/test/oauth/with-idp-down/landing.js +++ b/selenium/test/oauth/with-idp-down/landing.js @@ -26,7 +26,7 @@ describe('When UAA is down', function () { it('should not be presented with a login button to log in', async function () { await homePage.isLoaded() - assert.equal(false, await homePage.isLoginButtonVisible()) + assert.ok(await homePage.isLoginButtonNotVisible()) }) after(async function () { diff --git a/selenium/test/pageobjects/BasePage.js b/selenium/test/pageobjects/BasePage.js index dd6ff2230203..febdbfb89ee4 100644 --- a/selenium/test/pageobjects/BasePage.js +++ b/selenium/test/pageobjects/BasePage.js @@ -163,6 +163,27 @@ module.exports = class BasePage { }) */ } + + async isPopupWarningNotDisplayed() { + return this.isElementNotVisible(FORM_POPUP) + } + + async isElementNotVisible(locator) { + try { + await this.driver.wait(async() => { + try { + const element = await this.driver.findElement(locator) + const visible = await element.isDisplayed() + return !visible + } catch (error) { + return true + } + }, this.timeout) + return true + } catch (error) { + return false + } + } async getPopupWarning() { let element = await driver.findElement(FORM_POPUP) return this.driver.wait(until.elementIsVisible(element), this.timeout, diff --git a/selenium/test/pageobjects/SSOHomePage.js b/selenium/test/pageobjects/SSOHomePage.js index 38ef6f3af3c2..9b22aea3087d 100644 --- a/selenium/test/pageobjects/SSOHomePage.js +++ b/selenium/test/pageobjects/SSOHomePage.js @@ -51,6 +51,9 @@ module.exports = class SSOHomePage extends BasePage { async getOAuthResourceOptions () { return this.getSelectableOptions(SELECT_RESOURCES) } + async isLoginButtonNotVisible() { + return this.isElementNotVisible(OAUTH2_LOGIN_BUTTON) + } async isLoginButtonVisible() { try { await this.waitForDisplayed(OAUTH2_LOGIN_BUTTON)