Skip to content

Commit 983e9fd

Browse files
MarcialRosalesmergify[bot]
authored andcommitted
Test reload on other types of login
(cherry picked from commit 07afabb)
1 parent 063a885 commit 983e9fd

4 files changed

Lines changed: 30 additions & 4 deletions

File tree

selenium/bin/components/fakeproxy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ start_fakeproxy() {
4646
--publish 9090:9090 \
4747
--env PORT=9090 \
4848
--env RABBITMQ_URL="${RABBITMQ_URL_FOR_FAKEPROXY}" \
49-
--env UAA_URL="${UAA_URL_FOR_FAKEPROXY}" \
49+
--env IDP_TOKEN_ENDPOINT="${IDP_TOKEN_ENDPOINT}" \
5050
--env CLIENT_ID="${CLIENT_ID}" \
5151
--env CLIENT_SECRET="${CLIENT_SECRET}" \
5252
--env NODE_EXTRA_CA_CERTS=/etc/uaa/ca_uaa_certificate.pem \

selenium/fakeportal/proxy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
var http = require('http'),
2-
httpProxy = require('http-proxy');
2+
httpProxy = require('http-proxy');
33

44
const XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest
55

66
const rabbitmq_url = process.env.RABBITMQ_URL || 'http://0.0.0.0:15672/';
77
const client_id = process.env.CLIENT_ID;
88
const client_secret = process.env.CLIENT_SECRET;
9-
const uaa_url = process.env.UAA_URL;
109
const port = process.env.PORT;
10+
const idp_token_endpoint = process.env.IDP_TOKEN_ENDPOINT;
1111

1212
//
1313
// Create a proxy server with custom application logic
@@ -52,7 +52,7 @@ function default_if_blank(value, defaultValue) {
5252

5353
function access_token(id, secret) {
5454
const req = new XMLHttpRequest();
55-
const url = uaa_url + '/oauth/token';
55+
const url = idp_token_endpoint;
5656
const params = 'client_id=' + id +
5757
'&client_secret=' + secret +
5858
'&grant_type=client_credentials' +

selenium/test/oauth/with-idp-initiated-via-proxy/happy-login.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ describe('A user with a JWT token', function () {
2222
assert.equal(await overview.getUser(), 'User rabbit_idp_user')
2323
})
2424

25+
26+
it ('can reload page without being logged out', async function() {
27+
await goToHome(driver);
28+
await overview.isLoaded();
29+
30+
overview.refresh()
31+
if (!await overview.isLoaded()) {
32+
throw new Error('Failed to keep session opened')
33+
}
34+
})
35+
36+
2537
after(async function () {
2638
await teardown(driver, this, captureScreen)
2739
})

selenium/test/oauth/with-idp-initiated/happy-login.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ describe('A user with a JWT token', function () {
3333
assert.equal(await overview.getUser(), 'User ' + username)
3434
})
3535

36+
it ('can reload page without being logged out', async function() {
37+
await fakePortal.goToHome(username, password)
38+
if (!await fakePortal.isLoaded()) {
39+
throw new Error('Failed to load fakePortal')
40+
}
41+
await fakePortal.login()
42+
await overview.isLoaded()
43+
44+
overview.refresh()
45+
if (!await overview.isLoaded()) {
46+
throw new Error('Failed to keep session opened')
47+
}
48+
})
49+
3650
after(async function () {
3751
await teardown(driver, this, captureScreen)
3852
})

0 commit comments

Comments
 (0)