Skip to content

Commit

Permalink
type: Add driver property to NightwatchAPI. (#4279)
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 authored Oct 24, 2024
1 parent 1e37c94 commit 2fbeae3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
Actions,
Capabilities,
WebElement,
WebDriver,
RelativeBy,
locateWith as seleniumLocateWith
} from 'selenium-webdriver';
Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 4 additions & 0 deletions types/tests/describe.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ExtendDescribeThis } from '..';
import {FileDetector} from 'selenium-webdriver/remote';

describe('Ecosia', () => {
before((browser) => browser.url('https://www.ecosia.org/'));
Expand All @@ -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')
Expand Down

0 comments on commit 2fbeae3

Please sign in to comment.