Will uncheck, by clicking, on a checkbox or radio input if it is not already unchecked.
The element is scrolled into view if it is not already pointer-interactable. See the WebDriver specification for element interactability.

For more info on working with DOM elements in Nightwatch, refer to the Finding & interacting with DOM Elements guide page.

Usage

                    browser.element(selector).check()
                

Example

export default {
  demoTest(browser: NightwatchAPI): void {
    browser.element('input[type=checkbox]:checked)').check();
  },
  async demoTestAsync(browser: NightwatchAPI): Promise<void> {
    await browser.element('input[type=checkbox]:checked)').check();
  },
}

Returns

Type description
ScopedWebElement