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/api/cypress-api/custom-commands.mdx
+10-13Lines changed: 10 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,15 @@ in the
25
25
26
26
:::
27
27
28
+
:::caution
29
+
30
+
There are two API available for adding custom commands:
31
+
32
+
-[`Cypress.Commands.add()`](#Syntax) - use to add a custom command to use when writing tests
33
+
-[`Cypress.Command.overwrite()`](#Overwrite-Existing-Commands) - use to override an existing built-in Cypress command or reserved internal function. **Caution:** this overrides it for Cypress as well and could impact how Cypress behaves.
34
+
35
+
:::
36
+
28
37
## Syntax
29
38
30
39
```javascript
@@ -315,17 +324,6 @@ Log? Read more about [Command Logging](#Command-Logging).
315
324
316
325
:::
317
326
318
-
:::caution
319
-
320
-
Note that `Cypress.Commands.add()` will throw an error when trying to add a
321
-
custom command with the same name as an existing built-in Cypress command or
322
-
reserved internal function. In order to override the behavior of an existing
323
-
command, `Cypress.Commands.overwrite()` should be used instead. For more
0 commit comments