-
Notifications
You must be signed in to change notification settings - Fork 132
Description
Is your feature request related to a problem? Please describe.
Currently it is only possible to start trace when context is opened. Also trace is stopped when context is closed. There has been several discussions in Slack that user would like to control trace better. This is possible with Playwright Trace
Describe the solution you'd like
Create keyword which allows to stop and and start trace. In simplest form there could be two keywords this:
Test
Start Trace trace.zip
New Page ${URL}
Stop TraceThe downside seems to be, based on docs, that one can start and stop trace only one time.
Also we could expose other options from Trace, like chunks and options from trace. This allows to create multiple traces files inside of the same context. I think this would be even better.
Test 0
New Context
Test 1
Start Trace screenshots=True snapshots=False sources=True title=Some name
Start Trace Chunk trace1.zip
New Page ${URL}
Close Page
Stop Trace Chunk
Test 2
Start Trace Chunk trace2.zip
New Page ${URL}
Close Page
Stop Trace ChunkI am leaning towards the later way and exposing startChunk and stopChunk functionality from PW side. I am not sure without testing do we need in later case also the Stop Trace keyword, perhaps not. The later way gives better control for users and allows, for example, give trace a name based on the test. This allows finding the correct trace easier.