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

fix: handle case where karma is run in new window #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

radnan
Copy link

@radnan radnan commented Jan 26, 2021

If client.useIframe is set to false the test context is in a new window instead of an iframe. So we need to use the opener to get the original location to grab the browser ID, rather than parent.

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Bug fix
    Currently karma allows setting the client.useIframe configuration to false to run tests in a new window. But karma-parallel doesn't handle that case and skips sharding.

  • What is the current behavior? (You can also link to an open issue here)
    The current behavior is to try to fetch the browser ID from the parent window assuming current context is an iframe. But the context is actually a new window.

  • What is the new behavior (if this is a feature change)?
    The initializer will now honor the client.useIframe configuration and not skip sharding if it is set to false.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    No

  • Other information:
    N/A

instead of an iframe if client.useIframe is set to false the test context is in
a new window so we need to use the `opener` to get the original location to
grab the browser ID.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant