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
* Type text on the keyboard. If any input is focused, it will receive the text,
85
+
* otherwise it will be typed on the document. Uses provider's API under the hood.
86
+
* **Supports** [user-event `keyboard` syntax](https://testing-library.com/docs/user-event/keyboard) (e.g., `{Shift}`) even with `playwright` and `webdriverio` providers.
87
+
* @example
88
+
* await userEvent.keyboard('foo') // translates to: f, o, o
89
+
* await userEvent.keyboard('{{a[[') // translates to: {, a, [
90
+
* await userEvent.keyboard('{Shift}{f}{o}{o}') // translates to: Shift, f, o, o
91
+
* @see {@link https://playwright.dev/docs/api/class-locator#locator-press} Playwright API
92
+
* @see {@link https://webdriver.io/docs/api/browser/keys} WebdriverIO API
93
+
* @see {@link https://testing-library.com/docs/user-event/keyboard} testing-library API
94
+
*/
95
+
keyboard: (text: string)=>Promise<void>
96
+
/**
97
+
* Types text into an element. Uses provider's API under the hood.
98
+
* **Supports** [user-event `keyboard` syntax](https://testing-library.com/docs/user-event/keyboard) (e.g., `{Shift}`) even with `playwright` and `webdriverio` providers.
99
+
* @example
100
+
* await userEvent.type(input, 'foo') // translates to: f, o, o
101
+
* await userEvent.type(input, '{{a[[') // translates to: {, a, [
102
+
* await userEvent.type(input, '{Shift}{f}{o}{o}') // translates to: Shift, f, o, o
103
+
* @see {@link https://playwright.dev/docs/api/class-locator#locator-press} Playwright API
104
+
* @see {@link https://webdriver.io/docs/api/browser/action#key-input-source} WebdriverIO API
105
+
* @see {@link https://testing-library.com/docs/user-event/utility/#type} testing-library API
* Fills an input element with text. This will remove any existing text in the input before typing the new text.
140
+
* Uses provider's API under the hood.
141
+
* This API is faster than using `userEvent.type` or `userEvent.keyboard`, but it **doesn't support** [user-event `keyboard` syntax](https://testing-library.com/docs/user-event/keyboard) (e.g., `{Shift}`).
142
+
* @example
143
+
* await userEvent.fill(input, 'foo') // translates to: f, o, o
144
+
* await userEvent.fill(input, '{{a[[') // translates to: {, {, a, [, [
145
+
* await userEvent.fill(input, '{Shift}') // translates to: {, S, h, i, f, t, }
146
+
* @see {@link https://playwright.dev/docs/api/class-locator#locator-fill} Playwright API
147
+
* @see {@link https://webdriver.io/docs/api/element/setValue} WebdriverIO API
148
+
* @see {@link https://testing-library.com/docs/user-event/utility/#type} testing-library API
0 commit comments