Ver código fonte

Put version in description

Girish Ramakrishnan 8 anos atrás
pai
commit
bbda7e339a
2 arquivos alterados com 27 adições e 9 exclusões
  1. 4 2
      DESCRIPTION.md
  2. 23 7
      test/test.js

+ 4 - 2
DESCRIPTION.md

@@ -1,13 +1,15 @@
+This app contains NodeBB Version 1.1.0
+
 ### Accounts
 
-This app is meant to be used as a public forum. Use the following credentials for initial
+This NodeBB app is meant to be used as a public forum. Use the following credentials for initial
 setup:
 
 `username`: admin
 
 `password`: changeme
 
-**Please change the admin password on first login**
+**Please change the admin password and email on first login**
 
 ### Overview
 

+ 23 - 7
test/test.js

@@ -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 () {