Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix API doc for setPassword command. #4225

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/api/element-commands/setPassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const BaseElementCommand = require('./_baseElementCommand.js');
/**
* An alias of "setValue" command, but hides the content from the nightwatch logs.
*
* <div class="alert alert-warning"><strong>setValue/setPassword</strong> do not clear the existing value of the element. To do so, use the <strong>clearValue()</strong> command.</div>
* <div class="alert alert-warning"><strong>setValue/setPassword</strong> also clears the existing value of the element by calling the <strong>clear()</strong> command beforehand.</div>
*
* An object map with available keys and their respective UTF-8 characters, as defined on [W3C WebDriver draft spec](https://www.w3.org/TR/webdriver/#character-types), is loaded onto the main Nightwatch instance as `browser.Keys`.
*
Expand All @@ -12,18 +12,17 @@ const BaseElementCommand = require('./_baseElementCommand.js');
* this.demoTest = function (browser) {
* browser.setPassword('input[type=text]', 'nightwatch');
* };
* //
*
* // send some text to an input and hit enter.
* this.demoTest = function (browser) {
* browser.setPassword('input[type=text]', ['nightwatch', browser.Keys.ENTER]);
* };
*
*
* @link /session/:sessionId/element/:id/value
* @method setPassword
* @syntax .setPassword(selector, inputValue, [callback])
* @syntax .setPassword(using, selector, inputValue, [callback])
* @param {string} [using] The locator strategy to use. See [W3C Webdriver - locator strategies](https://www.w3.org/TR/webdriver/#locator-strategies)
* @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#element-properties).
* @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).
* @param {string|array} inputValue The text to send to the element or key strokes.
* @param {function} [callback] Optional callback function to be called when the command finishes.
* @link /#element-send-keys
Expand Down
Loading