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

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>