-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
allow setting panic func for browsers #433
Conversation
Btw. is there a nice way to retrigger the github actions without having to update the PR. I'm not sure whether this is testsuite. |
@ysmood I don't have sufficient permissions for it. |
I ended up repushing. |
I spend some time checking permission settings, seems like they don't have one for it. |
Ah, also, this should be ready for review. |
Great! Give some time to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, I'm not sure whether adding it to RaceContext, Mouse, Keyboard and Touch is necessary. But, I can remove them and call their associated page methods.
I think it's better to keep the same design as Context, for example, if a user wants to use a custom panic they can do this:
browser.WithPanic(Panic).Hijack()
The hijack can just use the e
from its internal browser object.
No need to do this:
browser.Hijack().WithPanic(Panic)
Yes, the design style is that use as few private states as possible. |
Hopefully, this is more aligned with what you had in mind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, almost there!
I think you forget to add the WithPanic
methods for Page
and Element
in the must.go
file?
This makes following use panic helper: * Mouse, Keyboard, Touch * RaceContext * HijackRouter, Hijack
This adds customizable panic to Browsers.
Note, I'm not sure whether adding it to RaceContext, Mouse, Keyboard and Touch is necessary. But, I can remove them and call their associated page methods.
For Pages, I needed to use the first pages
.e
rather than inherit it from the parents. Adding a.e
to that type, would make a backwards incompatible change toPages
type and make using it more annoying. So, I decided to go the easier route and fallback toutils.E
when there isn't a suitable page.Based on #428.
Fixes #424.