Skip to content

pressKeys emulation is broken #1038

@jason0x43

Description

@jason0x43

In browsers using mostly or all W3C semantics, pressKeys uses simulated keyboard events. In these browsers, sending some characters such as keys.TAB doesn't work as expected.

Consider the following test:

import { suite, test } from 'intern/core/lib/interfaces/tdd';
import keys from 'intern/webdriver/keys';

suite('functional', () => {
	test('find link', test => {
		return test.remote
			.setFindTimeout(5000)
			.get('/tests/functional/page.html')
			.findById('username')
			.click()
			.pressKeys('testing' + keys.TAB)
			.sleep(20000);
	});
});

In Firefox 72 with geckodriver 0.26, using a simple test page, it results in the following:

Screen Shot 2020-01-15 at 2 19 52 PM

Sending keys.TAB should cause the browser to behave as if a Tab key was pressed, not send a Unicode character.

Similar behavior was observed with Chrome 79 and Safari 13.

See also: theintern/leadfoot#110.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intendeddomain-webdriverRelated to Intern's webdriver interface (formerly Leadfoot)effort-mediumThis may take a couple of dayspriority-mediumThis should get done, but it's not a high priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions