diff --git a/.gitignore b/.gitignore index 213da1a26..163660a2e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ /rainloop/v/0.0.0/static/* /rainloop/v/0.0.0/app/localization/moment/* !/rainloop/v/0.0.0/app/localization/moment/.gitempty +/e2e/configuration.js +/e2e/output/* +!/e2e/output/.gitempty /vendors/.* /node_modules /build/local diff --git a/e2e/codecept.conf.js b/e2e/codecept.conf.js new file mode 100644 index 000000000..266095402 --- /dev/null +++ b/e2e/codecept.conf.js @@ -0,0 +1,18 @@ + +var cfg = require('./configuration'); + +exports.config = { + "tests": "./tests/*_test.js", + "timeout": 10000, + "output": "./output", + "helpers": { + "WebDriverIO": { + "url": cfg.url, + "browser": "phantomjs" + } + }, + "include": {}, + "bootstrap": false, + "mocha": {}, + "name": "RainLoop e2e tests" +}; diff --git a/e2e/configuration.js.dist b/e2e/configuration.js.dist new file mode 100644 index 000000000..a03be1e67 --- /dev/null +++ b/e2e/configuration.js.dist @@ -0,0 +1,6 @@ + +module.exports = { + url: 'http://rainloop.domain.com/', + user: 'user"domain.com', + pass: '12345' +}; diff --git a/e2e/output/.gitempty b/e2e/output/.gitempty new file mode 100644 index 000000000..e69de29bb diff --git a/e2e/tests/login_test.js b/e2e/tests/login_test.js new file mode 100644 index 000000000..7fc9a743e --- /dev/null +++ b/e2e/tests/login_test.js @@ -0,0 +1,38 @@ + +Feature('login'); + +Before(function(I) { + I.amOnPage('/'); + I.resizeWindow(1000, 1000); + I.waitForElement('.e-powered', 10); +}); + +Scenario('login/page', function(I) { + I.see('Powered by RainLoop', '.e-powered'); + I.see('Remember Me'); +}); + +Scenario('login/empty-fields-error', function(I) { + I.fillField('.inputEmail', ''); + I.fillField('.inputPassword', ''); + I.click('.buttonLogin'); + I.see('Remember Me'); + I.seeElement('.controls.error'); +}); + +Scenario('login/auth-error', function(I) { + I.fillField('.inputEmail', 'xxx'); + I.fillField('.inputPassword', 'yyy'); + I.click('.buttonLogin'); + I.waitForVisible('.alertError', 3); + I.see('Authentication failed', '.alertError'); +}); + +Scenario('login/language-popup', function(I) { + I.click('.flag-name'); + I.wait(1); + I.see('Choose your language', '.b-languages-content'); + I.click('.close', '.b-languages-content'); + I.wait(1); + I.dontSee('Choose your language'); +}); diff --git a/e2e/tests/main_test.js b/e2e/tests/main_test.js new file mode 100644 index 000000000..369f685c0 --- /dev/null +++ b/e2e/tests/main_test.js @@ -0,0 +1,25 @@ + +var cfg = require('../configuration'); + +Feature('mailbox'); + +Before((I) => { + I.amOnPage('/'); + I.resizeWindow(1000, 1000); + I.waitForElement('.e-powered', 10); + I.fillField('.inputEmail', cfg.user); + I.fillField('.inputPassword', cfg.pass); + I.click('.buttonLogin'); + I.waitForText('test@rainloop.de', 10, '.accountPlace'); + I.resizeWindow(1000, 1000); +}); + +Scenario('mailbox/main', (I) => { + I.see('Select message in list to view it here.'); + I.see('Inbox', '.b-folders-system'); + + I.click('#top-system-dropdown-id'); + I.see('Logout', '.RL-SystemDropDown'); + I.click('Logout', '.RL-SystemDropDown'); + I.waitForText('Powered by RainLoop', 10, '.e-powered'); +});