Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 3f861ae

Browse files
monkpitheathkit
authored andcommitted
By.js locator should accept functions
The Protractor documentation says that By.js is inherited from Selenium Webdriver, and the types for that define the function signature for `js` like I have done in this PR. https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/selenium-webdriver/index.d.ts#L2441
1 parent 88a1b3a commit 3f861ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/locators.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class WebdriverBy {
1010
css: (css: string) => By = By.css;
1111
id: (id: string) => By = By.id;
1212
linkText: (linkText: string) => By = By.linkText;
13-
js: (js: string) => By = By.js;
13+
js: (js: string | Function, ...var_args: any[]) => By = By.js;
1414
name: (name: string) => By = By.name;
1515
partialLinkText: (partialText: string) => By = By.partialLinkText;
1616
tagName: (tagName: string) => By = By.tagName;

0 commit comments

Comments
 (0)