Fixup tests
This commit is contained in:
parent
7c098a3236
commit
c70b70d6b0
17
test/test.js
17
test/test.js
|
@ -77,15 +77,12 @@ describe('Application life cycle test', function () {
|
|||
async function loginOIDC(username, password) {
|
||||
browser.manage().deleteAllCookies();
|
||||
await browser.get(`https://${app.fqdn}/i/`);
|
||||
await browser.sleep(6000);
|
||||
|
||||
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);
|
||||
await browser.findElement(By.xpath('//button[@type="submit" and contains(text(), "Sign in")]')).click();
|
||||
await browser.sleep(2000);
|
||||
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;
|
||||
}
|
||||
|
@ -173,7 +170,7 @@ describe('Application life cycle test', function () {
|
|||
it('can get app information', getAppInfo);
|
||||
|
||||
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 enable API', enableApi);
|
||||
it('can check configuration', checkApiConfiguration);
|
||||
|
@ -215,9 +212,8 @@ describe('Application life cycle test', function () {
|
|||
|
||||
it('can get app information', getAppInfo);
|
||||
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 add users', addUser.bind(null, 'test', admin_password));
|
||||
|
||||
it('can update', function () {
|
||||
execSync('cloudron update --app ' + app.id, EXEC_ARGS);
|
||||
|
@ -226,6 +222,7 @@ describe('Application life cycle test', function () {
|
|||
expect(app).to.be.an('object');
|
||||
});
|
||||
|
||||
it('can add users', addUser.bind(null, 'test', admin_password));
|
||||
it('subscription exists', subscriptionExists);
|
||||
it('can get static extension file', getStaticExtensionFile);
|
||||
|
||||
|
|
Loading…
Reference in New Issue