mirror of
https://git.cloudron.io/cloudron/peertube-app.git
synced 2025-06-05 16:48:46 +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 username = process.env.USERNAME;
|
||||||
let password = process.env.PASSWORD;
|
let password = process.env.PASSWORD;
|
||||||
let email = process.env.EMAIL;
|
let email = process.env.EMAIL;
|
||||||
let athenticated_by_oidc = false;
|
|
||||||
|
|
||||||
before(function () {
|
before(function () {
|
||||||
const chromeOptions = new Options().windowSize({ width: 1280, height: 1024 });
|
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")]'));
|
await waitForElement(By.xpath('//a[contains(@href, "/my-library")]'));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loginOIDC(username, password) {
|
async function loginOIDC(username, password, alreadyAuthenticated = false) {
|
||||||
browser.manage().deleteAllCookies();
|
browser.manage().deleteAllCookies();
|
||||||
await browser.get(`https://${app.fqdn}/login`);
|
await browser.get(`https://${app.fqdn}/login`);
|
||||||
await browser.sleep(2000);
|
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.findElement(By.xpath('//a[contains(., "Cloudron")]')).click();
|
||||||
await browser.sleep(2000);
|
await browser.sleep(2000);
|
||||||
|
|
||||||
if (!athenticated_by_oidc) {
|
if (!alreadyAuthenticated) {
|
||||||
await waitForElement(By.id('inputUsername'));
|
await waitForElement(By.id('inputUsername'));
|
||||||
await browser.findElement(By.id('inputUsername')).sendKeys(username);
|
await browser.findElement(By.id('inputUsername')).sendKeys(username);
|
||||||
await browser.findElement(By.id('inputPassword')).sendKeys(password);
|
await browser.findElement(By.id('inputPassword')).sendKeys(password);
|
||||||
await browser.findElement(By.id('loginSubmitButton')).click();
|
await browser.findElement(By.id('loginSubmitButton')).click();
|
||||||
|
|
||||||
athenticated_by_oidc = true;
|
|
||||||
}
|
}
|
||||||
await browser.sleep(20000);
|
await browser.sleep(20000);
|
||||||
await waitForElement(By.xpath('//a[contains(@href, "/my-library")]'));
|
await waitForElement(By.xpath('//a[contains(@href, "/my-library")]'));
|
||||||
|
|
Loading…
Reference in a new issue