mirror of
https://git.cloudron.io/cloudron/peertube-app.git
synced 2025-03-30 07:05:28 +00:00
Fix tests
This commit is contained in:
parent
4f310771f2
commit
716480882c
1 changed files with 14 additions and 23 deletions
37
test/test.js
37
test/test.js
|
@ -132,16 +132,6 @@ describe('Application life cycle test', function () {
|
|||
await browser.sleep(3000);
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
await browser.get('https://' + app.fqdn + '/my-account/videos');
|
||||
await waitForElement(By.xpath('//div[@class="logged-in-display-name"]'));
|
||||
await browser.sleep(2000);
|
||||
await browser.findElement(By.xpath('//div[@class="logged-in-display-name"]')).click();
|
||||
await browser.sleep(2000);
|
||||
await browser.findElement(By.xpath('//button[contains(text(), "Log out")]')).click();
|
||||
await browser.sleep(2000);
|
||||
}
|
||||
|
||||
async function completeSetup() {
|
||||
let button;
|
||||
|
||||
|
@ -164,8 +154,8 @@ describe('Application life cycle test', function () {
|
|||
console.log('waiting 10 seconds for upload');
|
||||
await browser.sleep(10000); // wait for upload
|
||||
|
||||
await waitForElement(By.xpath('//div[@class="submit-container"]//span[text()="Publish"]'));
|
||||
let button = browser.findElement(By.xpath('//div[@class="submit-container"]//span[text()="Publish"]'));
|
||||
await waitForElement(By.xpath('//div[@class="submit-container"]//span[contains(.,"Publish")]'));
|
||||
let button = browser.findElement(By.xpath('//div[@class="submit-container"]//span[contains(.,"Publish")]'));
|
||||
await browser.executeScript('arguments[0].scrollIntoView(false)', button);
|
||||
await browser.sleep(2000);
|
||||
await button.click();
|
||||
|
@ -195,11 +185,11 @@ describe('Application life cycle test', function () {
|
|||
it('can complete setup', completeSetup);
|
||||
it('can upload video', uploadVideo);
|
||||
it('video exists', videoExists);
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('can close account setup dialog', closeAccountSetupDialog);
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('backup app', function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
|
||||
|
||||
|
@ -213,20 +203,20 @@ describe('Application life cycle test', function () {
|
|||
|
||||
it('can root login', login.bind(null, 'root', 'changeme'));
|
||||
it('video exists', videoExists);
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('can restart app', function () {
|
||||
execSync('cloudron restart --app ' + app.id);
|
||||
});
|
||||
it('can root login', login.bind(null, 'root', 'changeme'));
|
||||
it('video exists', videoExists);
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
// this is not supported for federation
|
||||
it('move to different location', function () { execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, EXEC_ARGS); });
|
||||
|
@ -234,10 +224,10 @@ describe('Application life cycle test', function () {
|
|||
it('can get app information', getAppInfo);
|
||||
it('can root login', login.bind(null, 'root', 'changeme'));
|
||||
it('video exists', videoExists);
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('uninstall app', async function () {
|
||||
await browser.executeScript('localStorage.clear();');
|
||||
|
@ -254,7 +244,7 @@ describe('Application life cycle test', function () {
|
|||
|
||||
it('can login (no sso)', login.bind(null, 'root', 'changeme'));
|
||||
it('can complete setup', completeSetup);
|
||||
it('can logout', logout);
|
||||
it('can logout', clearCache);
|
||||
|
||||
it('uninstall app (no sso)', async function () {
|
||||
await browser.executeScript('localStorage.clear();');
|
||||
|
@ -272,15 +262,16 @@ describe('Application life cycle test', function () {
|
|||
it('can complete setup', completeSetup);
|
||||
it('can upload video', uploadVideo);
|
||||
it('video exists', videoExists);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('can update', function () { execSync('cloudron update --app ' + app.id, EXEC_ARGS); });
|
||||
it('can root login', login.bind(null, 'root', 'changeme'));
|
||||
it('video exists', videoExists);
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('can OIDC login', loginOIDC.bind(null, username, password));
|
||||
it('can close account setup dialog', closeAccountSetupDialog);
|
||||
it('logout', logout);
|
||||
it('logout', clearCache);
|
||||
|
||||
it('uninstall app', async function () {
|
||||
await browser.executeScript('localStorage.clear();');
|
||||
|
|
Loading…
Reference in a new issue