mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-14 07:02:30 +01:00
22 lines
653 B
JavaScript
22 lines
653 B
JavaScript
const webdriver = require('selenium-webdriver');
|
|
const path = require('path');
|
|
const until = webdriver.until;
|
|
|
|
const driver = new webdriver.Builder()
|
|
.forBrowser('firefox')
|
|
.build();
|
|
|
|
driver.get(path.join('file:///', __dirname, '/frontend.test.html'));
|
|
driver.wait(until.titleIs('Mocha Tests'), 10000);
|
|
driver.wait(until.titleMatches(/^[0-1]$/), 10000);
|
|
|
|
driver.getTitle().then(title => {
|
|
driver.quit().then(() => {
|
|
if (title === '0') {
|
|
console.log('Frontend tests have passed.');
|
|
} else {
|
|
throw new Error('Frontend tests are failing. ' +
|
|
'Please open the frontend.test.html file in a browser.');
|
|
}
|
|
})
|
|
}) |