File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,33 @@ test('clicks on an element', async () => {
5959 await userEvent.click(logo)
6060 // or you can access it directly on the locator
6161 await logo.click()
62+
63+ // With WebdriverIO, this uses either ElementClick (with no arguments) or
64+ // actions (with arguments). Use an empty object to force the use of actions.
65+ await logo.click({})
6266})
6367` ` `
6468
69+ ### Clicking with a modifier
70+
71+ With either WebdriverIO or Playwright :
72+
73+ ` ` ` ts
74+ await userEvent.keyboard('{Shift>}')
75+ // By using an empty object as the option, this opts in to using a chain of actions
76+ // instead of an ElementClick in webdriver.
77+ // Firefox has a bug that makes this necessary.
78+ // Follow https://bugzilla.mozilla.org/show_bug.cgi?id=1456642 to know when this
79+ // will be fixed.
80+ await userEvent.click(element, {})
81+ await userEvent.keyboard('{/Shift}')
82+ ` ` `
83+
84+ With Playwright :
85+ ` ` ` ts
86+ await userEvent.click(element, { modifiers: ['Shift'] })
87+ ` ` `
88+
6589References :
6690
6791- [Playwright ` locator.click ` API ](https :// playwright.dev/docs/api/class-locator#locator-click)
You can’t perform that action at this time.
0 commit comments