|
@@ -67,16 +67,30 @@ describe('Application life cycle test', function () {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // function restartForum()
|
|
|
+ function restartForum(done) {
|
|
|
+ browser.get('https://' + app.fqdn + '/admin').then(function () {
|
|
|
+ return browser.findElement(by.xpath('//button[text()="Restart"]')).click();
|
|
|
+ }).then(function () {
|
|
|
+ return browser.sleep(10000); // wait 10secs for reload
|
|
|
+ }).then(function () {
|
|
|
+ browser.get('https://' + app.fqdn + '/admin');
|
|
|
+ return browser.findElement(by.xpath('//h1[text()="Dashboard"]'))
|
|
|
+ }).then(function () { done(); });
|
|
|
+ }
|
|
|
+
|
|
|
function installCustomPlugin(done) {
|
|
|
execSync('cloudron exec -- /usr/local/bin/gosu cloudron:cloudron npm install nodebb-plugin-beep', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
|
+ done();
|
|
|
+ }
|
|
|
|
|
|
+ function activateCustomPlugin(done) {
|
|
|
browser.get('https://' + app.fqdn + '/admin/extend/plugins#installed');
|
|
|
browser.wait(until.elementLocated(by.xpath('//ul[contains(@class, "installed")]//strong[text()="nodebb-plugin-beep"]')), TEST_TIMEOUT).then(function () {
|
|
|
- browser.sleep(10000).then(function () {
|
|
|
- browser.findElement(by.xpath('//li[@id="nodebb-plugin-beep"]//button[@data-action="toggleActive"]')).click(); // activate the plugin
|
|
|
- browser.sleep(3000).then(function() { done(); }); // wait for the action to succeed
|
|
|
- });
|
|
|
+ return browser.sleep(10000);
|
|
|
+ }).then(function () {
|
|
|
+ return browser.findElement(by.xpath('//li[@id="nodebb-plugin-beep"]//button[@data-action="toggleActive"]')).click(); // activate the plugin
|
|
|
+ }).then(function () {
|
|
|
+ browser.sleep(10000).then(function() { done(); }); // wait for the action to succeed
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -93,7 +107,7 @@ describe('Application life cycle test', function () {
|
|
|
execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
|
});
|
|
|
|
|
|
- it('install app', function () {
|
|
|
+ xit('install app', function () {
|
|
|
execSync('cloudron install --new --wait --location ' + LOCATION, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
|
|
|
});
|
|
|
|
|
@@ -107,7 +121,9 @@ describe('Application life cycle test', function () {
|
|
|
|
|
|
it('can login', login);
|
|
|
it('check mail plugin', checkMailPlugin);
|
|
|
- it('can install custom plugin', installCustomPlugin);
|
|
|
+ xit('can install custom plugin', installCustomPlugin);
|
|
|
+ it('can restart forum', restartForum); // required before activate!
|
|
|
+ it('can activate custom plugin', activateCustomPlugin);
|
|
|
it('can list custom plugin', listCustomPlugin);
|
|
|
|
|
|
it('backup app', function () {
|