Skip to content

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
Contributor

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
Contributor

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.

2 participants