nightwatch
Version:
Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.
29 lines (28 loc) • 717 B
JavaScript
/**
* Returns the element ID
*
* @example
* export default {
* demoTest(browser: NightwatchAPI): void {
* const elementId = browser.element('#main').getId();
* console.log('element id:', elementId)
* },
*
* async demoTestAsync(browser: NightwatchAPI): Promise<void> {
* const elementId = await browser.element('#main').getId();
* console.log('element id:', elementId);
* },
* }
*
* @since 3.0.0
* @method getId
* @memberof ScopedWebElement
* @instance
* @syntax browser.element(selector).getId()
* @returns {ScopedValue<string>}
*/
module.exports.command = function() {
return this.runQueuedCommandScoped(function (webElement) {
return webElement.getId();
});
};