diff --git a/lib/tags/requirements.js b/lib/tags/requirements.js
index c28e22eb87..d406f6d7c7 100644
--- a/lib/tags/requirements.js
+++ b/lib/tags/requirements.js
@@ -6,22 +6,22 @@ module.exports = function yields (hexo, args) {
// {% requirements dom .click %}
// {% requirements dom .children %}
- const type = args[0]
const cmd = `${args[1]}()
`
const focus = `${cmd} requires the element to be able to receive focus`
- const parentCmd = `${cmd} requires being chained off of cy
`
const childCmd = `${cmd} requires being chained off a previous command`
const childCmdDom = `${cmd} requires being chained off a command that yields DOM element(s)`
+ const dualCmd = `${cmd} can be chained off of cy
or off another command`
+ const parentCmd = `${cmd} requires being chained off of cy
`
- const parentOrChild = () => {
- return (args[1] === 'cy.get' || args[1] === 'cy.focused') ? parentCmd : childCmdDom
- }
+ const type = args[0]
- const none = () => {
+ const blurability = () => {
return `
${cmd} has no requirements or default assertions.
${childCmdDom}.
${cmd} requires the element to currently have focus.
${focus}.
${parentOrChild()}.
${childCmdDom}.
${cmd} requires the element to be an input
or textarea
.
${parentCmd}.
${childCmdDom}.
${cmd} requires the element to have type checkbox
or radio
.
${childCmdDom}.
${cmd} requires the element to currently have focus.
${focus}.
${parentOrChild()}.
${childCmdDom}.
${focus}.
${cmd} ${dualCmd}
${childCmdDom}.
${cmd} requires the element to be an input
or textarea
.
${cmd} can be chained off of cy
or off a command that yields DOM element(s).
${childCmdDom}.
${cmd} requires the element to have type checkbox
or radio
.
${cmd} can be chained off of cy
or off a command that yields a single DOM element.
${childCmdDom}.
${cmd} requires the element to be a select
.
${parentCmd}.
${cmd} requires the executed system command to eventually exit.
${cmd} requires that the exit code be 0
when failOnNonZeroExit
is true
.
${childCmdDom}.
${cmd} requires the element to be scrollable.
${focus}.
${childCmdDom}.
${cmd} requires the element to be a form
.
${cmd} has no requirements or default assertions.
${cmd} can be chained off of cy
or off another command.
${parentCmd}.
${cmd} requires the response to be content-type: text/html
.
${cmd} requires the response code to be 2xx
after following redirects.
${cmd} requires the load load
event to eventually fire.
${cmd} can be chained off of cy
or off a command that yields DOM element(s).
${parentCmd}.
${cmd} can be chained off of cy
or off a command that yields a single DOM element.
${parentCmd}.
${cmd} requires the file must exist.
${cmd} requires the file be successfully read from disk. Anything preventing this such as OS permission issues will cause it to fail.
${childCmd}.
${cmd} requires being chained off of a command that yields an array-like structure.
${parentCmd}.
${cmd} requires that the server send a response.
${cmd} requires that the response status code be 2xx
or 3xx
when failOnStatusCode
is true
.
${parentCmd}.
${cmd} requires the executed system command to eventually exit.
${cmd} requires that the exit code be 0
when failOnNonZeroExit
is true
.
${childCmdDom}.
${cmd} requires the element to be scrollable.
${parentCmd}.
${cmd} requires the task to eventually end.
${childCmdDom}.
${cmd} requires the element to be a select
.
${parentCmd}.
${cmd} requires the file be successfully written to disk. Anything preventing this such as OS permission issues will cause it to fail.
${childCmd}.
${cmd} requires being chained off of a command that yields an array-like structure.
${parentCmd}.
${cmd} requires the file must exist.
${cmd} requires the file be successfully read from disk. Anything preventing this such as OS permission issues will cause it to fail.
${childCmdDom}.
${cmd} requires the element to be a form
.
${parentCmd}.
${cmd} requires the response to be content-type: text/html
.
${cmd} requires the response code to be 2xx
after following redirects.
${cmd} requires the load load
event to eventually fire.
${cmd} requires the task to eventually end.
When passed a time
argument ${dualCmd}.
When passed an alias
argument ${parentCmd}.
${parentCmd}.
${cmd} requires that the server send a response.
${cmd} requires that the response status code be 2xx
or 3xx
when failOnStatusCode
is true
.
${cmd} requires the file be successfully written to disk. Anything preventing this such as OS permission issues will cause it to fail.