1
0
mirror of https://git.cloudron.io/cloudron/minio-app synced 2025-09-23 13:37:37 +00:00

Update tests

This commit is contained in:
Girish Ramakrishnan
2023-06-03 10:26:21 +02:00
parent f9c0870c59
commit ed8e041180
3 changed files with 24 additions and 42 deletions

View File

@@ -11,12 +11,12 @@
require('chromedriver');
const delay = require('delay'),
execSync = require('child_process').execSync,
const execSync = require('child_process').execSync,
expect = require('expect.js'),
fs = require('fs'),
path = require('path'),
superagent = require('superagent'),
timers = require('timers/promises'),
{ Builder, By, until } = require('selenium-webdriver'),
{ Options } = require('selenium-webdriver/chrome');
@@ -56,7 +56,7 @@ describe('Application life cycle test', function () {
await browser.findElement(By.id('secretKey')).sendKeys(secretKey);
await browser.findElement(By.xpath('//button[@id="do-login"]')).click();
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
await delay(5000);
await timers.setTimeout(5000);
}
async function logout() {
@@ -76,7 +76,7 @@ describe('Application life cycle test', function () {
await browser.findElement(By.xpath('//input[@id="bucket-name"]')).sendKeys(BUCKET);
await browser.findElement(By.xpath('//button[@id="create-bucket"]')).click();
await waitForElement(By.xpath(`//h1[contains(text(), "${BUCKET}")]`));
await delay(5000);
await timers.setTimeout(5000);
}
async function checkBucket() {
@@ -99,7 +99,7 @@ describe('Application life cycle test', function () {
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
it('install app', async function () {
execSync(`cloudron install --location ${LOCATION} --secondary-domains API_SERVER_DOMAIN=${LOCATION}-api`, EXEC_ARGS);
await delay(10000);
await timers.setTimeout(10000);
});
it('can get app information', getAppInfo);
@@ -118,7 +118,7 @@ describe('Application life cycle test', function () {
fs.writeFileSync('/tmp/env.sh', data);
execSync(`cloudron push --app ${app.id} /tmp/env.sh /app/data/env.sh`, EXEC_ARGS);
execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS);
await delay(10000);
await timers.setTimeout(10000);
});
it('can restart app', function () { execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS); });
@@ -136,7 +136,7 @@ describe('Application life cycle test', function () {
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
getAppInfo();
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
await delay(10000);
await timers.setTimeout(10000);
});
it('can login', login.bind(null, 'minioakey', 'minioskey'));
@@ -148,7 +148,7 @@ describe('Application life cycle test', function () {
it('move to different location', async function () {
browser.manage().deleteAllCookies();
execSync('cloudron configure --location ' + LOCATION + '2', EXEC_ARGS);
await delay(10000);
await timers.setTimeout(10000);
});
it('can get app information', getAppInfo);