Web Dev Solutions

Catalin Mititiuc

const { Builder } = require('selenium-webdriver'), chrome = require('selenium-webdriver/chrome.js'), chromeOptions = new chrome.Options(), { expect, it } = require('@jest/globals'); chromeOptions.addArguments('--headless', '--disable-gpu', '--no-sandbox'); chromeOptions.enableBidi(); let driver; beforeEach(async () => { driver = new Builder().forBrowser('chrome').setChromeOptions(chromeOptions).build(); }); it('loads the page', async () => { await driver.get('http://localhost:3005'); expect(await driver.getTitle()).toEqual('Infantry Combat Solo Basic'); }); afterEach(async () => { await driver.quit(); });