diff --git a/types/index.d.ts b/types/index.d.ts index 10ba3f0f0..2d7254ec5 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -23,6 +23,7 @@ import { Actions, Capabilities, WebElement, + WebDriver, RelativeBy, locateWith as seleniumLocateWith } from 'selenium-webdriver'; @@ -560,6 +561,11 @@ export interface NightwatchAPI globals: NightwatchGlobals; + /** + * https://www.selenium.dev/selenium/docs/api/javascript/WebDriver.html + */ + driver: WebDriver; + launchUrl: string; launch_url: string; } diff --git a/types/tests/describe.test-d.ts b/types/tests/describe.test-d.ts index d8423d82f..21eb0236b 100644 --- a/types/tests/describe.test-d.ts +++ b/types/tests/describe.test-d.ts @@ -1,4 +1,5 @@ import { ExtendDescribeThis } from '..'; +import {FileDetector} from 'selenium-webdriver/remote'; describe('Ecosia', () => { before((browser) => browser.url('https://www.ecosia.org/')); @@ -12,6 +13,9 @@ describe('Ecosia', () => { upload_throughput: 500 * 1024, // Maximal aggregated upload throughput. }); + // https://www.selenium.dev/selenium/docs/api/javascript/WebDriver.html#setFileDetector + browser.driver.setFileDetector(new FileDetector()); + browser .waitForElementVisible('body') .assert.titleContains('Ecosia')