-
Notifications
You must be signed in to change notification settings - Fork 9.3k
feat(Page): Add global timeout setting #1728
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
Conversation
References #1514
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I signed the CLA. |
|
CLAs look good, thanks! |
|
Can you please eliminate the default 30000 timeout from the NavigatorWatcher? I'd do this by passing timeout explicitly to the NavigatorWatcher as one of the arguments in its constructor. |
Remove the default 30000 timeout from NavigatorWatcher and pass the timeout to the NavigatorWatcher constructor as a separate argument
|
I did it, but the AppVeyor build failed, and I can't figure out why that test failed. |
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.
@raduaron26 no worries about appveyour, some of our tests are flaky.
Thank you for working on this. I have a minor comment, other than that it's good to go.
test/test.js
Outdated
| }); | ||
|
|
||
| describe('Page.setDefaultNavigationTimeout', function() { | ||
| it('should work', async({page, server}) => { |
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.
We generally try hard not to reach out to private fields.
Let's drop this test – i think the other one you add is sufficient.
Remove unit test in which the _defaultNavigationTimeout private field is accessed
|
I removed the test. I'm glad I could contribute and thank you too for your help :) |
| * [page.select(selector, ...values)](#pageselectselector-values) | ||
| * [page.setContent(html)](#pagesetcontenthtml) | ||
| * [page.setCookie(...cookies)](#pagesetcookiecookies) | ||
| * [page.setDefaultNavigationTimeout(timeout)](#pagesetdefaultnavigationtimeouttimeout) |
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.
So this setting affects 5 methods: page.goto, page.goBack, page.goForward, page.reload and page.waitForNavigation.
Can you please:
- refer to the methods from the doc of the method, explaining that this method will change defaults for them, and that the default value is 30 seconds
- update documentation for the methods themselves, citing
page.setDefaultNavigationTimeout.
This should make it more understandable for our clients.
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.
@raduaron26 I've just figured there's one last nit for the documentation before this should be merged. Thanks again for taking your time for this
Update documentation regarding the page.setDefaultNavigationTimeout functionality
|
I updated the documentation, let me know if you want me to make any tweaks to what I wrote. |
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.
Thank you, this looks good.
This patch introduces `page.setDefaultNavigationTimeout` method to override the default 30 seconds navigation timeout. Fixes puppeteer#1514
|
@aslushnikov: This only affects navigation. waitForSelector() etc. should have a similar global "default" setting. Shall I write a feature request for this? |
|
@stackflows Did you write a feature request for this? This feature would be so precious. |
References #1514