(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestKeyActions(t *testing.T) { |
| 13 | g := setup(t) |
| 14 | |
| 15 | p := g.page.MustNavigate(g.srcFile("fixtures/keys.html")) |
| 16 | body := p.MustElement("body") |
| 17 | |
| 18 | p.KeyActions().Press(input.ControlLeft).Type(input.Enter).MustDo() |
| 19 | g.Eq(body.MustText(), `↓ "Control" ControlLeft 17 modifiers(ctrl) |
| 20 | ↓ "Enter" Enter 13 modifiers(ctrl) |
| 21 | ↑ "Enter" Enter 13 modifiers(ctrl) |
| 22 | ↑ "Control" ControlLeft 17 modifiers() |
| 23 | `) |
| 24 | |
| 25 | body.MustEval("() => this.innerText = ''") |
| 26 | body.MustKeyActions(). |
| 27 | Press(input.ShiftLeft).Type('A', 'X').Release(input.ShiftLeft). |
| 28 | Type('a').MustDo() |
| 29 | g.Eq(body.MustText(), `↓ "Shift" ShiftLeft 16 modifiers(shift) |
| 30 | ↓ "A" KeyA 65 modifiers(shift) |
| 31 | ↑ "A" KeyA 65 modifiers(shift) |
| 32 | ↓ "X" KeyX 88 modifiers(shift) |
| 33 | ↑ "X" KeyX 88 modifiers(shift) |
| 34 | ↑ "Shift" ShiftLeft 16 modifiers() |
| 35 | ↓ "a" KeyA 65 modifiers() |
| 36 | ↑ "a" KeyA 65 modifiers() |
| 37 | `) |
| 38 | |
| 39 | g.Nil(p.Keyboard.Release('a')) |
| 40 | } |
| 41 | |
| 42 | func TestKeyType(t *testing.T) { |
| 43 | g := setup(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…