Skip to content

Commit

Permalink
add support for simple-cas
Browse files Browse the repository at this point in the history
  • Loading branch information
kkalev committed Nov 26, 2023
1 parent 8fc12e9 commit 0d47af4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ console.log(url[0]);
* Environment variables
- `CAS_USER`: Username (default `gunetdemo`)
- `CAS_PASSWORD`: Password (default `gunetdemo`)
- `CAS_TYPE`: The CAS type. Can be one of:
* `cas`: If using Apereo CAS (the default)
* `simple-cas`: If using the gunet/simpleidentity `simple-cas` Docker container
* Show module version: `docker run --rm ghcr.io/gunet/puppeteer npm list`
* General Run: `docker run -it --cap-add=SYS_ADMIN --rm ghcr.io/gunet/puppeteer node --unhandled-rejections=strict <scenario + args>`
* Specific scenarios:
Expand Down
7 changes: 6 additions & 1 deletion login.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ console.log(url[0]);
await gunet.loginWith(page, `${process.env.CAS_USER}`, `${process.env.CAS_PASSWORD}`);
await gunet.assertTicketGrantingCookie(page);
await page.waitForTimeout(2000)
await gunet.assertInnerText(page, '#content div h2', "Επιτυχής Σύνδεση");
if (process.env.CAS_TYPE === 'cas') {
await gunet.assertInnerText(page, '#content div h2', "Επιτυχής Σύνδεση");
}
else if (process.env.CAS_TYPE === 'simple-cas') {
await gunet.assertInnerText(page, '#content div h2', "Log In Successful");
}
await browser.close();
})();

0 comments on commit 0d47af4

Please sign in to comment.