Move path option into tracing.start (#192)

This consolidates all the tracing options in the tracing.start()
This commit is contained in:
JoelEinbinder
2017-08-02 15:41:05 -07:00
committed by Andrey Lushnikov
parent 315c388f4d
commit 984e011cf0
3 changed files with 19 additions and 17 deletions

View File

@@ -73,8 +73,8 @@
+ [mouse.move(x, y)](#mousemovex-y)
+ [mouse.up([options])](#mouseupoptions)
* [class: Tracing](#class-tracing)
+ [tracing.start([options])](#tracingstartoptions)
+ [tracing.stop(path)](#tracingstoppath)
+ [tracing.start(options)](#tracingstartoptions)
+ [tracing.stop()](#tracingstop)
* [class: Dialog](#class-dialog)
+ [dialog.accept([promptText])](#dialogacceptprompttext)
+ [dialog.dismiss()](#dialogdismiss)
@@ -839,18 +839,18 @@ Dispatches a `mouseup` event.
You can use [`tracing.start`](#tracingstartoptions) and [`tracing.stop`](#tracingstoppath) to create a trace file which can be opened in Chrome DevTools or [timeline viewer](https://chromedevtools.github.io/timeline-viewer/).
```js
await page.tracing.start();
await page.tracing.start({path: 'trace.json'});
await page.navigate('https://www.google.com');
await page.tracing.stop('trace.json');
await page.tracing.stop();
```
#### tracing.start([options])
#### tracing.start(options)
- `options` <[Object]>
- `path` <[string]> A path to write the trace file to. **required**
- `screenshots` <[boolean]> captures screenshots in the trace.
- returns: <[Promise]>
#### tracing.stop(path)
- `path` <[string]> A path to write the trace file to.
#### tracing.stop()
- returns: <[Promise]>
### class: Dialog