Improve scripts load system

This commit is contained in:
RainLoop Team 2016-05-20 03:04:15 +03:00
parent 58b9eed8e8
commit 72bf212f67
39 changed files with 916 additions and 411 deletions

View file

@ -1,6 +0,0 @@
module.exports = {
url: 'https://mail.rainloop.net/',
testLogin: 'demo@rainloop.test',
testPassword: '12345'
};

1
tests/bootstrap.php Normal file
View file

@ -0,0 +1 @@
<?php

View file

@ -1,70 +0,0 @@
var cfg = require('./_config.js');
casper.start(cfg.url);
casper.then(function() {
this.echo('testing: ' + cfg.url);
}).wait(100);
casper.then(function() {
casper.test.begin('Login page should contains "Sign In" button', 1, function (test) {
casper.then(function() {
test.assertExists('button.buttonLogin');
});
casper.then(function() {
test.done();
});
});
casper.test.begin('Login page should allow langs selection', 3, function (test) {
casper.then(function() {
test.assertExists('.e-languages .flag-selector .flag-name');
});
casper.then(function() {
this.click('.e-languages .flag-selector .flag-name');
}).wait(300);
casper.then(function() {
test.assertExists('.b-languages-content');
});
casper.then(function() {
this.click('.b-languages-content .lang-item .flag.flag-ru_ru');
}).wait(1000);
casper.then(function() {
test.assertEquals('Войти', this.fetchText('button.buttonLogin'));
});
casper.then(function() {
test.done();
});
});
casper.test.begin('Login page submit', 1, function (test) {
casper.then(function() {
this.fill('form.loginForm', {
'RainLoopEmail': cfg.testLogin,
'RainLoopPassword': cfg.testPassword
}, true);
}).wait(3000);
casper.then(function() {
test.assertEquals(cfg.testLogin, this.fetchText('.accountPlace'));
});
casper.then(function() {
test.done();
});
});
});
casper.run();