Skip to content

Commit ac0cfa8

Browse files
Add missing dedicate page for spring
1 parent 23fad23 commit ac0cfa8

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
5+
TEST_CASES_PATH=/oauth/with-idp-initiated
6+
TEST_CONFIG_PATH=/oauth
7+
PROFILES="spring idp-initiated spring-oauth-provider fakeportal-mgt-oauth-provider tls opaque-token"
8+
9+
source $SCRIPT/../../bin/suite_template $@
10+
runWith spring fakeportal
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { By, Key, until, Builder } = require('selenium-webdriver')
2+
3+
const BasePage = require('./BasePage')
4+
5+
const FORM = By.css('form.login-form')
6+
const USERNAME = By.css('input[name="username"]')
7+
const PASSWORD = By.css('input[name="password"]')
8+
9+
module.exports = class SpringLoginPage extends BasePage {
10+
async isLoaded () {
11+
return this.waitForDisplayed(FORM)
12+
}
13+
14+
async login (username, password) {
15+
await this.isLoaded()
16+
17+
await this.sendKeys(USERNAME, username)
18+
await this.sendKeys(PASSWORD, password)
19+
return this.submit(FORM)
20+
}
21+
}

selenium/test/utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require('chromedriver')
88
var chrome = require("selenium-webdriver/chrome");
99
const UAALoginPage = require('./pageobjects/UAALoginPage')
1010
const KeycloakLoginPage = require('./pageobjects/KeycloakLoginPage')
11+
const SpringLoginPage = require('./pageobjects/SpringLoginPage')
1112
const assert = require('assert')
1213

1314
const runLocal = String(process.env.RUN_LOCAL).toLowerCase() != 'false'
@@ -215,13 +216,16 @@ module.exports = {
215216
preferredIdp = "uaa"
216217
} else if (process.env.PROFILES.includes("keycloak")) {
217218
preferredIdp = "keycloak"
219+
} else if (process.env.PROFILES.includes("spring")) {
220+
preferredIdp = "spring"
218221
} else {
219222
throw new Error("Missing uaa or keycloak profiles")
220223
}
221224
}
222225
switch(preferredIdp) {
223226
case "uaa": return new UAALoginPage(d)
224227
case "keycloak": return new KeycloakLoginPage(d)
228+
case "spring": return new SpringLoginPage(d)
225229
default: new Error("Unsupported ipd " + preferredIdp)
226230
}
227231
},

0 commit comments

Comments
 (0)