You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
Plugin hooks onPageLoad, onPageStable, onPageLoad and onPageStable are all supposed to run against a specific ProtractorBrowser instance, not necessarily the global browser 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. So this.plugins_.onPageLoad() becomes this.plugins_.onPageLoad(this). The infrastructure for passing parameters this way is already built (the postTest 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:
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: