mailtrain/test/e2e/index.js
Tomas Bures bb2b3da9dd Added waitUntilVisibleAfterRefresh and textsToWaitFor - both discussed with @witzig.
Page objects refactored to exploit textsToWaitFor if relevant.

Login tests refactored for the newer API.

Some additional tests in subscription. The rest at least included as "pending".
2017-05-26 00:13:40 +02:00

30 lines
768 B
JavaScript

'use strict';
require('./lib/exit-unless-test');
const { mocha, driver } = require('./lib/mocha-e2e');
const path = require('path');
global.USE_SHARED_DRIVER = true;
const only = 'only';
const skip = 'skip';
let tests = [
'login',
'subscription'
];
tests = tests.map(testSpec => (testSpec.constructor === Array ? testSpec : [testSpec]));
tests = tests.filter(testSpec => testSpec[1] !== skip);
if (tests.some(testSpec => testSpec[1] === only)) {
tests = tests.filter(testSpec => testSpec[1] === only);
}
for (const testSpec of tests) {
const testPath = path.join(__dirname, 'tests', testSpec[0] + '.js');
mocha.addFile(testPath);
}
mocha.run(failures => {
process.exit(failures); // exit with non-zero status if there were failures
});