Skip to content

Commit

Permalink
updated api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
beatfactor committed Nov 21, 2019
1 parent aea3b9a commit cfd74ce
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
16 changes: 7 additions & 9 deletions lib/api/assertions/containsText.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ exports.assertion = function(definition, expectedText, msg) {
elementSelector: true
};

/**
/*!
* Returns the message format which will be used to output the message in the console and also
* the arguments which will be used for replace the place holders, used in the order of appearance
*
* @return {{args: [], message: string}}
*/
this.formatMessage = function() {
const message = msg || `Testing if element %s ${this.negate ? 'does not contain text %s' : 'contains text %s'}`;
Expand All @@ -33,7 +31,7 @@ exports.assertion = function(definition, expectedText, msg) {
}
};

/**
/*!
* Returns the expected value of the assertion which is displayed in the case of a failure
*
* @return {string}
Expand All @@ -42,7 +40,7 @@ exports.assertion = function(definition, expectedText, msg) {
return this.negate ? `does not contain text '${expectedText}'` : `contains text '${expectedText}'`;
};

/**
/*!
* Given the value, the condition used to evaluate if the assertion is passed
* @param {*} value
* @return {Boolean}
Expand All @@ -55,7 +53,7 @@ exports.assertion = function(definition, expectedText, msg) {
return value.includes(expectedText);
};

/**
/*!
* When defined, this method is called by the assertion runner with the command result, to determine if the
* value can be retrieved successfully from the result object
*
Expand All @@ -66,7 +64,7 @@ exports.assertion = function(definition, expectedText, msg) {
return result === false || result && result.status === -1;
};

/**
/*!
* Called with the result object of the command to retrieve the value which is to be evaluated
*
* @param {Object} result
Expand All @@ -76,7 +74,7 @@ exports.assertion = function(definition, expectedText, msg) {
return result.value;
};

/**
/*!
* When defined, this method is called by the assertion runner with the command result to determine the actual
* state of the assertion in the event of a failure
*
Expand All @@ -87,7 +85,7 @@ exports.assertion = function(definition, expectedText, msg) {
return passed ? `contains '${expectedText}'` : `does not contain '${expectedText}'`;
};

/**
/*!
* The command which is to be executed by the assertion runner
* @param {function} callback
*/
Expand Down
1 change: 0 additions & 1 deletion lib/api/expect/assertions/element/property.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* @param {string} property The property name
* @param {string} [message] Optional log message to display in the output. If missing, one is displayed by default.
* @display .property(name)
* @since v0.7
* @api expect.element
*/
const BaseAssertion = require('./_element-assertion.js');
Expand Down
1 change: 0 additions & 1 deletion lib/api/expect/assertions/element/selected.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*
* @method selected
* @display .selected
* @since v0.7
* @api expect.element
*/
const BaseAssertion = require('./_element-assertion.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/api/protocol/_base-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = class ProtocolAction {
this.__nightwatchInstance = nightwatchInstance;
}

/**
/*!
* @override
* @return {Promise}
*/
Expand Down
1 change: 1 addition & 0 deletions lib/api/protocol/acceptAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const ProtocolAction = require('./_base-action.js');
/**
* Accepts the currently displayed alert dialog. Usually, this is equivalent to clicking on the 'OK' button in the dialog.
*
* @method acceptAlert
* @link /#accept-alert
* @param {function} [callback] Optional callback function to be called when the command finishes.
* @api protocol.userprompts
Expand Down
1 change: 1 addition & 0 deletions lib/api/protocol/back.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const ProtocolAction = require('./_base-action.js');
/**
* Navigate backwards in the browser history, if possible.
*
* @method back
* @link /#back
* @param {function} [callback] Optional callback function to be called when the command finishes.
* @api protocol.navigation
Expand Down
1 change: 1 addition & 0 deletions lib/api/protocol/contexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const ProtocolAction = require('./_base-action.js');
*
* Used by Appium when testing hybrid mobile web apps. More info here: https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/hybrid.md.
*
* @method contexts
* @param {function} callback Callback function to be called when the command finishes.
* @returns {Array} an array of strings representing available contexts, e.g 'WEBVIEW', or 'NATIVE'
* @api protocol.mobile
Expand Down
1 change: 1 addition & 0 deletions lib/api/protocol/doubleClick.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const ProtocolAction = require('./_base-action.js');
/**
* Double-clicks at the current mouse coordinates (set by `.moveTo()`).
*
* @method doubleClick
* @param {function} [callback] Optional callback function to be called when the command finishes.
* @api protocol.useractions
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/api/protocol/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ProtocolAction = require('./_base-action.js');
*
* The function will be invoked with the provided args array and the values may be accessed via the arguments object in the order specified.
*
* Under the hood, if the `body` param is a function it is converted to a string with `<function>.toString()`. Any references to your current scope are ignored.
* Under the hood, if the `body` param is a function it is converted to a string with `function.toString()`. Any references to your current scope are ignored.
*
* To ensure cross-browser compatibility, the specified function should not be in ES6 format (i.e. `() => {}`). If the execution of the function fails, the first argument of the callback contains error information.
*
Expand Down

0 comments on commit cfd74ce

Please sign in to comment.