Quellcode durchsuchen

add test to send email

Girish Ramakrishnan vor 7 Jahren
Ursprung
Commit
7db27ed057
1 geänderte Dateien mit 18 neuen und 0 gelöschten Zeilen
  1. 18 0
      test/test.js

+ 18 - 0
test/test.js

@@ -193,6 +193,21 @@ describe('Application life cycle test', function () {
         });
     }
 
+    function sendMail(done) {
+        browser.get('https://' + app.fqdn + '/admin/config').then(function () {
+            var button = browser.findElement(by.xpath('//button[@id="test-mail-btn"]'));
+            return browser.executeScript('arguments[0].scrollIntoView(true)', button);
+        }).then(function () {
+            return browser.findElement(by.xpath('//input[@name="email"]')).sendKeys('test@cloudron.io');
+        }).then(function () {
+            return browser.findElement(by.xpath('//button[@id="test-mail-btn"]')).click();
+        }).then(function () {
+            return browser.wait(until.elementLocated(by.xpath('//p[contains(text(),"Test email has been sent to \'test@cloudron.io\'")]')), TIMEOUT);
+        }).then(function () {
+            done();
+        });
+    }
+
     xit('build app', function () {
         execSync('cloudron build', { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
     });
@@ -203,6 +218,7 @@ describe('Application life cycle test', function () {
 
     it('can get app information', getAppInfo);
     it('can login', login);
+    it('can send mail', sendMail);
     it('can set avatar', setAvatar);
     it('can get avatar', checkAvatar);
     it('can add public key', addPublicKey);
@@ -289,6 +305,8 @@ describe('Application life cycle test', function () {
         execSync('cloudron install --wait --app ' + app.id, { cwd: path.resolve(__dirname, '..'), stdio: 'inherit' });
     });
 
+    it('can login', login);
+    it('can send mail', sendMail);
     it('can get avatar', checkAvatar);
     it('can clone the url', cloneRepo);
     it('file exists in cloned repo', fileExists);