|
@@ -53,6 +53,14 @@ describe('Application life cycle test', function () {
|
|
done();
|
|
done();
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ function login(done) {
|
|
|
|
+ browser.get('https://' + app.fqdn + '/wp-login.php');
|
|
|
|
+ browser.findElement(by.id('user_login')).sendKeys(username);
|
|
|
|
+ browser.findElement(by.id('user_pass')).sendKeys(password);
|
|
|
|
+ browser.findElement(by.tagName('form')).submit();
|
|
|
|
+ browser.wait(until.elementLocated(by.xpath('//h1[text()="Dashboard"]')), 4000).then(function () { done(); });
|
|
|
|
+ }
|
|
|
|
+
|
|
xit('build app', function () {
|
|
xit('build app', function () {
|
|
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
});
|
|
});
|
|
@@ -101,13 +109,7 @@ describe('Application life cycle test', function () {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
- it('can login', function (done) {
|
|
|
|
- browser.get('https://' + app.fqdn + '/wp-login.php');
|
|
|
|
- browser.findElement(by.id('user_login')).sendKeys(username);
|
|
|
|
- browser.findElement(by.id('user_pass')).sendKeys(password);
|
|
|
|
- browser.findElement(by.tagName('form')).submit();
|
|
|
|
- browser.wait(until.elementLocated(by.xpath('//h1[text()="Dashboard"]')), 4000).then(function () { done(); });
|
|
|
|
- });
|
|
|
|
|
|
+ it('can login', login);
|
|
|
|
|
|
it('is an admin dashboard', function (done) {
|
|
it('is an admin dashboard', function (done) {
|
|
browser.wait(until.elementLocated(by.xpath('//div[@class="wp-menu-name" and contains(text(), "Plugins")]')), 4000).then(function () { done(); });
|
|
browser.wait(until.elementLocated(by.xpath('//div[@class="wp-menu-name" and contains(text(), "Plugins")]')), 4000).then(function () { done(); });
|
|
@@ -186,13 +188,7 @@ describe('Application life cycle test', function () {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
- it('can login', function (done) {
|
|
|
|
- browser.get('https://' + app.fqdn + '/wp-login.php');
|
|
|
|
- browser.findElement(by.id('user_login')).sendKeys(username);
|
|
|
|
- browser.findElement(by.id('user_pass')).sendKeys(password);
|
|
|
|
- browser.findElement(by.tagName('form')).submit();
|
|
|
|
- browser.wait(until.elementLocated(by.xpath('//h1[text()="Dashboard"]')), 4000).then(function () { done(); });
|
|
|
|
- });
|
|
|
|
|
|
+ it('can login', login);
|
|
|
|
|
|
it('move to different location', function () {
|
|
it('move to different location', function () {
|
|
browser.manage().deleteAllCookies();
|
|
browser.manage().deleteAllCookies();
|
|
@@ -216,13 +212,7 @@ describe('Application life cycle test', function () {
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
- it('can login', function (done) {
|
|
|
|
- browser.get('https://' + app.fqdn + '/wp-login.php');
|
|
|
|
- browser.findElement(by.id('user_login')).sendKeys(username);
|
|
|
|
- browser.findElement(by.id('user_pass')).sendKeys(password);
|
|
|
|
- browser.findElement(by.tagName('form')).submit();
|
|
|
|
- browser.wait(until.elementLocated(by.xpath('//h1[text()="Dashboard"]')), 4000).then(function () { done(); });
|
|
|
|
- });
|
|
|
|
|
|
+ it('can login', login);
|
|
|
|
|
|
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' });
|
|
@@ -236,11 +226,7 @@ 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];
|
|
expect(app).to.be.an('object');
|
|
expect(app).to.be.an('object');
|
|
|
|
|
|
- browser.get('https://' + app.fqdn + '/wp-login.php');
|
|
|
|
- browser.findElement(by.id('user_login')).sendKeys(username);
|
|
|
|
- browser.findElement(by.id('user_pass')).sendKeys(password);
|
|
|
|
- browser.findElement(by.tagName('form')).submit();
|
|
|
|
- browser.wait(until.elementLocated(by.xpath('//h1[text()="Dashboard"]')), 4000).then(function () {
|
|
|
|
|
|
+ login(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' });
|
|
done();
|
|
done();
|
|
});
|
|
});
|