Skip to content

Commit

Permalink
improved docs
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Jun 18, 2014
1 parent 76b4cfa commit 0f715dd
Show file tree
Hide file tree
Showing 163 changed files with 278 additions and 89 deletions.
4 changes: 1 addition & 3 deletions lib/commands/addValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
* @param {String=} values Input element
*
* @uses protocol/elements, protocol/elemendIdValue
*
* @test addValue.js test/spec/desktop/addValue/index.js
* @test index.html test/spec/desktop/addValue/index.html
* @type action
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/buttonClick.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Click on a button using a css selector.
*
* @param {String} selector button element
* @type action
* @deprecated still included for backward compatibility (see click)
*
*/
Expand Down
3 changes: 3 additions & 0 deletions lib/commands/call.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
*
* call own function wihtin the chain
*
* @param {Function} callback function to be called
* @type utility
*
* ### Example usage
*
* it('some title', function(done) {
Expand Down
5 changes: 3 additions & 2 deletions lib/commands/chooseFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* @param {String} selector input element
* @param {String} localPath local path to file to be uploaded
*
* @uses actions/uploadFile, actions/addValue
* @uses action/uploadFile, action/addValue
* @type utility
*
*/

Expand All @@ -29,7 +30,7 @@ module.exports = function chooseFile(selector, localPath) {
return callback(new ErrorHandler.CommandError('number or type of arguments don\'t agree with chooseFile command'));
}

/**
/*!
* mobile check
*/
if(!this.isMobile) {
Expand Down
1 change: 1 addition & 0 deletions lib/commands/clearElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @param {String} selector input element
* @uses protocol/elements, protocol/elementIdClear
* @type action
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/click.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @param {String} selector element to click on. If it matches with more than on DOM-element it automatically clicks on the first element
* @uses protocol/element, protocol/elementIdClick, protocol/touchClick
* @type action
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/close.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @param {String=} windowHandle new window to focus on
* @uses protocol/window, window/switchTab
* @type window
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/deleteCookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @param {String} name name of cookie
* @uses protocol/cookie
* @type cookie
*
*/

Expand Down
3 changes: 2 additions & 1 deletion lib/commands/doubleClick.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* Double-click on an element based on a css selector.
*
* @param {String} selector element to double click on. If it matches with more than on DOM-element it automatically clicks on the first element
* @uses protocol/element, protocol/moveTo, protocol/doDoubleClick
* @uses protocol/element, protocol/moveTo, protocol/doDoubleClick, protocol/touchDoubleClick
* @type action
*
*/

Expand Down
3 changes: 2 additions & 1 deletion lib/commands/dragAndDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* @param {String} cssSourceElem source css selector
* @param {String} cssDestinationElem destination css selector
*
* @uses actions/moveToObject, protocol/buttonDown, protocol/buttonUp, properties/getLocation, protocol/touchDown, protocol/touchMove, protocol/touchUp
* @uses action/moveToObject, protocol/buttonDown, protocol/buttonUp, properties/getLocation, protocol/touchDown, protocol/touchMove, protocol/touchUp
* @type action
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/end.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* End the session and close browser.
*
* @uses protocol/session
* @type utility
*/

module.exports = function end () {
Expand Down
1 change: 1 addition & 0 deletions lib/commands/endAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* End all sessions and close browser.
*
* @uses protocol/sessions, protocol/session
* @type utility
*
*/

Expand Down
7 changes: 4 additions & 3 deletions lib/commands/flick.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @param {Number=} yoffset y offset of flick gesture (in pixels or relative units)
*
* @uses protocol/element, protocol/touchFlick
* @type mobile
*
*/

Expand All @@ -31,7 +32,7 @@ module.exports = function flick (selector, xoffset, yoffset, speed) {
var self = this,
response = {};

/**
/*!
* mobile check
*/
if(!this.isMobile) {
Expand All @@ -40,7 +41,7 @@ module.exports = function flick (selector, xoffset, yoffset, speed) {

if(arguments.length === 3 && typeof selector === 'number' && typeof xoffset === 'number') {

/**
/*!
* you don't care where the flick starts on the screen
*/

Expand All @@ -63,7 +64,7 @@ module.exports = function flick (selector, xoffset, yoffset, speed) {

} else {

/**
/*!
* command starts at a particular screen location
*/

Expand Down
3 changes: 2 additions & 1 deletion lib/commands/flickDown.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @param {Number} duration time (in seconds) to spend performing the drag
*
* @uses mobile/flick
* @type mobile
*
*/

Expand All @@ -23,7 +24,7 @@ module.exports = function flickDown(selector, duration) {
selector = null;
}

/**
/*!
* set default duration if not set
*/
if(typeof duration !== 'number') {
Expand Down
5 changes: 3 additions & 2 deletions lib/commands/flickLeft.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* @param {String} selector element to drag on
* @param {Number} duration time (in seconds) to spend performing the drag
*
* @uses mobile/swipe
* @uses mobile/flick
* @type mobile
*
*/

Expand All @@ -23,7 +24,7 @@ module.exports = function flickLeft (selector, duration) {
selector = null;
}

/**
/*!
* set default duration if not set
*/
if(typeof duration !== 'number') {
Expand Down
5 changes: 3 additions & 2 deletions lib/commands/flickRight.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* @param {String} selector element to drag on
* @param {Number} duration time (in seconds) to spend performing the drag
*
* @uses mobile/swipe
* @uses mobile/flick
* @type mobile
*
*/

Expand All @@ -23,7 +24,7 @@ module.exports = function flickRight (selector, duration) {
selector = null;
}

/**
/*!
* set default duration if not set
*/
if(typeof duration !== 'number') {
Expand Down
3 changes: 2 additions & 1 deletion lib/commands/flickUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @param {Number} duration time (in seconds) to spend performing the drag
*
* @uses mobile/flick
* @type mobile
*
*/

Expand All @@ -23,7 +24,7 @@ module.exports = function flickUp(selector, duration) {
selector = null;
}

/**
/*!
* set default duration if not set
*/
if(typeof duration !== 'number') {
Expand Down
1 change: 1 addition & 0 deletions lib/commands/getAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* @returns {String|String[]|null} The value of the attribute(s), or null if it is not set on the element.
*
* @uses protocol/elements, protocol/elementIdAttribute
* @type property
*
*/

Expand Down
3 changes: 2 additions & 1 deletion lib/commands/getCookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @returns {Object|null} requested cookie if existing
*
* @uses protocol/cookie
* @type cookie
*
*/

Expand Down Expand Up @@ -51,7 +52,7 @@ module.exports = function getCookie (name) {
cookie = null;
}

/**
/*!
* return null if a specific cookie was selected, otherwise
* return [] because user expects an array of cookies
*/
Expand Down
1 change: 1 addition & 0 deletions lib/commands/getCssProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* @param {String} cssProperty css property name
*
* @uses protocol/elements, protocol/elementIdCssProperty
* @type property
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getCurrentTabId.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @returns {String} the window handle URL of the current focused window
* @uses protocol/windowHandle
* @type window
*
*/

Expand Down
5 changes: 2 additions & 3 deletions lib/commands/getElementCssProperty.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/**
*
* @deprecated this command is obsolete since the selector API was introduced. Its only purpose is for backwards compability.
* @use getCssProperty
* @todo should be removed some day
*
* @uses properties/getCssProperty
* @uses property/getCssProperty
* @type property
*
*/

Expand Down
5 changes: 3 additions & 2 deletions lib/commands/getElementSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
*
* Get the width and height for an DOM-element based on the css selector.
*
* @param {String} selector element with requested size
* @returns {Object} requested element size (`{width:number, height:number}`)
* @param {String} selector element with requested size
* @returns {Object} requested element size (`{width:number, height:number}`)
*
* @uses protocol/elements, protocol/elementIdSize
* @type property
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getGeoLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @returns {Object} the current geo location (`{latitude: number, longitude: number, altitude: number}`)
* @uses protocol/location
* @type mobile
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @param {Boolean} includeSelectorTag if true it includes the tag of selector element
*
* @uses protocol/execute
* @type property
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @returns {Object|Object[]} The X and Y coordinates for the element on the page (`{x:number, y:number}`)
*
* @uses protocol/elements, protocol/elementIdLocation
* @type property
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getLocationInView.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @returns {Object|Object[]} The X and Y coordinates for the element on the page (`{x:number, y:number}`)
*
* @uses protocol/elements, protocol/elementIdLocationInView
* @type property
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getOrientation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @returns {String} device orientation (`{landscape|portrait}`)
* @uses protocol/orientation
* @type mobile
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @returns {String} source code of current website
* @uses protocol/source
* @type property
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getTabIds.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @returns {String[]} a list of window handles
* @uses protocol/windowHandles
* @type window
*
*/

Expand Down
5 changes: 3 additions & 2 deletions lib/commands/getTagName.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
*
* Get tag name of a DOM-element found by the css selector.
*
* @param {String} selector element with requested tag name
* @returns {String|String[]} the element's tag name, as a lowercase string
* @param {String} selector element with requested tag name
* @returns {String|String[]} the element's tag name, as a lowercase string
*
* @uses protocol/elements, protocol/elementIdName
* @type property
*
*/

Expand Down
5 changes: 3 additions & 2 deletions lib/commands/getText.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
*
* Get the text content from a DOM-element found by the css selector.
*
* @param {String} selector element with requested text
* @returns {String|String[]} content of selected element (all HTML tags are removed)
* @param {String} selector element with requested text
* @returns {String|String[]} content of selected element (all HTML tags are removed)
*
* @uses protocol/elements, protocol/elementIdText
* @type property
*
*/

Expand Down
1 change: 1 addition & 0 deletions lib/commands/getTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*
* @returns {String} current page title
* @uses protocol/title
* @type property
*
*/

Expand Down
5 changes: 3 additions & 2 deletions lib/commands/getValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
*
* Get the value of a `<textarea>` or text `<input>` found by css selector.
*
* @param {String} selector input or textarea element
* @returns {String} requested input value
* @param {String} selector input or textarea element
* @returns {String} requested input value
*
* @uses protocol/elements, protocol/elementIdAttribute
* @type property
*
*/

Expand Down

0 comments on commit 0f715dd

Please sign in to comment.