-
Notifications
You must be signed in to change notification settings - Fork 41
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
Move goja option parsing out of frame and page goto opts #1179
Conversation
f21de98
to
52c351a
Compare
opts := &common.FrameGotoOptions{ | ||
Timeout: common.DefaultTimeout, | ||
} |
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.
page.Goto
could implicitly set a default timeout. But I think this makes it explicit and less error-prone. WDYT?
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.
Yep, I was wondering the same. I went with the option of being explicit for now, and ensuring it matched the current behaviour. I think in a future refactor we can make it implicit.
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.
I'm on the side of keeping it explicit this way. This also gives transparent direct control to tests. Previously, we had our fair share of bugs because of time management and timeouts. Let's see :)
f1b5104
to
e04f7be
Compare
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.
LGTM 🚀
Why? - Train of calls make the code less readable and maintain. - This is a precursor for calling the methods from the mapping layer while parsing the options with defaults.
Areas to consider: - frame and page gotos go hand to hand. we had to refactor both. - explicitness tests must now set their timeout goto options explicitly this was implicit before, potentially dangerous and can easily lead to unexpected behavior.
- This prevents the train-of-calls issue. - It might make it easier to navigate within the code for new contributors.
e04f7be
to
c97d901
Compare
What?
frame
andpage
goto
to mapping.Referrer
andNavigationTimeout
for building options while mapping.Why?
See #1162 for the main reason. Also, the reason for doing both
frame
andpage
goto
options in the same PR is that the code doesn't compile without the other. Or, it would require a lot of intermediary steps which would be confusing for the commit log.Checklist
Related PR(s)/Issue(s)
Updates: #1176