-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Canceled mousedown events causing blur #3200
Description
Bug report
Last week Firefox updated and stopped working with the older protractor we were using, so we updated. However, with the new protractor, a few of our previously passing tests are now failing because canceled mousedown events are being allowed to continue. I created a small test case on the page:
https://jsfiddle.net/vkdt0uu4/
On that page there is an input field and a button. If you focus the input field and then click on the button, there is some JavaScript that cancels the mousedown event on the button so that the field stays focused. This works when done by a real user. However, when I call click() on the button element in the test, the field still gets blurred. I don't know if this is an issue with protractor, selenium, or firefox, but I thought I would start here.
- Node Version:
v4.4.3
- Protractor Version:
3.3.0
- Browser(s):
firefox 45.1.0
- Operating System and Version
Red Hat Enterprise Linux Workstation release 6.7
- Your protractor configuration file
(none) - A relevant example test
protractor --browser firefox --specs bugSpec.js
bugSpec.js is:
describe('input field', function() {
it('should not lose focus when the button is clicked', function() {
browser.ignoreSynchronization = true;
browser.get('https://jsfiddle.net/vkdt0uu4/');
browser.switchTo().frame(browser.driver.findElement(by.tagName('iframe')));
browser.wait(function() {
return element(by.id('testfield')).isDisplayed();
});
element(by.id('testfield')).click();
expect(browser.driver.switchTo().activeElement().getAttribute('id')).toEqual('testfield');
element(by.id('testbutton')).click();
expect(browser.driver.switchTo().activeElement().getAttribute('id')).toEqual('testfield');
});
});
- Output from running the test
"Expected 'testbutton' to equal 'testfield'." (at line 12-- the second "expect") - Steps to reproduce the bug
protractor --browser firefox --specs bugSpec.js - The URL you are running your tests against (if relevant)
The test contains the relevant JSFiddle URL.