nightwatch
Version:
Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.
24 lines (23 loc) • 834 B
JavaScript
/**
* Returns a context for the given element which can be used for querying child elements.
*
* @example
* describe('example using within()', function() {
*
* it('click a button within the element', async function(browser) {
* const context = browser.within('#weblogin');
* await context.click('button');
* });
* })
*
* @method within
* @syntax browser.within('#element').click('button');
* @param {string|object} selector The selector (CSS/Xpath) used to locate the element. Can either be a string or an object which specifies [element properties](https://nightwatchjs.org/guide/writing-tests/finding-interacting-with-dom-elements.html#postdoc-element-properties).
* @api protocol.elements
* @since 2.5.5
*/
module.exports = class WithinAbstract {
static get allowOverride() {
return true;
}
};