You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rules/assertion-before-screenshot.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,22 @@
1
-
## Assertion Before Screenshot
1
+
#Require screenshots to be preceded by an assertion (`cypress/assertion-before-screenshot`)
2
2
3
+
<!-- end auto-generated rule header -->
3
4
If you take screenshots without assertions then you may get different screenshots depending on timing.
4
5
5
6
For example, if clicking a button makes some network calls and upon success, renders something, then the screenshot may sometimes have the new render and sometimes not.
6
7
8
+
## Rule Details
9
+
7
10
This rule checks there is an assertion making sure your application state is correct before doing a screenshot. This makes sure the result of the screenshot will be consistent.
If there are genuine use-cases for using `async/await` in your before then you may not want to include this rule (or at least demote it to a warning).
46
+
If there are genuine use-cases for using `async/await` in your `before` hooks then you may not want to include this rule (or at least demote it to a warning).
Copy file name to clipboardExpand all lines: docs/rules/no-async-tests.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
-
# Prevent using async/await in Cypress test cases (no-async-tests)
1
+
# Disallow using `async`/`await` in Cypress test cases (`cypress/no-async-tests`)
2
2
3
-
Cypress tests [that return a promise will error](https://docs.cypress.io/guides/references/error-messages.html#Cypress-detected-that-you-returned-a-promise-from-a-command-while-also-invoking-one-or-more-cy-commands-in-that-promise) and cannot run successfully. An `async` function returns a promise under the hood, so a test using an `async` function will also error.
3
+
💼 This rule is enabled in the ✅ `recommended` config.
4
+
5
+
<!-- end auto-generated rule header -->
6
+
Cypress tests [that return a promise will error](https://docs.cypress.io/guides/references/error-messages.html#Cypress-detected-that-you-returned-a-promise-from-a-command-while-also-invoking-one-or-more-cy-commands-in-that-promise) and cannot run successfully.
7
+
An `async` function returns a promise under the hood, so a test using an `async` function will also error.
Copy file name to clipboardExpand all lines: docs/rules/no-pause.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,17 @@
1
-
## Do not use `cy.pause` command
1
+
#Disallow using `cy.pause()` calls (`cypress/no-pause`)
2
2
3
-
It is recommended to remove [cy.pause](https://on.cypress.io/pause) command before committing the specs to avoid other developers getting unexpected results.
3
+
<!-- end auto-generated rule header -->
4
+
It is recommended to remove any [cy.pause](https://on.cypress.io/pause) commands before committing specs to avoid other developers getting unexpected results.
0 commit comments