add delays everywhere
doing things fast in the ui breaks now
This commit is contained in:
parent
4b3b4b9d4d
commit
542b8a4412
|
@ -10,6 +10,7 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^101.0.0",
|
"chromedriver": "^101.0.0",
|
||||||
|
"delay": "^5.0.0",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^10.0.0",
|
"mocha": "^10.0.0",
|
||||||
"selenium-webdriver": "^4.1.2",
|
"selenium-webdriver": "^4.1.2",
|
||||||
|
@ -461,6 +462,17 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/delay": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/delayed-stream": {
|
"node_modules/delayed-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
@ -2178,6 +2190,11 @@
|
||||||
"slash": "^3.0.0"
|
"slash": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"delay": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw=="
|
||||||
|
},
|
||||||
"delayed-stream": {
|
"delayed-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chromedriver": "^101.0.0",
|
"chromedriver": "^101.0.0",
|
||||||
|
"delay": "^5.0.0",
|
||||||
"expect.js": "^0.3.1",
|
"expect.js": "^0.3.1",
|
||||||
"mocha": "^10.0.0",
|
"mocha": "^10.0.0",
|
||||||
"selenium-webdriver": "^4.1.2",
|
"selenium-webdriver": "^4.1.2",
|
||||||
|
|
19
test/test.js
19
test/test.js
|
@ -11,7 +11,8 @@
|
||||||
|
|
||||||
require('chromedriver');
|
require('chromedriver');
|
||||||
|
|
||||||
const execSync = require('child_process').execSync,
|
const delay = require('delay'),
|
||||||
|
execSync = require('child_process').execSync,
|
||||||
expect = require('expect.js'),
|
expect = require('expect.js'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
path = require('path'),
|
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.id('secretKey')).sendKeys(secretKey);
|
||||||
await browser.findElement(By.xpath('//button[contains(text(), "Login")]')).click();
|
await browser.findElement(By.xpath('//button[contains(text(), "Login")]')).click();
|
||||||
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
|
await waitForElement(By.xpath('//span[contains(text(), "Buckets")]'));
|
||||||
|
await delay(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function logout() {
|
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('//input[@id="bucket-name"]')).sendKeys(BUCKET);
|
||||||
await browser.findElement(By.xpath('//button[text()="Create Bucket"]')).click();
|
await browser.findElement(By.xpath('//button[text()="Create Bucket"]')).click();
|
||||||
await waitForElement(By.xpath(`//a[contains(text(), "${BUCKET}")]`));
|
await waitForElement(By.xpath(`//a[contains(text(), "${BUCKET}")]`));
|
||||||
|
await delay(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function checkBucket() {
|
async function checkBucket() {
|
||||||
|
@ -92,7 +95,10 @@ describe('Application life cycle test', function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
xit('build app', function () { execSync('cloudron build', EXEC_ARGS); });
|
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);
|
it('can get app information', getAppInfo);
|
||||||
|
|
||||||
|
@ -102,7 +108,7 @@ describe('Application life cycle test', function () {
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
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');
|
let data = fs.readFileSync(path.join(__dirname, '../env.sh'), 'utf8');
|
||||||
data = data
|
data = data
|
||||||
.replace(/MINIO_ROOT_USER=.*/, 'MINIO_ROOT_USER=minioakey')
|
.replace(/MINIO_ROOT_USER=.*/, 'MINIO_ROOT_USER=minioakey')
|
||||||
|
@ -110,6 +116,7 @@ describe('Application life cycle test', function () {
|
||||||
fs.writeFileSync('/tmp/env.sh', data);
|
fs.writeFileSync('/tmp/env.sh', data);
|
||||||
execSync(`cloudron push --app ${app.id} /tmp/env.sh /app/data/env.sh`, EXEC_ARGS);
|
execSync(`cloudron push --app ${app.id} /tmp/env.sh /app/data/env.sh`, EXEC_ARGS);
|
||||||
execSync(`cloudron restart --app ${app.id}`, 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); });
|
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('check api', checkApi);
|
||||||
|
|
||||||
it('backup app', function () { execSync('cloudron backup create --app ' + app.id, EXEC_ARGS); });
|
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}`));
|
const backups = JSON.parse(execSync(`cloudron backup list --raw --app ${app.id}`));
|
||||||
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
execSync('cloudron uninstall --app ' + app.id, EXEC_ARGS);
|
||||||
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
|
execSync('cloudron install --location ' + LOCATION, EXEC_ARGS);
|
||||||
getAppInfo();
|
getAppInfo();
|
||||||
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
|
execSync(`cloudron restore --backup ${backups[0].id} --app ${app.id}`, EXEC_ARGS);
|
||||||
|
await delay(10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('can login', login.bind(null, 'minioakey', 'minioskey'));
|
it('can login', login.bind(null, 'minioakey', 'minioskey'));
|
||||||
|
@ -135,9 +143,10 @@ describe('Application life cycle test', function () {
|
||||||
it('does redirect', checkRedirect);
|
it('does redirect', checkRedirect);
|
||||||
it('check api', checkApi);
|
it('check api', checkApi);
|
||||||
|
|
||||||
it('move to different location', function () {
|
it('move to different location', async function () {
|
||||||
browser.manage().deleteAllCookies();
|
browser.manage().deleteAllCookies();
|
||||||
execSync('cloudron configure --location ' + LOCATION + '2', EXEC_ARGS);
|
execSync('cloudron configure --location ' + LOCATION + '2', EXEC_ARGS);
|
||||||
|
await delay(10000);
|
||||||
});
|
});
|
||||||
it('can get app information', getAppInfo);
|
it('can get app information', getAppInfo);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue