mirror of
https://git.cloudron.io/cloudron/peertube-app.git
synced 2025-02-05 05:42:23 +00:00
fix oidc login
This commit is contained in:
parent
716480882c
commit
a4371d0283
1 changed files with 2 additions and 5 deletions
|
@ -37,7 +37,6 @@ describe('Application life cycle test', function () {
|
|||
let username = process.env.USERNAME;
|
||||
let password = process.env.PASSWORD;
|
||||
let email = process.env.EMAIL;
|
||||
let athenticated_by_oidc = false;
|
||||
|
||||
before(function () {
|
||||
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 });
|
||||
|
@ -102,7 +101,7 @@ describe('Application life cycle test', function () {
|
|||
await waitForElement(By.xpath('//a[contains(@href, "/my-library")]'));
|
||||
}
|
||||
|
||||
async function loginOIDC(username, password) {
|
||||
async function loginOIDC(username, password, alreadyAuthenticated = false) {
|
||||
browser.manage().deleteAllCookies();
|
||||
await browser.get(`https://${app.fqdn}/login`);
|
||||
await browser.sleep(2000);
|
||||
|
@ -111,13 +110,11 @@ describe('Application life cycle test', function () {
|
|||
await browser.findElement(By.xpath('//a[contains(., "Cloudron")]')).click();
|
||||
await browser.sleep(2000);
|
||||
|
||||
if (!athenticated_by_oidc) {
|
||||
if (!alreadyAuthenticated) {
|
||||
await waitForElement(By.id('inputUsername'));
|
||||
await browser.findElement(By.id('inputUsername')).sendKeys(username);
|
||||
await browser.findElement(By.id('inputPassword')).sendKeys(password);
|
||||
await browser.findElement(By.id('loginSubmitButton')).click();
|
||||
|
||||
athenticated_by_oidc = true;
|
||||
}
|
||||
await browser.sleep(20000);
|
||||
await waitForElement(By.xpath('//a[contains(@href, "/my-library")]'));
|
||||
|
|
Loading…
Reference in a new issue