Commit Graph

15 Commits

Author SHA1 Message Date
Dominik Deren
f8fbfe28fa
feat(trace viewer): Adds _debugName BrowserContextOption to let users define a name for their contexts (#5205)
This change is adding a new property on the BrowserContextOptions class called `_debugName`. This property allows defining a user-friendly name for the browser context, and currently it is being used in one place, the Trace Viewer. When user provides the new value in the following way:

```typescript
const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  const context = await browser.newContext({ _traceDir: __dirname, _debugName: 'My custom testcase name' });
  await context.close();
  await browser.close();
})();
```

The `_debugName` will be saved in the `*.trace` file for this browser context, on the `context-created` event, under the key `debugName`.

Later, when such a trace is displayed using Trace Viewer, the `debugName` will be displayed in the dropdown in the top right part of the app instead of the actual trace filename.

Fixes #5157.
2021-01-28 10:50:57 -08:00
Andrey Lushnikov
06f679b160
devops: mark another tracing test as fixme (#5201)
It was failing since a3af0829ff
2021-01-28 00:38:36 -08:00
Andrey Lushnikov
2a71165ed1
chore: disable failing tracing test (#5170)
The test constantly fails.
2021-01-27 22:31:46 -08:00
Dmitry Gozman
ce43e730f4
feat(traceviewer): use http server instead of interception (#5195)
This introduces an http server that serves our frontend and our snapshots. There is more work to untangle the big server into a few modules.

This change allows us:
- Maybe eventually serve the trace viewer as a web page.
- Rely on browser caches for fast snapshot rendering. This PR also adds "snapshot on hover" feature, subject to change.
2021-01-27 19:42:51 -08:00
Dominik Deren
a3af0829ff
feat(trace viewer): Extending existing NetworkTab view (#5009)
feat(trace viewer): Extending existing NetworkTab view

Currently the network tab contains a limited amount of information on the resources that were loaded in the browser. This change proposes extending the details displayed for each resource, to include:

- HTTP method,
- Full url,
- Easily visible response content type,
- Request headers,
- Request & response bodies.

Such level of information could help quickly understand what happened in the application, when it was communicating with backend services. This can help debug tests quicker to figure out why they are failing.

This implementation still needs some clean up & tests improvement, but I wanted to propose such changes and gather your feedback before going too far.
2021-01-26 11:06:05 -08:00
Dmitry Gozman
5033261d27
feat(trace): streaming snapshots (#5133)
- Instead of capturing snapshots on demand, we now stream them
  from each frame every 100ms.
- Certain actions can also force snapshots at particular moment using
  "checkpoints".
- Trace viewer is able to show the page snapshot at a particular
  timestamp, or using a "checkpoint" snapshot.
- Small optimization to not process stylesheets if CSSOM was not used.
  There still is a lot of room for improvement.
2021-01-25 18:44:46 -08:00
Andrey Lushnikov
b7fd0cd14c
test: disable trace test that always fails (#5124) 2021-01-23 04:27:16 +03:00
Pavel Feldman
4b5c876bbf
chore: allow opening empty trace viewer (#5080) 2021-01-20 19:16:23 -08:00
Dmitry Gozman
e3ebba5573
chore: cleanup code that is not used by cli anymore (#5005) 2021-01-13 17:02:53 -08:00
Pavel Feldman
0db09f8ed4
test: roll test runner to 0.9.20 (#4062) 2020-10-05 17:03:24 -07:00
Dmitry Gozman
4a77363af7
api: update videos api, hide tracing (#4015) 2020-10-01 11:06:19 -07:00
Dmitry Gozman
13d48da84a
test: record trace/videos on retries (#4009) 2020-09-30 16:52:21 -07:00
Pavel Feldman
de1e63dff1
test: roll test runner 0.9.16 (#3998) 2020-09-29 11:51:00 -07:00
Pavel Feldman
0ee9050f1b
chore: split playwright.fixtures into files (4) (#3985) 2020-09-26 10:59:27 -07:00
Dmitry Gozman
0ade6af689
api(trace): introduce artifacts options (#3914)
api(trace): introduce artifacts options

This introduces launch({ artifactsPath }) and newContext({ relativeArtifactsPath, recordTrace }) options.
- artifactsPath option controls the directory where all artifacts go. If not passed, artifacts are not collected.
- relativeArtifactsPath can be used to put context-specific artifacts into a subfolder. If not passed, shared artifactsPath is used.
- recordTrace controls trace recording.

We also expose trace types under playwright/types/trace.d.ts.

In the follow up:
- videos will be put into artifactsPath;
- downloads will be put into artifactsPath, or keep using existing downloadsPath when artifactsPath is not specified.
2020-09-18 11:54:00 -07:00