testing circle install firefox

This commit is contained in:
Abhinav Adduri 2017-07-17 09:39:51 -07:00
parent e9c49073a8
commit e5f2b386bb
5 changed files with 56 additions and 10 deletions

View file

@ -5,6 +5,11 @@ machine:
- docker
- redis
dependencies:
pre:
- npm i -g get-firefox
- get-firefox --platform linux --extract --target /home/ubuntu/send
deployment:
latest:
branch: master

27
package-lock.json generated
View file

@ -28,6 +28,11 @@
}
}
},
"adm-zip": {
"version": "0.4.7",
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.7.tgz",
"integrity": "sha1-hgbCy/HEJs6MjsABdER/1Jtur8E="
},
"ajv": {
"version": "4.11.8",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz",
@ -1376,8 +1381,7 @@
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
},
"fsevents": {
"version": "1.1.2",
@ -3189,8 +3193,7 @@
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
},
"outpipe": {
"version": "1.1.1",
@ -3777,13 +3780,11 @@
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
"integrity": "sha1-wjOOxkPfeht/5cVPqG9XQopV8z0=",
"dev": true,
"dependencies": {
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ=="
}
}
},
@ -3833,6 +3834,18 @@
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz",
"integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o="
},
"selenium-webdriver": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.4.0.tgz",
"integrity": "sha1-FR90RSlNpqZsScwwB0eioX5TxSo=",
"dependencies": {
"tmp": {
"version": "0.0.30",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz",
"integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0="
}
}
},
"semver": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",

View file

@ -18,6 +18,7 @@
"raven": "^2.1.0",
"raven-js": "^3.16.0",
"redis": "^2.7.1",
"selenium-webdriver": "^3.4.0",
"supertest": "^3.0.0",
"uglify-es": "3.0.19"
},
@ -51,8 +52,8 @@
"lint:css": "stylelint 'public/*.css'",
"lint:js": "eslint .",
"start": "node server/server",
"test": "mocha test/unit && mocha test/server",
"test-browser": "watchify test/frontend/frontend.bundle.js -o test/frontend/bundle.js -d",
"test": "mocha test/unit && mocha test/server && npm run test-browser && node test/frontend/driver.js",
"test-browser": "browserify test/frontend/frontend.bundle.js -o test/frontend/bundle.js -d",
"version": "node scripts/version"
}
}

22
test/frontend/driver.js Normal file
View file

@ -0,0 +1,22 @@
var webdriver = require('selenium-webdriver'),
By = webdriver.By,
until = webdriver.until;
var driver = new webdriver.Builder()
.forBrowser('firefox')
.build();
driver.get('file:///' + __dirname + '/frontend.test.html');
driver.wait(until.titleIs('Mocha Tests'), 1000);
driver.wait(until.titleMatches(/^[0-1]$/), 10000);
driver.getTitle().then(title => {
driver.quit().then(() => {
if (title === "0") {
process.exit(0);
} else {
throw new Error(`Frontend tests are failing. ` +
`Please open the frontend.test.html file in a browser.`);
}
})
})

View file

@ -16,7 +16,12 @@
<script>
mocha.checkLeaks();
mocha.globals(['jQuery']);
mocha.run();
mocha.run(function(err) {
document.title = err;
});
</script>
<script>
</script>
</body>
</html>