-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:apereo/cas
- Loading branch information
Showing
4 changed files
with
80 additions
and
19 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
ci/tests/puppeteer/scenarios/pac4j-delegated-concurrency/script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const assert = require('assert'); | ||
const fs = require('fs'); | ||
const {JSONPath} = require('jsonpath-plus'); | ||
|
||
const startPuppeteerLoadTest = require('puppeteer-loadtest'); | ||
let args = process.argv.slice(2); | ||
const config = JSON.parse(fs.readFileSync(args[0])); | ||
assert(config != null) | ||
|
||
const paramOptions = { | ||
file: config.loadScript, | ||
samplesRequested: config.samplesRequested, | ||
concurrencyRequested: config.concurrencyRequested | ||
} | ||
const loadtest = async () => { | ||
return await startPuppeteerLoadTest(paramOptions); | ||
} | ||
|
||
loadtest().then(results => { | ||
console.log(JSON.stringify(results, null, 2)) | ||
const samples = JSONPath({path: '$..sample', json: results }) | ||
assert(samples.length === parseInt(config.samplesRequested)) | ||
}); |
17 changes: 17 additions & 0 deletions
17
ci/tests/puppeteer/scenarios/pac4j-delegated-concurrency/script.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"dependencies": "pac4j-webflow", | ||
"properties": [ | ||
"--cas.authn.pac4j.github.client-name=GitHubClient", | ||
"--cas.authn.pac4j.github.id=84cfb715b8237728e567", | ||
"--cas.authn.pac4j.github.secret=71a294b6c9f5b00333f4bfb369bbbafa36a86bad", | ||
|
||
"--cas.authn.pac4j.twitter.client-name=TwitterClient", | ||
"--cas.authn.pac4j.twitter.id=Dsw8eftYNLXM0tjsxC06dEjGS", | ||
"--cas.authn.pac4j.twitter.secret=aYNpkBbvK7lGnFY4BTQqaX2bEqygCHiN825erOBXkXT0pINBUy", | ||
|
||
"--logging.level.org.apereo.cas=info" | ||
], | ||
"loadScript": "./ci/tests/puppeteer/scenarios/pac4j-delegated-concurrency/test.js", | ||
"samplesRequested": 1, | ||
"concurrencyRequested": 50 | ||
} |
20 changes: 20 additions & 0 deletions
20
ci/tests/puppeteer/scenarios/pac4j-delegated-concurrency/test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const puppeteer = require('puppeteer'); | ||
const cas = require('../../cas.js'); | ||
|
||
(async () => { | ||
const browser = await puppeteer.launch(cas.browserOptions()); | ||
const page = await cas.newPage(browser); | ||
await page.goto("https://localhost:8443/cas/login"); | ||
await page.waitForTimeout(3000); | ||
|
||
await cas.assertVisibility(page, '#loginProviders') | ||
await cas.assertVisibility(page, 'li #TwitterClient') | ||
await cas.assertVisibility(page, 'li #GitHubClient') | ||
|
||
await page.goto("https://localhost:8443/cas/clientredirect?client_name=GithubClient"); | ||
await page.waitForTimeout(3000); | ||
|
||
await cas.assertVisibility(page, '#login_field') | ||
|
||
await browser.close(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters