22 lines
592 B
JavaScript
22 lines
592 B
JavaScript
const { Builder } = require('selenium-webdriver');
|
|
const chrome = require('selenium-webdriver/chrome');
|
|
const chromeOptions = new chrome.Options();
|
|
|
|
let driver;
|
|
|
|
chromeOptions.addArguments('--headless', '--disable-gpu', '--no-sandbox');
|
|
|
|
beforeEach(async () => {
|
|
const builder = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions);
|
|
driver = builder.build();
|
|
});
|
|
|
|
it('loads the page', async () => {
|
|
await driver.get('http://localhost:8080');
|
|
expect(await driver.getTitle()).toEqual('SVG Element Pan & Zoom Demo');
|
|
});
|
|
|
|
afterEach(async () => {
|
|
await driver.quit();
|
|
});
|