Skip to content

Commit

Permalink
docs(README): add a debugging section (#2467)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanivefraim authored and aslushnikov committed Apr 30, 2018
1 parent e236887 commit afee010
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,27 @@ Explore the [API documentation](docs/api.md) and [examples](https://github.com/G

await page.evaluate(() => console.log(`url is ${location.href}`));

4. Enable verbose logging - All public API calls and internal protocol traffic
4. Stop test execution and use a debugger in browser

- Use `{devtools: true}` when launching Puppeteer:

`const browser = await puppeteer.launch({devtools: true});`

- Change default test timeout:

jest: `jest.setTimeout(100000);`

jasmine: `jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;`

mocha: `this.timeout(100000);` (don't forget to change test to use [function and not '=>'](https://stackoverflow.com/a/23492442))

- Add an evaluate statement with `debugger` inside / add `debugger` to an existing evaluate statement:

`await page.evaluate(() => {debugger;});`

The test will now stop executing in the above evaluate statement, and chromium will stop in debug mode.

5. Enable verbose logging - All public API calls and internal protocol traffic
will be logged via the [`debug`](https://github.com/visionmedia/debug) module under the `puppeteer` namespace.

# Basic verbose logging
Expand Down

0 comments on commit afee010

Please sign in to comment.