add search test

This commit is contained in:
Girish Ramakrishnan 2020-03-04 12:40:48 -08:00
parent a04afb5411
commit f492615de7

View file

@ -48,6 +48,20 @@ describe('Application life cycle test', function () {
done(); done();
}); });
function search(done) {
browser.get(`https://${app.fqdn}`).then(function () {
return browser.wait(until.elementLocated(by.id('q')), 5000);
}).then(function () {
return browser.findElement(by.id('q')).sendKeys('cloudron');
}).then(function () {
return browser.findElement(by.id('q')).sendKeys(Key.RETURN);
}).then(function () {
return browser.wait(until.elementLocated(by.xpath('//span[text()="Cloudron"]')), 5000);
}).then(function () {
return done();
});
}
var LOCATION = 'test'; var LOCATION = 'test';
var TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 30000; var TEST_TIMEOUT = parseInt(process.env.TIMEOUT, 10) || 30000;
var app; var app;
@ -68,6 +82,8 @@ describe('Application life cycle test', function () {
expect(app).to.be.an('object'); expect(app).to.be.an('object');
}); });
it('can search', search);
it('backup app', function () { it('backup app', function () {
execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron backup create --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}); });
@ -76,11 +92,15 @@ describe('Application life cycle test', function () {
execSync('cloudron restore --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron restore --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}); });
it('can search', search);
it('can restart app', function (done) { it('can restart app', function (done) {
execSync('cloudron restart --app ' + app.id); execSync('cloudron restart --app ' + app.id);
done(); done();
}); });
it('can search', search);
it('move to different location', function (done) { it('move to different location', function (done) {
execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron configure --location ' + LOCATION + '2 --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
var inspect = JSON.parse(execSync('cloudron inspect')); var inspect = JSON.parse(execSync('cloudron inspect'));
@ -90,6 +110,8 @@ describe('Application life cycle test', function () {
done(); done();
}); });
it('can search', search);
it('uninstall app', function () { it('uninstall app', function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}); });
@ -108,6 +130,8 @@ describe('Application life cycle test', function () {
app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0]; app = inspect.apps.filter(function (a) { return a.location === LOCATION; })[0];
}); });
it('can search', search);
it('uninstall app', function () { it('uninstall app', function () {
execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' }); execSync('cloudron uninstall --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
}); });