Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: webdriverio release
Browse files Browse the repository at this point in the history
sheremet-va committed Jul 23, 2024
1 parent 5cf8704 commit 5121921
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/browser/src/node/commands/keyboard.ts
Original file line number Diff line number Diff line change
@@ -155,7 +155,10 @@ export async function keyboardImplementation(
}
}

await keyboard.perform(skipRelease)
// seems like webdriverio doesn't release keys automatically if skipRelease is true and all events are keyUp
const allRelease = keyboard.toJSON().actions.every(action => action.type === 'keyUp')

await keyboard.perform(allRelease ? false : skipRelease)
}

return {
1 change: 1 addition & 0 deletions test/browser/test/userEvent.test.ts
Original file line number Diff line number Diff line change
@@ -562,6 +562,7 @@ describe('userEvent.keyboard', async () => {
])
})

// looks like wdio doesn't support releasing Enter on its own
test('should not auto release', async () => {
const spyKeydown = vi.fn()
const spyKeyup = vi.fn()

0 comments on commit 5121921

Please sign in to comment.