Skip to content

Commit af05f3c

Browse files
lint
1 parent 1f3240e commit af05f3c

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

docs/api/commands/press.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Currently, the only key supported is `Tab`.
2121
:::caution
2222

2323
<strong>Supported Browsers:</strong>
24-
This command is supported in chromium browsers and Firefox versions >=
25-
v135. WebKit is not supported. This command will fail if executed in a browser that
26-
does not support it.
24+
This command is supported in chromium browsers and Firefox versions >= v135. WebKit
25+
is not supported. This command will fail if executed in a browser that does not support
26+
it.
2727

2828
:::
2929

@@ -61,7 +61,7 @@ cy.get('input.second').should('have.focus')
6161
cy.get('input.first').focus()
6262
cy.press(Cypress.Keyboard.Keys.TAB)
6363
// Errors because press yields null
64-
.should('have.focus')
64+
.should('have.focus')
6565
```
6666

6767
### Arguments
@@ -80,10 +80,10 @@ The key to press. The supported values are available on [`Cypress.Keyboard.Keys`
8080

8181
Pass in an options object to change the default behavior of `.press()`.
8282

83-
| Option | Default | Description |
84-
| ---------------------------- | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
85-
| `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |
86-
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.press()` to resolve before timing out |
83+
| Option | Default | Description |
84+
| --------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
85+
| `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) |
86+
| `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.press()` to resolve before timing out |
8787

8888
<HeaderYields />
8989

@@ -122,8 +122,8 @@ If your application prevents the default behavior of the `beforeunload` event, t
122122

123123
## History
124124

125-
| Version | Changes |
126-
| ------------------------------------------ | --------------------------- |
125+
| Version | Changes |
126+
| ----------------------------------- | ---------------------------- |
127127
| [14.3.0](/app/references/changelog) | Added the `.press()` command |
128128

129129
## See also

docs/api/cypress-api/keyboard-api.mdx

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,28 @@ The keystroke delay can also be set via
7979
which can be useful when setting it for a single test or a subset of tests.
8080

8181
```javascript
82-
it('removes keystroke delay for all typing in this test', { keystrokeDelay: 0 }, () => {
83-
cy.get('input').eq(0).type('fast typing')
84-
cy.get('input').eq(1).type('more fast typing')
85-
})
86-
87-
describe('removes keystroke delay in all tests in this suite', { keystrokeDelay: 0 }, () => {
88-
it('types fast in the first input', () => {
82+
it(
83+
'removes keystroke delay for all typing in this test',
84+
{ keystrokeDelay: 0 },
85+
() => {
8986
cy.get('input').eq(0).type('fast typing')
90-
})
91-
92-
it('types fast in the second input', () => {
9387
cy.get('input').eq(1).type('more fast typing')
94-
})
95-
})
88+
}
89+
)
90+
91+
describe(
92+
'removes keystroke delay in all tests in this suite',
93+
{ keystrokeDelay: 0 },
94+
() => {
95+
it('types fast in the first input', () => {
96+
cy.get('input').eq(0).type('fast typing')
97+
})
98+
99+
it('types fast in the second input', () => {
100+
cy.get('input').eq(1).type('more fast typing')
101+
})
102+
}
103+
)
96104
```
97105

98106
## See also

docs/api/table-of-contents.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Cypress has a variety of additional commands to help write tests.
139139
| [`.mount()`](/api/commands/mount) | Mount a component for Cypress Component Testing. |
140140
| [`.origin()`](/api/commands/origin) | Visit multiple domains of different origin in a single test. |
141141
| [`.pause()`](/api/commands/pause) | Pause test execution, allowing interaction with the application under test before resuming. |
142-
| [`.press()`](/api/commands/press) | Trigger native key events in your application to simulate real user keyboard interactions. |
142+
| [`.press()`](/api/commands/press) | Trigger native key events in your application to simulate real user keyboard interactions. |
143143
| [`.readFile()`](/api/commands/readfile) | Read a file from disk. |
144144
| [`.reload()`](/api/commands/reload) | Reload the page. |
145145
| [`.request()`](/api/commands/request) | Make an HTTP request. |

0 commit comments

Comments
 (0)