question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(taken from https://github.com/gr2m/headless-chrome-test/issues/1)

Puppeteer should have an offline mode to test PWA’s. For example:

page.setOfflineMode(true);

Emulation of other network conditions might be useful as well, but we can wait with them until there are good scenarios.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

19reactions
aslushnikovcommented, Aug 16, 2017

wait, we still want to have page.setOfflineMode implemented 😃

2reactions
Garbeecommented, Aug 16, 2017

If you don’t want to run as root but still want to have some level of automated traffic shaping (even if low fidelity). Then what you’d want to do is setup a proxy for those tests. Do it where any tests that need throttling use an instance that is talking to your proxy that will handle the network manipulation. You’d pass the proxy in when launching an instance just like you would from the command line as an arg option.

let instance = puppeteer.launch({
  args: [
   '--proxy-server=127.0.0.1:9876', // Or whatever the address is 
  ]
});

This allows you to use other external tools to manage the network shaping. Such as Charles Proxy on Mac OS. Finding a good cross-platform solution for testing is difficult though, as Windows in particular is dramatically different to talk to.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Off-line emulators - RetroGames.cz
Here you can legally download emulators for off-line emulation of selected videogame consoles. Unlike online emulation, you can play all games in full ......
Read more >
Android emulator-5554 offline - Stack Overflow
The problem is when I try to install .apk files to the emulator using abd install <path> from the command prompt, it tells...
Read more >
How to effectively simulate "offline" mode in dev mode - help
I am writing some offline-first features for my app and I found, that it does not simulate the offline mode for the DDP...
Read more >
Network automation to emulate offline mode only works with ...
I can turn the offline mode using CDP and confirm the window.navigator. ... Network automation to emulate offline mode only works with ...
Read more >
How to Test Mobile Apps in Offline Mode | BrowserStack
Note that network simulation is not possible through other Emulators and Simulators, making BrowserStack the go-to platform for rigorous app ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found