1
0
mirror of https://git.cloudron.io/cloudron/minio-app synced 2025-09-15 17:39:12 +00:00

CLOUDRON_OIDC_PROVIDER_NAME implemented

checklist added
tests updated
This commit is contained in:
Vladimir D
2024-12-19 15:43:06 +04:00
parent 43bde46b81
commit 3d77021618
5 changed files with 566 additions and 1952 deletions

View File

@@ -30,7 +30,7 @@ describe('Application life cycle test', function () {
const EXEC_ARGS = { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' };
let browser, app;
let athenticated_by_oidc = false, rootPassword;
let rootPassword;
const username = process.env.USERNAME;
const password = process.env.PASSWORD;
@@ -89,23 +89,22 @@ describe('Application life cycle test', function () {
await timers.setTimeout(5000);
}
async function loginOIDC(username, password) {
async function loginOIDC(username, password, alreadyAuthenticated = true) {
browser.manage().deleteAllCookies();
await browser.get(`https://${app.fqdn}/login`);
await browser.sleep(10000);
await browser.findElement(By.xpath('//button[contains(., "Cloudron")]')).click();
await waitForElement(By.xpath('//button[contains(., "iam")]'));
await browser.findElement(By.xpath('//button[contains(., "iam")]')).click();
await browser.sleep(10000);
if (!athenticated_by_oidc) {
await waitForElement(By.xpath('//input[@name="username"]'));
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(username);
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password);
await browser.sleep(2000);
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();
await browser.sleep(2000);
athenticated_by_oidc = true;
}
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
@@ -210,7 +209,7 @@ describe('Application life cycle test', function () {
it('does redirect', checkRedirect);
it('check api', checkApi);
it('can OIDC login', loginOIDC.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password, false));
it('has bucket', checkBucket);
it('can logout', logout);
@@ -227,7 +226,7 @@ describe('Application life cycle test', function () {
it('does redirect', checkRedirect);
it('check api', checkApi);
it('can OIDC login', loginOIDC.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password, true));
it('has bucket', checkBucket);
it('can logout', logout);
@@ -246,7 +245,7 @@ describe('Application life cycle test', function () {
it('has bucket', checkBucket);
it('can logout', logout);
it('can OIDC login', loginOIDC.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password, true));
it('has bucket', checkBucket);
it('can logout', logout);
@@ -264,7 +263,7 @@ describe('Application life cycle test', function () {
it('has bucket', checkBucket);
it('can logout', logout);
it('can OIDC login', loginOIDC.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password, true));
it('has bucket', checkBucket);
it('can logout', logout);
@@ -282,7 +281,7 @@ describe('Application life cycle test', function () {
it('can add buckets', addBucket);
it('can logout', logout);
it('can OIDC login', loginOIDC.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password, true));
it('has bucket', checkBucket);
it('can logout', logout);
@@ -294,7 +293,7 @@ describe('Application life cycle test', function () {
it('has bucket', checkBucket);
it('can logout', logout);
it('can OIDC login', loginOIDC.bind(null, username, password));
it('can OIDC login', loginOIDC.bind(null, username, password, true));
it('has bucket', checkBucket);
it('can logout', logout);