reimplemented l10n using dynamic import() (#1012)

this should greatly reduce the complexity of the l10n code
and build pipeline and eliminate the most common error
seen in sentry logs (no translate function)
This commit is contained in:
Danny Coates 2018-11-20 06:50:59 -08:00 committed by Donovan Preston
parent 5afa4e5c9b
commit 1e62aa976d
28 changed files with 145 additions and 280 deletions

View file

@ -14,6 +14,7 @@ class DownloadPage extends Page {
* @throws ElementNotFound
*/
waitForPageToLoad() {
super.waitForPageToLoad();
browser.waitForExist(this.downloadButton);
return this;
}

View file

@ -12,6 +12,7 @@ class HomePage extends Page {
}
waitForPageToLoad() {
super.waitForPageToLoad();
browser.waitForExist(this.uploadInput);
this.showUploadInput();
return this;

View file

@ -1,4 +1,4 @@
/* global browser */
/* global browser window */
class Page {
constructor(path) {
this.path = path;
@ -15,6 +15,12 @@ class Page {
* @throws ElementNotFound
*/
waitForPageToLoad() {
browser.waitUntil(function() {
return browser.execute(function() {
return typeof window.appState !== 'undefined';
});
}, 3000);
browser.pause(100);
return this;
}
}

View file

@ -14,4 +14,10 @@ You can also run them in headless Chrome by using `npm run test:frontend`. The r
Unit tests reside in `test/backend`
Backend test can be run with `npm run test:backend`. [Sinon](http://sinonjs.org/) and [proxyquire](https://github.com/thlorenz/proxyquire) are used for mocking.
Backend test can be run with `npm run test:backend`. [Sinon](http://sinonjs.org/) and [proxyquire](https://github.com/thlorenz/proxyquire) are used for mocking.
## Integration
Integration tests include UI tests that run with Selenium.
The preferred way to run these locally is with `npm run test-integration` which requires docker. To watch the tests connect with VNC. On mac enter `vnc://localhost:5900` in Safari and use the password `secret` to connect. For info on debugging a test see the [wdio debug docs](http://webdriver.io/api/utility/debug.html).

View file

@ -8,7 +8,6 @@ module.exports = {
const express = require('express');
const expressWs = require('express-ws');
const assets = require('../common/assets');
const locales = require('../common/locales');
const routes = require('../server/routes');
const tests = require('./frontend/routes');
const app = express();
@ -18,7 +17,6 @@ module.exports = {
});
app.use(wpm);
assets.setMiddleware(wpm);
locales.setMiddleware(wpm);
expressWs(app, null, { perMessageDeflate: false });
app.ws('/api/ws', require('../server/routes/ws'));
routes(app);

View file

@ -17,10 +17,10 @@ exports.config = Object.assign({}, common.config, {
maxInstances: 1,
services: ['docker', require('./testServer')],
dockerOptions: {
image: 'selenium/standalone-firefox',
image: 'selenium/standalone-firefox-debug',
healthCheck: 'http://localhost:4444',
options: {
p: ['4444:4444'],
p: ['4444:4444', '5900:5900'],
mount: `type=bind,source=${dir},destination=${dir},consistency=delegated`,
shmSize: '2g'
}