forked from nightwatchjs/nightwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed issue nightwatchjs#4057, added getAll and findElements aliases
- Loading branch information
Musa Ibrahim
committed
Mar 22, 2024
1 parent
93e4e39
commit 3cf33b6
Showing
11 changed files
with
7,969 additions
and
7,512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Search for elements on the page. The located elements will be returned as a special web element object (with added convenience methods). | ||
* The argument is the element selector, either specified as a string or as an object (with 'selector' and 'locateStrategy' properties). | ||
* Elements can be searched by using another element as the starting point. | ||
* | ||
* @example | ||
* export default { | ||
* async demoTest(browser: NightwatchAPI): Promise<void> { | ||
* const buttonsElement = browser.element.findElements('button.submit-form'); | ||
* | ||
* // Get an array of found elements. | ||
* const buttons = await buttonsElement; | ||
* | ||
* // Use an object to customise locating behaviour. | ||
* const sections = browser.element | ||
* .findElements({ selector: 'section', locateStrategy: 'css selector' }); | ||
* } | ||
* } | ||
* | ||
* @since 3.0.0 | ||
* @method findElements | ||
* @memberof ScopedWebElement | ||
* @instance | ||
* @syntax browser.element.findElements(syntax) | ||
* @param {Selector} selector | ||
* @returns {Array.<ScopeWebElement>} | ||
*/ | ||
module.exports.command = function(selector) { | ||
return this.createScopedElements(selector, {parentElement: this, commandName: 'findElements'}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Search for elements on the page. The located elements will be returned as a special web element object (with added convenience methods). | ||
* The argument is the element selector, either specified as a string or as an object (with 'selector' and 'locateStrategy' properties). | ||
* Elements can be searched by using another element as the starting point. | ||
* | ||
* @example | ||
* export default { | ||
* async demoTest(browser: NightwatchAPI): Promise<void> { | ||
* const buttonsElement = browser.element.getAll('button.submit-form'); | ||
* | ||
* // Get an array of found elements. | ||
* const buttons = await buttonsElement; | ||
* | ||
* // Use an object to customise locating behaviour. | ||
* const sections = browser.element | ||
* .getAll({ selector: 'section', locateStrategy: 'css selector' }); | ||
* } | ||
* } | ||
* | ||
* @since 3.0.0 | ||
* @method getAll | ||
* @memberof ScopedWebElement | ||
* @instance | ||
* @syntax browser.element.getAll(syntax) | ||
* @param {Selector} selector | ||
* @returns {Array.<ScopeWebElement>} | ||
*/ | ||
module.exports.command = function(selector) { | ||
return this.createScopedElements(selector, {parentElement: this, commandName: 'getAll'}); | ||
}; |
Oops, something went wrong.