This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Forked browsers execute plugins incorrectly #4054
Closed
Labels
Comments
sjelin
added a commit
to sjelin/protractor
that referenced
this issue
Feb 4, 2017
sjelin
added a commit
to sjelin/protractor
that referenced
this issue
Feb 4, 2017
heathkit
pushed a commit
that referenced
this issue
Feb 6, 2017
igniteram
pushed a commit
to igniteram/protractor
that referenced
this issue
Feb 21, 2017
1 task
1 task
bodyduardU
pushed a commit
to bodyduardU/protractor
that referenced
this issue
Dec 5, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Plugin hooks
onPageLoad
,onPageStable
,onPageLoad
andonPageStable
are all supposed to run against a specificProtractorBrowser
instance, not necessarily the globalbrowser
object. But these functions aren't being passed any information about what browser instance they're supposed to run against. Plugin authors generally just use the global browser object, which will execute plugins incorrectly on forked browsers.Luckily, this is extremely easy to fix. Just pass the
this
object when you call these plugin functions. Sothis.plugins_.onPageLoad()
becomesthis.plugins_.onPageLoad(this)
. The infrastructure for passing parameters this way is already built (thepostTest
hook uses it).I briefly considered sticking the
ProtractorBrowser
instance on the context object with all the utility functions, but I don't think that makes sense. You'd need multiple copies of the context object, one for each forked browser, and that could turn into a mess.The text was updated successfully, but these errors were encountered: