Skip to content

Commit afee010

Browse files
yanivefraimaslushnikov
authored andcommitted
docs(README): add a debugging section (#2467)
1 parent e236887 commit afee010

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,27 @@ Explore the [API documentation](docs/api.md) and [examples](https://github.com/G
194194

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

197-
4. Enable verbose logging - All public API calls and internal protocol traffic
197+
4. Stop test execution and use a debugger in browser
198+
199+
- Use `{devtools: true}` when launching Puppeteer:
200+
201+
`const browser = await puppeteer.launch({devtools: true});`
202+
203+
- Change default test timeout:
204+
205+
jest: `jest.setTimeout(100000);`
206+
207+
jasmine: `jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000;`
208+
209+
mocha: `this.timeout(100000);` (don't forget to change test to use [function and not '=>'](https://stackoverflow.com/a/23492442))
210+
211+
- Add an evaluate statement with `debugger` inside / add `debugger` to an existing evaluate statement:
212+
213+
`await page.evaluate(() => {debugger;});`
214+
215+
The test will now stop executing in the above evaluate statement, and chromium will stop in debug mode.
216+
217+
5. Enable verbose logging - All public API calls and internal protocol traffic
198218
will be logged via the [`debug`](https://github.com/visionmedia/debug) module under the `puppeteer` namespace.
199219

200220
# Basic verbose logging

0 commit comments

Comments
 (0)