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

(tests): firefox doesn't fire focus/blur events in tests #2903

Closed
mmalerba opened this issue Feb 2, 2017 · 2 comments · Fixed by #2935
Closed

(tests): firefox doesn't fire focus/blur events in tests #2903

mmalerba opened this issue Feb 2, 2017 · 2 comments · Fixed by #2935
Assignees

Comments

@mmalerba
Copy link
Contributor

mmalerba commented Feb 2, 2017

Had to exempt firefox from tests added in ##2646 due to this issue. It seems to be a result of firefox not firing the events when it isn't the active window. I was able to reproduce by doing the following:

  1. patch Add directive to determine how elements were focused. #2646
  2. remove firefox exemption from tests
  3. switch local karma tests to use firefox
  4. start tests and click the firefox window to make sure its active as soon as it pops up
  5. tests pass
  6. start tests again, click away from the firefox window as soon as it pops up to make sure its inactive
  7. tests fail

The internet has some mentions of setting a firefox pref, focusmanager.testmode = true as a potential solution for this.

@crisbeto
Copy link
Member

crisbeto commented Feb 4, 2017

This seems to be an issue on Chrome 56 as well (at least locally).

devversion added a commit to devversion/material2 that referenced this issue Feb 4, 2017
On Saucelabs, browsers will run simultaneously and therefore can't focus all browser windows at the same time.
This is problematic when testing focus states. Chrome and Firefoxonly fire FocusEvents when the window is focused. This issue also appears locally.

Fixes angular#2903.
devversion added a commit to devversion/material2 that referenced this issue Feb 4, 2017
On Saucelabs, browsers will run simultaneously and therefore can't focus all browser windows at the same time.
This is problematic when testing focus states. Chrome and Firefoxonly fire FocusEvents when the window is focused. This issue also appears locally.

Fixes angular#2903.
devversion added a commit to devversion/material2 that referenced this issue Feb 4, 2017
On Saucelabs, browsers will run simultaneously and therefore can't focus all browser windows at the same time.
This is problematic when testing focus states. Chrome and Firefoxonly fire FocusEvents when the window is focused. This issue also appears locally.

Fixes angular#2903.
tinayuangao pushed a commit that referenced this issue Feb 8, 2017
* chore(focus-classes): fix failing tests when browser is blurred

On Saucelabs, browsers will run simultaneously and therefore can't focus all browser windows at the same time.
This is problematic when testing focus states. Chrome and Firefoxonly fire FocusEvents when the window is focused. This issue also appears locally.

Fixes #2903.

* Extract patch logic into extra function
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants