Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webdriver broken for contenteditable - not possible to create tests for the Input Events spec #13464

Closed
johanneswilm opened this issue Oct 11, 2018 · 7 comments

Comments

@johanneswilm
Copy link
Contributor

For the Input Events spec [1], we need to write tests on whether the beforeinput and input events are triggered given certain user actions. We cannot just write these tests in JavaScript, as the events should only be triggered upon user interaction.

This would usually mean that one would use Selenium webdriver tests. But unfortunately, there are a number of bugs which mean that webdriver cannot set the selection to elements within a contenteditable element (not just on the contenteditable element itself) [2]. JavaScript editors using webdriver for their own testing can use extra JavaScript functions to set the selection and insert content programmatically, but then causes the events we want to test for to be triggered.

[1] https://github.com/w3c/input-events
[2] See for example SeleniumHQ/selenium-google-code-issue-archive#2442 or SeleniumHQ/selenium-google-code-issue-archive#6981

@gsnedders
Copy link
Member

@johanneswilm Do you have any links to any bugs on browsers' WebDriver implementations? AFAIK there's no reason per spec for it to not work. Those Selenium bugs don't link to any bugs in the actual WD implementations, and we soonish shouldn't be using Selenium at all for any browser any more (#12374).

@gsnedders
Copy link
Member

Is this what is tested in webdriver/tests/element_send_keys/content_editable.py? https://wpt.fyi/results/webdriver/tests/element_send_keys/content_editable.py?label=experimental shows this failing in Chrome and Safari (and passing in Edge and Firefox.

@johanneswilm
Copy link
Contributor Author

@gsnedders Firefox/Edge are the two browsers that have not implemented the Input Events spec. Chrome and Safari have. Looking quickly at those 5-6 lines of tests, they don't seem to be related to the input events.

If you use any search engine and look for "Webdriver contenteditable" you will see this has been a painpoint for many people over a long time, and bugs filed in this regard have always just been closed rather than dealt with. Do we have any reason to believe that this will work if only using the webdrivers without Selenium?

@gsnedders
Copy link
Member

@johanneswilm But they are related to contentEditable being modified by WebDriver, no? Or is this specifically about selection (i.e., w3c/webdriver#388)?

@johanneswilm
Copy link
Contributor Author

I don't know what the purpose of that test is. It seems to put the selection into contenteditable element without specifying where exactly, and then it tests whether the selection happens to have ended up at the end of the content. I could be wrong though.
I don't think there is any relation to the Input Events spec other than that both have something to do with contenteditable.

@johanneswilm
Copy link
Contributor Author

w3c/webdriver#388 seems to address at least some of the issues with trying to test contenteditable. Setting the selection is a huge part of it, but also things like IME input, context menus, checking for wavy spell checker lines, have at least in the recent past been issues.

@johanneswilm
Copy link
Contributor Author

I'll create a new issue as part of this issue seems to not be relevant any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants