Fixup tests

This commit is contained in:
Johannes Zellner 2024-06-05 20:29:29 +02:00
parent 7c098a3236
commit c70b70d6b0
1 changed files with 7 additions and 10 deletions

View File

@ -77,15 +77,12 @@ describe('Application life cycle test', function () {
async function loginOIDC(username, password) { async function loginOIDC(username, password) {
browser.manage().deleteAllCookies(); browser.manage().deleteAllCookies();
await browser.get(`https://${app.fqdn}/i/`); await browser.get(`https://${app.fqdn}/i/`);
await browser.sleep(6000);
if (!athenticated_by_oidc) { if (!athenticated_by_oidc) {
await waitForElement(By.xpath('//input[@name="username"]')); await waitForElement(By.id('inputUsername'));
await browser.findElement(By.xpath('//input[@name="username"]')).sendKeys(username); await browser.findElement(By.id('inputUsername')).sendKeys(username);
await browser.findElement(By.xpath('//input[@name="password"]')).sendKeys(password); await browser.findElement(By.id('inputPassword')).sendKeys(password);
await browser.sleep(2000); await browser.findElement(By.id('loginSubmitButton')).click();
await browser.findElement(By.xpath('//button[@type="submit" and contains(text(), "Sign in")]')).click();
await browser.sleep(2000);
athenticated_by_oidc = true; athenticated_by_oidc = true;
} }
@ -173,7 +170,7 @@ describe('Application life cycle test', function () {
it('can get app information', getAppInfo); it('can get app information', getAppInfo);
it('can login OIDC', loginOIDC.bind(null, USERNAME, PASSWORD)); it('can login OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
it('can make user Administrator', function () { execSync(`cloudron exec --app ${app.id} -- bash -c "php cli/reconfigure.php --default_user ${USERNAME}"`); }); it('can make user Administrator', function () { execSync(`cloudron exec --app ${app.id} -- bash -c "php cli/reconfigure.php --default-user ${USERNAME}"`); });
it('can subscribe', addSubscription); it('can subscribe', addSubscription);
it('can enable API', enableApi); it('can enable API', enableApi);
it('can check configuration', checkApiConfiguration); it('can check configuration', checkApiConfiguration);
@ -215,9 +212,8 @@ describe('Application life cycle test', function () {
it('can get app information', getAppInfo); it('can get app information', getAppInfo);
it('can login OIDC', loginOIDC.bind(null, USERNAME, PASSWORD)); it('can login OIDC', loginOIDC.bind(null, USERNAME, PASSWORD));
it('can make user Administrator', function () { execSync(`cloudron exec --app ${app.id} -- bash -c "php cli/reconfigure.php --default_user ${USERNAME}"`); }); it('can make user Administrator', function () { execSync(`cloudron exec --app ${app.id} -- bash -c "php cli/reconfigure.php --default-user ${USERNAME}"`); });
it('can subscribe', addSubscription); it('can subscribe', addSubscription);
it('can add users', addUser.bind(null, 'test', admin_password));
it('can update', function () { it('can update', function () {
execSync('cloudron update --app ' + app.id, EXEC_ARGS); execSync('cloudron update --app ' + app.id, EXEC_ARGS);
@ -226,6 +222,7 @@ describe('Application life cycle test', function () {
expect(app).to.be.an('object'); expect(app).to.be.an('object');
}); });
it('can add users', addUser.bind(null, 'test', admin_password));
it('subscription exists', subscriptionExists); it('subscription exists', subscriptionExists);
it('can get static extension file', getStaticExtensionFile); it('can get static extension file', getStaticExtensionFile);