1
0
mirror of https://git.cloudron.io/cloudron/minio-app synced 2025-09-16 02:09:14 +00:00

add delays everywhere

doing things fast in the ui breaks now
This commit is contained in:
Girish Ramakrishnan
2022-06-06 21:25:15 -07:00
parent 4b3b4b9d4d
commit 542b8a4412
3 changed files with 32 additions and 5 deletions

View File

@@ -11,7 +11,8 @@
require('chromedriver');
const execSync = require('child_process').execSync,
const delay = require('delay'),
execSync = require('child_process').execSync,
expect = require('expect.js'),
fs = require('fs'),
path = require('path'),
@@ -55,6 +56,7 @@ describe('Application life cycle test', function () {
await browser.findElement(By.id('secretKey')).sendKeys(secretKey);
await browser.findElement(By.xpath('//button[contains(text(), "Login")]')).click();
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
await delay(5000);
}
async function logout() {
@@ -72,6 +74,7 @@ describe('Application life cycle test', function () {
await browser.findElement(By.xpath('//input[@id="bucket-name"]')).sendKeys(BUCKET);
await browser.findElement(By.xpath('//button[text()="Create Bucket"]')).click();
await waitForElement(By.xpath(`//a[contains(text(), "${BUCKET}")]`));
await delay(5000);
}
async function checkBucket() {
@@ -92,7 +95,10 @@ describe('Application life cycle test', function () {
}
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
it('install app', function () { execSync(`cloudron install --location ${LOCATION} --secondary-domains API_SERVER_DOMAIN=${LOCATION}-api`, EXEC_ARGS); });
it('install app', async function () {
execSync(`cloudron install --location ${LOCATION} --secondary-domains API_SERVER_DOMAIN=${LOCATION}-api`, EXEC_ARGS);
await delay(10000);
});
it('can get app information', getAppInfo);
@@ -102,7 +108,7 @@ describe('Application life cycle test', function () {
it('does redirect', checkRedirect);
it('check api', checkApi);
it('can change credentials', function () {
it('can change credentials', async function () {
let data = fs.readFileSync(path.join(__dirname, '../env.sh'), 'utf8');
data = data
.replace(/MINIO_ROOT_USER=.*/, 'MINIO_ROOT_USER=minioakey')
@@ -110,6 +116,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);
});
it('can restart app', function () { execSync(`cloudron restart --app ${app.id}`, EXEC_ARGS); });
@@ -121,12 +128,13 @@ describe('Application life cycle test', function () {
it('check api', checkApi);
it('backup app', function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
it('restore app', function () {
it('restore app', async function () {
const backups = JSON.parse(execSync(`cloudron backup list --raw --app ${app.id}`));
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
getAppInfo();
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
await delay(10000);
});
it('can login', login.bind(null, 'minioakey', 'minioskey'));
@@ -135,9 +143,10 @@ describe('Application life cycle test', function () {
it('does redirect', checkRedirect);
it('check api', checkApi);
it('move to different location', function () {
it('move to different location', async function () {
browser.manage().deleteAllCookies();
execSync('cloudron configure --location ' + LOCATION + '2', EXEC_ARGS);
await delay(10000);
});
it('can get app information', getAppInfo);