Skip to content

Commit

Permalink
messed up on rebase, restoring this file to upstream/main
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarf committed Sep 13, 2023
1 parent d4b638b commit 4b2e240
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/agent/web-driver.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Builder } from 'selenium-webdriver';

export async function createWebDriver({ url, abortSignal }) {
const driver = await new Builder().forBrowser('chrome').usingServer(url.toString()).build();
/**
* @param {object} options
* @param {{toString: function(): string}} options.url
* @param {AriaATCIAgent.Browser} [options.browser]
* @param {Promise<void>} options.abortSignal
*/
export async function createWebDriver({ url, browser = 'firefox', abortSignal }) {
const driver = await new Builder().forBrowser(browser).usingServer(url.toString()).build();
abortSignal.then(() => driver.quit());
return driver;
}

0 comments on commit 4b2e240

Please sign in to comment.