Skip to content
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

feat(Page): implement page.setOfflineMode #1032

Merged
merged 1 commit into from Oct 13, 2017

Conversation

aslushnikov
Copy link
Contributor

This patch implements page.setOfflineMode method.

Fixes #63.

This patch implements page.setOfflineMode method.

Fixes puppeteer#63.
await page.setOfflineMode(true);
let error = null;
await page.goto(EMPTY_PAGE).catch(e => error = e);
expect(error).toBeTruthy();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check error message here? Also what is the error here? Timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoelEinbinder it's currently "Failed to navigate!", since we don't report errors for now. It won't be a timeout though: it gonna be ERR_INTERNET_DISCONNECTED

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok good for now I guess. Would be nice to report a more descriptive error here. Also how do I automate the dino game? :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to report a more descriptive error here

Yes, hopefully it would be easier to do with plznavigate enabled.

@aslushnikov aslushnikov merged commit a02347e into puppeteer:master Oct 13, 2017
@aslushnikov aslushnikov deleted the offline branch October 17, 2017 17:18
ithinkihaveacat pushed a commit to ithinkihaveacat/puppeteer that referenced this pull request Oct 31, 2017
This patch implements page.setOfflineMode method.

Fixes puppeteer#63.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants