1
0
mirror of https://git.cloudron.io/cloudron/syncthing-app synced 2025-09-21 04:17:33 +00:00

Fix tests

This commit is contained in:
Girish Ramakrishnan
2024-03-04 12:05:45 +01:00
parent aa4cdb2de9
commit ba33f68bc8
3 changed files with 610 additions and 82 deletions

View File

@@ -67,6 +67,17 @@ describe('Application life cycle test', function () {
await waitForElement(By.xpath('//span[text()="Actions"]'));
}
async function logout() {
await browser.get('https://' + app.fqdn);
await waitForElement(By.xpath('//span[text()="Actions"]'));
await browser.findElement(By.xpath('//span[text()="Actions"]')).click();
await browser.sleep(4000);
await waitForElement(By.xpath('//span[text()="Log Out"]'));
await browser.findElement(By.xpath('//span[text()="Log Out"]')).click();
await browser.sleep(4000);
await waitForElement(By.id('user'));
}
async function loadPage() {
await browser.get('https://' + app.fqdn);
await waitForElement(By.xpath('//span[text()="Actions"]'));
@@ -114,6 +125,7 @@ describe('Application life cycle test', function () {
it('can login', login.bind(null, username, password));
it('can load page', loadPage);
it('can add folder', addFolder);
it('can logout', logout);
it('backup app', async function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
it('restore app', async function () {
@@ -125,6 +137,7 @@ describe('Application life cycle test', function () {
it('can login', login.bind(null, username, password));
it('can load page', loadPage);
it('can check folder', checkFolder);
it('can logout', logout);
it('move to different location', async function () {
await browser.get('about:blank');
@@ -136,6 +149,7 @@ describe('Application life cycle test', function () {
it('can login', login.bind(null, username, password));
it('can load page', loadPage);
it('can check folder', checkFolder);
it('can logout', logout);
it('uninstall app', async function () {
await browser.get('about:blank');
@@ -151,6 +165,8 @@ describe('Application life cycle test', function () {
it('can login', login.bind(null, username, password));
it('can load page', loadPage);
it('can add folder', addFolder);
it('can logout', logout);
it('can update', async function () {
await browser.get('about:blank');
execSync('cloudron update --app ' + LOCATION, EXEC_ARGS);