This repository was archived by the owner on Jan 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
This repository was archived by the owner on Jan 30, 2025. It is now read-only.
Keyboard doesn't hold selection #284
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingplaywrightIssue relating to Playwright compatibilityIssue relating to Playwright compatibility
Milestone
Description
On current main
(12eeeb5) the following test:
xk6-browser/tests/keyboard_test.go
Lines 45 to 70 in 61fb0c2
// Replicates the test from https://playwright.dev/docs/api/class-keyboard | |
t.Run("hold", func(t *testing.T) { | |
t.Skip("FIXME") | |
p := tb.NewPage(nil) | |
kb := p.(*common.Page).Keyboard //nolint: forcetypeassert | |
p.SetContent(`<input type="textarea">`, nil) | |
el := p.Query("input") | |
p.Focus("input", nil) | |
kb.Type("Hello World!", nil) | |
require.Equal(t, "Hello World!", el.InputValue(nil)) | |
kb.Press("ArrowLeft", nil) | |
// Should hold the key until Up() is called. | |
kb.Down("Shift") | |
for i := 0; i < len(" World"); i++ { | |
kb.Press("ArrowLeft", nil) | |
} | |
// Should release the key but the selection should remain active. | |
kb.Up("Shift") | |
// Should delete the selection. | |
kb.Press("Backspace", nil) | |
assert.Equal(t, "Hello!", el.InputValue(nil)) | |
}) |
... fails with:
expected: "Hello!"
actual : "Hell World!"
I'm not sure if this is an issue with the Keyboard.pressedKeys
implementation, only with the Shift key and keeping the selection, or something else.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingplaywrightIssue relating to Playwright compatibilityIssue relating to Playwright compatibility