Skip to content

Commit

Permalink
Add withinSubject usage
Browse files Browse the repository at this point in the history
To go along with cypress-io/cypress#2791
  • Loading branch information
Paul Sachs committed May 25, 2019
1 parent f9f416e commit 00fa272
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/tags/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ module.exports = function usageOptions (hexo, args) {
return 'Serially click multiple elements'
}

const withinSubject = () => {
return 'Element to search for children in. If null, search begins from root-level DOM element'
}

switch (opt) {
case 'log':
return log()
Expand All @@ -42,6 +46,8 @@ module.exports = function usageOptions (hexo, args) {
return multiple()
case 'timeout':
return timeout()
case 'withinSubject':
return withinSubject()
default:
// error when an invalid usage option was provided
throw new Error(`{% usage_options %} tag helper was provided an invalid option: ${opt}`)
Expand Down
1 change: 1 addition & 0 deletions source/api/commands/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Pass in an options object to change the default behavior of `cy.get()`.
| --------- | -------------------------------------------------------- | ---------------------------------- |
| `log` | `true` | {% usage_options log %} |
| `timeout` | {% url `defaultCommandTimeout` configuration#Timeouts %} | {% usage_options timeout cy.get %} |
| 'withinSubject' | null | {% usage_options withinSubject %} |

## Yields {% helper_icon yields %}

Expand Down

0 comments on commit 00fa272

Please sign in to comment.