Commit Graph

843 Commits

Author SHA1 Message Date
Yury Semikhatsky
0f4b67bc6d
test(cli): setup files are in list-files and test --list output (#18890) 2022-11-17 16:31:04 -08:00
Pavel Feldman
4e58b0c2ea
chore: render timed out error message when expect timeouts (#18863)
Fixes https://github.com/microsoft/playwright/issues/18859
2022-11-16 17:00:42 -08:00
Yury Semikhatsky
05fb3e6de8
Revert "chore: hide TestProject.setup and TestInfo.storage (#18800)" (#18836)
Now that the patch has been cherry-picked to the release branch
reverting it on main.

This reverts commit 6deba5dc21.
2022-11-16 11:23:10 -08:00
Yury Semikhatsky
6deba5dc21
chore: hide TestProject.setup and TestInfo.storage (#18800) 2022-11-14 17:03:01 -08:00
Pavel Feldman
8e882fdd58
chore: make generated report writable (#18750)
Fixes: https://github.com/microsoft/playwright/issues/18747
2022-11-13 12:46:35 -08:00
Andrey Lushnikov
bc78db07df
chore: cut 1.28 branch (#18746) 2022-11-11 15:30:15 -08:00
Andrey Lushnikov
251cc9e229
chore: fix docs (#18751) 2022-11-11 13:44:40 -08:00
sand4rt
46559a37c1
fix(ct): setting ctTemplateDir does not work (#18152)
closes: https://github.com/microsoft/playwright/issues/18116
2022-11-11 09:52:39 -08:00
Andrey Lushnikov
26044c11c0
fix(webserver): do not spawn webserver as a new process group (#18564)
This patch stops using `processLauncher` to launch web servers. Process
Launcher
will spawn a new process group which is separate from test runner.

This might result in unexpected behavior, e.g. `kill -sigkill
-<testrunnerpid>` will orphan web server process.

Instead, this patch simply spawns web server and sends `SIGTERM` to it
when ready.
2022-11-10 22:30:06 -08:00
Andrey Lushnikov
f3a99fdd69
chore: address API review comments for the snapshotPathTemplate (#18716)
This patch:
- updates documentation to lead users from `TestConfig.snapshotDir` and
  `testInfo.snapshotSuffix` to `TestConfig.snapshotPathTemplate` as a
  better and more flexible alternative.
- drops `{snapshotSuffix}` from documentation
- stops using `snapshotSuffix = ''` in our own tests and switches us
  to the `snapshotPathTemplate`.
- adds `{testName}` token.
2022-11-10 17:23:57 -08:00
Chris Alley
1ec614bfc4
docs: fix grammar within class test API documentation (#18627) 2022-11-10 15:53:48 -08:00
Dmitry Gozman
194abc35cd
Revert #18561 "feat(test runner): test.reset() to reset options to default/config value" (#18704)
This reverts commit 6fef227f43.

Not shipping in 1.28.
2022-11-10 14:45:05 -08:00
Dmitry Gozman
6d456d30dc
docs: improve test.describe.configure() (#18705) 2022-11-10 12:29:38 -08:00
Andrey Lushnikov
f52fa4ceba
chore(snapshotPathTemplate): address review comments (#18702) 2022-11-10 11:37:41 -08:00
Andrey Lushnikov
6d491f928d
feat(playwright-test): introduce snapshotPathTemplate configuration (#18568)
This configuration option allows to set a string with template
values for precise control over snapshot path location.

An example of `snapshotPathTemplate` usage:

```ts
// playwright.config.ts
// Notice the `testDir` configuration!
export default {
  testDir: './tests',
  snapshotPathTemplate: './__screenshots__/{platform}/{projectName}/{testFilePath}/{arg}{ext}',
}
```

Currently supported "magic tokens" inside the `snapshotPathTemplate`
are:

- `{testDir}` - project's `testDir`
- `{snapshotDir}` - project's `snapshotDir`
- `{platform}` - `process.platform`
- `{projectName}` - Project's sanitized name
- `{testFileDir}` - Directories in relative path from `testDir` to test
  file path (e.g. `page/` in the example below)
- `{testFileName}` - Test file name (with extension) (e.g.
  `page-click.spec.ts` in the example below)
- `{testFilePath}` - Relative path from `testDir` to test file path
  (e.g. `page/page-click.spec.ts` in the example below)
- `{ext}` - snapshot extension (with dots)
- `{arg}` - joined snapshot name parts, without extension (e.g.
`foo/bar/baz` in the example below)
- `{snapshotSuffix}` - `testInfo.snapshotSuffix` value.

Consider the following file structure:

```
playwright.config.ts
tests/
└── page/
    └── page-click.spec.ts
```

The following `page-click.spec.ts`:

```ts
// page-click.spec.ts
import { test, expect } from '@playwright/test';

test('should work', async ({ page }) => {
  await expect(page).toHaveScreenshot(['foo', 'bar', 'baz.png']);
});
```

Fixes #7792
2022-11-09 15:29:07 -08:00
Andrey Lushnikov
9bcb28f25a
Revert "feat: send SIGTERM to webserver before SIGKILL'ing it. (#18220)" (#18661)
This reverts commit c63a0b536d.

Reason: https://github.com/microsoft/playwright/pull/18564
2022-11-09 09:18:33 -08:00
Pavel Feldman
b8bd4f7a48
chore: serialize config as a part of list-files (#18649) 2022-11-08 12:05:00 -08:00
Yury Semikhatsky
d5494edf71
feat(runner): TestOptions.storageStateName (#18587) 2022-11-07 16:27:38 -08:00
Yury Semikhatsky
25dc0bfacb
feat(runner): change storage fixture to TestInfo.storage() (#18584) 2022-11-04 14:28:25 -07:00
Dmitry Gozman
6fef227f43
feat(test runner): test.reset() to reset options to default/config value (#18561) 2022-11-04 09:03:29 -07:00
Yury Semikhatsky
c8cd07594c
feat(runner): initialize context.storageState from storage entry (#18549) 2022-11-03 14:20:39 -07:00
Xiaoxing Ye
9338355e47
feat(testinfo): add name to attachment output name (#18440)
Per discussion in #12950, adding sanitized name to the output filename
prefix. This can make debugging easier, and the filename structure more
human friendly.
2022-11-03 13:54:51 -07:00
Andrey Lushnikov
8538f61a72
feat(containers): implement global network tethering for playwright server (#17719)
This patch implements a new mode of network tethering for Playwright
server & its clients.
With this patch:
- playwright server could be launched with the
`--browser-proxy-mode=tether` flag to engage in the new mode
- a new type of client, "Network Tethering Client" can connect to the
server to provide network traffic to the browsers
- all clients that connect to the server with the `x-playwright-proxy:
*` header will get traffic from the "Network Tethering Client"

This patch also adds an environment variable
`PW_OWNED_BY_TETHER_CLIENT`. With this env, playwright server will
auto-close when the network tethering client disconnects. It will also
auto-close if the network client does not connect to the server in the
first 10 seconds of the server existence. This way we can ensure that
`npx playwright docker start` blocks terminal & controls the lifetime of
the started container.
2022-11-03 13:47:51 -07:00
Yury Semikhatsky
45aa82242d
feat(runner): storage fixture (#18522) 2022-11-02 20:22:35 -07:00
Andrey Lushnikov
c3cff485d1
feat(html): add --host and --port to the show-report command (#18517)
This enables serving HTML report from inside docker container.

Drive-by: restore default HTML serving port to 9323. This was
accidentally changed in 1.27 and mentioned in

https://github.com/microsoft/playwright/issues/16667#issuecomment-1269861623
2022-11-02 15:12:48 -07:00
Yury Semikhatsky
1d2fc1e963
feat(runner): project.setup (#18486) 2022-11-01 23:44:30 -07:00
Pavel Feldman
2183d9e9a2
chore: use codemirror for editor (#18482) 2022-11-01 15:04:30 -07:00
Yury Semikhatsky
7337dd4e28
chore: revert project.{stage,run} (#18462) 2022-10-31 14:04:24 -07:00
sand4rt
fbfec18678
fix(ct): vite base url (#17767) 2022-10-31 12:58:07 -07:00
Pavel Feldman
a7f5f2d7a1
chore: allow not overriding media when creating context (#18413) 2022-10-31 09:09:52 -07:00
Dmitry Gozman
2d3b2a0768
feat(test runner): test.describe.configure({ retries, timeout }) (#18388)
References #10825.
2022-10-27 15:53:27 -07:00
Pavel Feldman
db456a020c
chore: do not point to node_modules in code frames (#18358)
Fixes https://github.com/microsoft/playwright/issues/18330
2022-10-26 15:18:31 -07:00
Yury Semikhatsky
63c41f88cd
chore: remove stale TODOs (#18331) 2022-10-25 15:21:04 -07:00
Max Schmitt
ffc47271f2
fix(junit): escape null control character (#18325)
Fixes https://github.com/microsoft/playwright/issues/18322
2022-10-25 14:39:16 -07:00
Dmitry Gozman
caa9c6a597
fix(test runner): make sure soft expect error does not mask a timeout flag (#18321)
We have to reliably know whether test timed out or not, and soft expect
error could have marked it with `status=failed` but it would still time
out. Now we have a separate `_didTimeout` flag for this.

Fixes #18023.
2022-10-25 12:34:15 -07:00
Pavel Feldman
ab78865a8d
chore: render steps in list reporter (#18269) 2022-10-24 15:54:53 -07:00
Andrey Lushnikov
c63a0b536d
feat: send SIGTERM to webserver before SIGKILL'ing it. (#18220)
We now will send `SIGTERM` to the webserver and wait for the `timeout`
before sending `SIGKILL` to it.

Fixes #18209
2022-10-21 08:55:06 -07:00
Pavel Feldman
5b1e4e08a5
chore: detect browser reuse based on the connection headers (#18230) 2022-10-20 18:30:37 -07:00
Sean Killeen
7ae447ea0f
docs: fix typos (#17919) 2022-10-20 13:46:37 -07:00
Pavel Feldman
fb643940e5
chore: resolve filename in the resolution hook (#18221) 2022-10-20 13:30:34 -07:00
Pavel Feldman
fb9555fb5d
fix(ts): resolve .js to .ts in non-ESM mode too (#18219)
Fixes https://github.com/microsoft/playwright/issues/18077
2022-10-20 12:21:22 -07:00
Pavel Feldman
ad9729f246
chore: respect tsconfig paths in js files (#18191)
Fixes: https://github.com/microsoft/playwright/issues/17804
2022-10-19 19:38:14 -07:00
Max Schmitt
af38449f42
fix(pwtest): fix focused line with dirname specified (#18189) 2022-10-19 15:05:59 -07:00
Dmitry Gozman
9fe72a1da8
fix(test runner): remove unused type imports during transform (#18157)
Fixes #18117.
2022-10-19 13:06:11 -07:00
Yury Semikhatsky
11eb719d13
feat(runner): project run: "always" (#18160)
Projects marked with `run: 'always'` are non shard-able and run after
failures.
2022-10-18 17:18:45 -07:00
Pavel Feldman
7ab4c17519
chore: support jsx/tsx syntax in test files (#18123)
Fixes https://github.com/microsoft/playwright/issues/17964
2022-10-18 12:45:33 -07:00
Yury Semikhatsky
08a3a269cd
feat(runner): project.canShard (#18037) 2022-10-12 14:34:22 -07:00
Yury Semikhatsky
3b8f63d703
feat(runner): project.stopOnFailure (#18009) 2022-10-11 17:04:01 -07:00
Pavel Feldman
d5c4291a89
chore: don't fail on undefined video/trace (#17999)
Fixes #17396
2022-10-11 10:10:43 -07:00
sand4rt
1a43af3fb6
feat(ct): rerender to update (#17972) 2022-10-10 19:56:33 -07:00
Yury Semikhatsky
3592269caf
feat(runner): project.stage (#17971) 2022-10-10 17:56:18 -07:00
Yury Semikhatsky
2d72d0ba03
chore: remove config.groups (#17974) 2022-10-10 16:42:48 -07:00
sand4rt
c889b2ad26
feat(ct): vue3 rerender complete (#17069) 2022-10-06 15:07:32 -07:00
Pavel Feldman
c0e4caa604
fix(esm+tsconfig): allow mapped ts files in esm mode (#17862)
Fixes https://github.com/microsoft/playwright/issues/17840
2022-10-05 18:00:49 -07:00
Dmitry Gozman
ed6ecbca2a
chore: cut v1.27.0 (#17859) 2022-10-05 15:30:35 -07:00
Dmitry Gozman
6750a02506
fix(api): hide TestConfig.groups (#17853)
Also fix types for `FullConfig.configFile`.
2022-10-05 14:24:14 -07:00
Dmitry Gozman
30179d4d78
fix(tsconfig): remove TS_NODE envs, update docs (#17847)
References #17469.
2022-10-05 12:51:12 -07:00
Dmitry Gozman
2bcd9ce9ae
chore: internal selectors (#17827)
- Rename internal selectors `has`, `control` and `attr` to
`internal:has`, `internal:control` and `internal:attr`.
- Fix `getByLabel()` to respect strictness, by introducing
`internal:label` selector.
- Move tests essential for ports to `selectors-by.spec`.
2022-10-05 08:45:10 -07:00
Pavel Feldman
8810b55504
feat(api): shorted getByLabel, getByPlaceholder (#17816) 2022-10-04 10:29:26 -07:00
Dmitry Gozman
b07690f408
docs: use getBy... in documentation (#17795) 2022-10-03 17:02:46 -07:00
Yury Semikhatsky
ef32cab423
chore: turn RunPhase in a class with helper methods (#17721) 2022-09-30 09:12:06 -07:00
Han Yeong-woo
ce2ded1f7e
docs(assertions): fix wrong link (#17733) 2022-09-30 11:07:14 +02:00
Yury Semikhatsky
51966bc045
fix: --grep and --grep-invert should intersect with config (#17716)
Fixes https://github.com/microsoft/playwright/issues/17405
2022-09-29 16:39:21 -07:00
Pavel Feldman
a97deb1600
chore: hide reporter project id (#17710) 2022-09-29 12:51:06 -07:00
Yury Semikhatsky
43ccd7bc96
chore(runner): remove watch mode (#17682) 2022-09-29 10:20:21 -07:00
Yury Semikhatsky
9f17ee6871
feat: group filter (#17646) 2022-09-28 18:45:01 -07:00
Pavel Feldman
d8f67eb75d
feat(api): introduce getByTestId (#17645) 2022-09-27 21:06:07 -07:00
Pavel Feldman
8ad201b802
chore: add snippet to the json report (#17567) 2022-09-27 13:23:08 -07:00
Dmitry Gozman
3409a37f77
feat: allow opening multiple html reporters and trace viewers (#17636)
This makes `HttpServer` accept `preferredPort` option that will first
try to listen on that port, and if that port is already in use, listen
on some available port instead.

Fixes #17201.
2022-09-27 12:45:42 -07:00
Pavel Feldman
3a13a897b9
Revert "fix(pwt): compatibility in CWD with wrong casing (#16636)" (#17599) 2022-09-26 18:53:08 -07:00
Ross Wollman
e73676d094
fix(reporters): output relative to config (#17518)
Fixes #17412.
Supercedes #17413.

- if configured via playwright.config.ts, relative paths should be
relative to the config.
- if configured via env var, should be relative to `cwd`
2022-09-26 11:01:43 -07:00
Andrey Lushnikov
ec40e49978
feat: expose configuration for HTML report serving. (#17560)
Fixes #16667
2022-09-25 20:36:38 -07:00
Yury Semikhatsky
10d7c60abf
feat(runner): project execution schedule (#17548) 2022-09-23 20:01:27 -07:00
Dmitry Gozman
f17d345ac9
fix(ct): support empty fragments (#17475)
Currently, we ues `#root` vs `#root > *` selector for component roots
depending on the number of root children. This heuristic detects
fragments that render multiple elements inside the root.

However, this does not work with empty fragments that do not render
anything.

The fix is to make the `#root >> control=component` selector that would
dynamically detect the root. This supports empty fragments and also
allows for dynamic updates of the fragments.
2022-09-21 15:12:18 -07:00
Andrey Lushnikov
d431958603
chore: move container integration back to playwright-core (#17487) 2022-09-21 12:45:43 -07:00
Jean-François Greffier
a15fe50e7b
feat(test runner): workers as percentage (#17400)
Allows to set workers as a percentage of logical CPUs, for example
"50%".

Examples :
```bash
npx playwright test --workers 3
npx playwright test --workers 50%
```

```js
const config: PlaywrightTestConfig = {
  // ...
  workers: '33%',
}
```
2022-09-21 11:17:36 -07:00
Dmitry Gozman
da7feb9cc6
fix(esm): silence warning when running with experimental loader (#17493)
Unfortunately, this silences all warnings, not just the experimental
loader warning.
2022-09-21 10:56:17 -07:00
Pavel Feldman
df143031e7
chore: move protocol and trace types into the top-level packages (#17486) 2022-09-20 18:41:51 -07:00
Bastian
29ff00ead2
docs(cli): typo in --debug flag (#17455) 2022-09-20 14:00:59 +02:00
Pavel Feldman
e9f926e536
fix(docker): do not sync primary selection into clipboard (#17424) 2022-09-19 06:08:40 -07:00
Yury Semikhatsky
ee83694372
chore(runner): remove unnecessary traversal (#17415) 2022-09-16 15:45:52 -07:00
Ross Wollman
8d639ae50e
chore: revert toHaveAttribute type sig and overloads (#17406)
Relates #16517.

Revert "docs(python): add missing NotToHaveAttribute overloads (#17371)"

This reverts commit 2e1ea29614.

Revert "docs(release-notes): add 1.26 release notes for language ports
(#17345)"

This reverts commit 4b8a85e69d.

Revert "test: unflake "should support boolean attribute with options"
(#17024)"

This reverts commit 1dc05bd4c6.

Revert "fix: support toHaveAttribute(name, options) (#16941)"

This reverts commit f30ac1d678.

Revert "feat: expect(locator).toHaveAttribute to assert attribute
presence (#16767)"

This reverts commit 622c73cc1e.
2022-09-16 11:17:35 -07:00
Pavel Feldman
a6d9aa8708
fix(docker): use config to set up walpaper (#17399) 2022-09-16 09:27:59 -07:00
Andrey Lushnikov
24d3a23a66
fix(docker): handle container name conflict usecase. (#17379)
Drive-by: typo in the JSON docker status field.
2022-09-15 16:59:41 -07:00
Pavel Feldman
872bcc9734
chore: expose driver protocol on the pw object (#17363) 2022-09-15 15:53:18 -07:00
Andrey Lushnikov
b09ea69024
chore(docker): address docker offline comments (#17377)
This patch:
- Removes all `process.exit(1)` from `docker.ts` and instead throws
  errors.
- Drops the `npx playwright docker test` command. We agreed to
  engage docker when `PLAYWRIGHT_DOCKER` environment variable
  is set.
- Introduces hidden `npx playwright docker status` command that
  dumps a JSON with docker status:
  ```sh
  aslushnikov:~/prog/playwright$ npx playwright docker status
  {
    "dockerEngineRunning": true,
    "imageName": "playwright:local-1.27.0-next-focal",
    "imageIsPulled": true,
"containerWSEndpoing":
"ws://127.0.0.1:55077/eafeb84c-571b-4d12-ac51-f6a2b43e9155",
"containerVNCEndpoint":
"http://127.0.0.1:55076/?path=fb6d4add-9adf-4c3c-b335-893bdc235cd7&resize=scale&autoconnect=1"
  }
  ```
2022-09-15 15:48:12 -07:00
Pavel Feldman
30ff27843a
chore: rebuild components on new vite (#17367) 2022-09-15 15:24:01 -07:00
Andrey Lushnikov
8466c436c9
fix(list reporter): properly count new lines for long stdout (#17339) 2022-09-14 15:25:24 -07:00
Pavel Feldman
854c783019
chore: project.id, configFile in reporter apis (#17346) 2022-09-14 14:56:28 -07:00
Max Schmitt
4b8a85e69d
docs(release-notes): add 1.26 release notes for language ports (#17345) 2022-09-14 22:38:19 +02:00
Andrey Lushnikov
e295eea450
fix(ignoreSnapshots): print a notice when ignoreSnapshots option is on (#17317)
<img width="1161" alt="image"
src="https://user-images.githubusercontent.com/746130/190032155-ae454c3e-1a7d-4a64-8cd6-bb27f9075ef3.png">
2022-09-14 09:16:41 -07:00
Andrey Lushnikov
210f7b2203
fix(docker): stop containers started with npx playwright docker start (#17316)
This patch makes `npx playwright docker stop` command to stop
containers that were launched with previous playwright version.
2022-09-13 17:08:01 -07:00
Andrey Lushnikov
dfcd2a273d
fix(docker): do not pollute stdout when used with JSON reporter (#17315)
This patch moves parts of docker configuration to a plugin so that
it can rely on repoter for stdout.

Drive-by: provide all plugins with reporter in the `setup` callback.
2022-09-13 17:05:37 -07:00
Andrey Lushnikov
881f3101bd
chore(docker): consolidate docker code (#17314)
This patch consolidates all of docker implementation under the
`docker/` folder.
2022-09-13 16:14:49 -07:00
Andrey Lushnikov
4f11a4d5e7
feat(docker): use the __screenshots__ dir for snapshots by default (#17311)
This patch opts into the `__screnshots__` folder snapshot management
for docker.

With this patch, docker-originating snapshots will be stored in the
following folder:

```
{testDir}/__screenshots__/{projectName}/{testFilePath}/{snapshotName}
```

Where `{testFilePath}` is a test file path relative to `testDir`

Drive-by: introduce and document the `PLAYWRIGHT_DOCKER` environment
variable that enables docker integration.
2022-09-13 15:49:04 -07:00
Andrey Lushnikov
705bc28e92
feat(docker): auto-bind container ports to host ports (#17307)
Drive-by: make sure docker container does not expose ports on `0.0.0.0`
and instead registers to localhost. This way websocket and vnc ports
are not exposed to the public internet.
2022-09-13 13:23:04 -07:00
Andrey Lushnikov
ebfefefc8e
chore: refactor docker integration code (#17297)
This patch splits out `dockerApi` namespace that is solely
responsible for docker API manipulation.
2022-09-13 10:55:11 -07:00
Andrey Lushnikov
8640d29ce4
chore(docker): address review comments (#17279)
Co-authored-by: Ross Wollman <rwoll@users.noreply.github.com>
2022-09-13 05:55:26 -07:00
Andrey Lushnikov
bc942ef9ea
chore: cut v1.26.0 (#17265) 2022-09-12 10:45:27 -07:00
Andrey Lushnikov
af042beb13
feat: introduce docker integration (#16382)
This patch introduces the following commands:
- `npx playwright docker build` that builds a VRT docker image
  locally that is based off the `mcr.microsoft.com/playwright:jammy`
- `npx playwright docker start` that launches a docker container with
  browsers.
- `npx playwright docker stop` that stops given docker container.
- `npx playwright docker test` that runs all the tests inside a
  launched docker container.
2022-09-09 15:25:42 -07:00
Dmitry Gozman
fa7caf4193
feat(cli): remove -i (#17229) 2022-09-09 15:07:15 -07:00
Dmitry Gozman
bca13bc35a
feat(assertions): support toBeVisible({ visible }) (#17207) 2022-09-09 08:33:23 -07:00
Pavel Feldman
c91df61ca3
chore: optionally connect instead of launching (#17174) 2022-09-07 15:57:20 -07:00
Pavel Feldman
8d25f2ef59
fix(selectors): allow custom engines in out-of-process (#17139) 2022-09-06 14:15:53 -07:00
Dmitry Gozman
f0c5810609
feat(assertions): support toBeEditable({ editable }) (#17065) 2022-09-06 12:50:45 -07:00
Dmitry Gozman
306ab34aa3
feat(assertions): support toBeEnabled({ enabled }) (#17058) 2022-09-06 11:40:34 -07:00
Ross Wollman
c58bfd0552
fix(html-reporter): duplicate attachment name (#16929)
Fixes #16456.

The extra span/name was coming from
077b8a9289/packages/html-reporter/src/links.tsx (L72)
(in conjunction with the line above it).

These two lines assume `path` and `body` are mutally exclusive.

Regression likely introduced by the PR that added the now removed line #10778.
2022-09-03 15:25:56 -07:00
Dmitry Gozman
1dc2a33896
docs: clarify that toBeHidden works when nothing matches (#17057) 2022-09-02 16:36:19 -07:00
Andrey Lushnikov
fafd9837ba
feat: introduce the --ignore-snapshots option (#17004)
This patch introduces `--ignore-snapshots` Playwright Test CLI option,
and `ignoreSnapshots` configuration argument.
2022-09-01 05:34:36 -07:00
Andrey Lushnikov
38f2a5d5f5
fix: include headlessness as a launch argument to browser (#16898) 2022-08-31 10:26:13 -07:00
nate-ro
409bab59ea
chore: added starting time of test to the base json reporter (#16885) 2022-08-30 20:03:21 -07:00
Yury Semikhatsky
f30ac1d678
fix: support toHaveAttribute(name, options) (#16941) 2022-08-30 17:53:00 -07:00
Yury Semikhatsky
11dfd31dd9
feat: --pass-with-no-tests option (#16902) 2022-08-29 15:46:34 -07:00
Andrey Lushnikov
622c73cc1e
feat: expect(locator).toHaveAttribute to assert attribute presence (#16767)
This patch changes `expect(locator).toHaveAttribute()` so that the
`value` argument can be omitted. When done so, the method will
assert attribute existance.

Fixes #16517
2022-08-25 05:28:34 -07:00
Max Schmitt
9341bf12c6
docs(dotnet): enable api response assertions (#16799) 2022-08-24 08:30:47 -07:00
Pavel Feldman
4d892475da
chore: do not use experimental loader for web server (#16733) 2022-08-23 10:22:05 -07:00
Pavel Feldman
d7be1fcca8
fix(esm): allow importing ts from esm (#16735) 2022-08-23 10:20:56 -07:00
Max Schmitt
e344fe60e7
fix(pwt): compatibility in CWD with wrong casing (#16636) 2022-08-22 21:45:59 +02:00
Sergio Freire
abe7cf23a7
fix(junit reporter): remove source location from classname attribute (#16499) 2022-08-19 16:42:21 -07:00
Max Schmitt
7e2aec7454
chore: align more ESLint rules with VSCode formatting (#16647) 2022-08-18 20:12:33 +02:00
sand4rt
d9850e0e86
feat(ct): react rerender (#16560) 2022-08-16 10:47:33 -07:00
Pavel Feldman
e64b09cc28 Revert "feat(ct): react rerender (#16549)"
This reverts commit a62accf8ae.
I'll reapply them in order.
2022-08-15 13:17:15 -07:00
sand4rt
a62accf8ae
feat(ct): react rerender (#16549) 2022-08-15 13:10:38 -07:00
Pavel Feldman
bd06d1604f
chore: render original exception location in error frame (#16515) 2022-08-15 09:28:55 -07:00
Elizaveta Bezyaikna
9f22ae9aa9
chore: add id for each test to JSONReporter (#16494) 2022-08-15 09:28:21 -07:00
Pavel Feldman
e1d3246d1c
fix(ct): pass local config to preview (#16481) 2022-08-12 10:37:35 -07:00
Johannes Loher
3e67a7c836
feat(plugins): send accept header in webServer url checking (#16251) 2022-08-10 12:48:37 -07:00
Yury Semikhatsky
d0030a7434
docs: test.step return value (#16421) 2022-08-10 11:21:13 -07:00
Dmitry Gozman
baa2ef2700
fix(test runner): show interrupted as yellow (#16396)
Drive-by: fix unreadable character in "duplicate titles" error.
2022-08-09 21:17:30 -07:00
Dmitry Gozman
f58c376443
fix(test runner): do not resolve relative imports through baseUrl (#16395) 2022-08-09 21:16:27 -07:00
Andrey Lushnikov
0c7f086096
chore: cut v1.25 branch (#16390) 2022-08-09 17:09:58 -07:00
Dmitry Gozman
2efe947dc8
chore: avoid evaluates in screenshot on failure (#16386) 2022-08-09 14:03:07 -07:00
Max Schmitt
e725b5f8a9
fix(esm): fix TS type check with NodeNext mode (#16340) 2022-08-09 20:06:06 +02:00
Kian-Meng Ang
22f0723c72
docs: fix typos in docs (#16370)
Co-authored-by: Debbie O'Brien <debs-obrien@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-08-09 15:47:17 +02:00
Jeremy Daley
ee02afdd9b
chore: add fallback "default" key to "." exports object (#16350)
Fixes #16345.
2022-08-08 12:19:15 -07:00
Pavel Feldman
a2e05bb419
fix(ct): use stoppable server (#16329) 2022-08-08 08:54:56 -07:00
Dmitry Gozman
f6d94f0ac9
chore: update "X fatal errors" message (#16325)
Also, exlude certain errors from triggering this message:
- `no tests found`
- `duplicate test titles are not allowed`
- `--forbid-only found a focused test`
- `Timed out waiting 3600s for the entire test run`
2022-08-05 21:21:43 -07:00
Dmitry Gozman
7a86e140f5
chore: remove TestProject.projectSetup (#16321)
There are better ideas to address this issue in more general manner.
2022-08-05 15:24:30 -07:00
Dmitry Gozman
1f40e3d22b
chore: make Reporter.onExit an internal method (#16280) 2022-08-05 13:41:00 -07:00
Dmitry Gozman
424431fcfe
docs: explain toHaveText and toContainText in more details (#16283) 2022-08-05 10:27:17 -07:00
Dmitry Gozman
cb30cb4eb7
feat(test runner): add --trace cli option (#16277) 2022-08-05 09:20:39 -07:00
Dmitry Gozman
919b1cbb22
fix(test runner): do not swallow afterEach errors after skipped tests (#16276)
Drive-by: add more test runner logging.
2022-08-04 18:49:23 -07:00
Pavel Feldman
3aa5710b49
feat(reuse): retain different browser types when reusing (#16269) 2022-08-04 15:04:00 -07:00
sand4rt
bd5eddd62e
fix(ct): multi root vue components (#16211) 2022-08-04 10:43:43 -07:00
Pavel Feldman
7645ac25a0
chore: watch mode straw man (#16127) 2022-08-04 08:09:54 -07:00
sand4rt
e5cc78af67
chore(ct): change setProps to rerender (#16204) 2022-08-03 18:14:00 -07:00
Pavel Feldman
8eca6339c2
feat(reuse): account for the browser launch args when reusing the bro… (#16229)
feat(reuse): account for the browser launch args when reusing the browsers
2022-08-03 17:32:29 -07:00
Dmitry Gozman
03fe75251b
fix(test runner): show tests as interrupted when maxFailures stops them (#16178)
Previously, we marked these tests as skipped, and it was sometimes
confusing, because they did actually run and produce some output/artifacts.
2022-08-03 15:25:25 -07:00
Dmitry Gozman
445fe032f5
feat(test runner): separate interrupted status from skipped (#16124) 2022-08-02 12:55:43 -07:00
Pavel Feldman
de147fafba
chore: experimental project isolation mode (#16081) 2022-08-02 11:22:22 -07:00
Dmitry Gozman
5481e25015
chore: print full stacks when PWDEBUGIMPL is set (#16113)
For debugging purposes, especially on the client's computers.
2022-08-01 13:44:59 -07:00
Dmitry Gozman
3112edb4ca
feat(test runner): TestProject.projectSetup (#16063)
`projectSetup` is a project-scoped alternative to `globalSetup`.
It is only executed if at least one test from the project is scheduled to run.
2022-08-01 09:01:23 -07:00
Pavel Feldman
5a79054544
feat(innerloop): allow reusing browsers over the remote connection (#16065) 2022-07-31 14:31:17 -07:00
sand4rt
557db4c35e
chore(ct): mount result refactor (#16067) 2022-07-29 20:07:23 -07:00
Yury Semikhatsky
7d306bbc66
feat: return value from step (#16060) 2022-07-29 15:16:07 -07:00
Dmitry Gozman
e830fe821d
feat(test runner): introduce test.describe.fixme (#16059) 2022-07-29 12:44:22 -07:00
Yury Semikhatsky
af8e3e7afa
feat: print response text when toBeOK fails (#16040) 2022-07-29 11:46:48 -07:00
sand4rt
4a47e275c8
feat(ct): vue set props (#16058) 2022-07-29 11:45:06 -07:00
Pavel Feldman
d73f9b7b88
chore: experimental test server implementation (#16033) 2022-07-29 11:40:33 -07:00
Dmitry Gozman
62e4e80599
feat(test runner): show the number of fatal errors at the end (#15975) 2022-07-28 14:46:21 -07:00
Max Schmitt
a089bf3df5
chore(test-runner): better error message if page gets used inside beforeAll (#16012) 2022-07-28 23:07:28 +02:00
Dmitry Gozman
3d89506704
fix(fixtures): make undefined option mean "default value" (#16026)
In the following example, `locale` inside the `describe`
would be reverted to the default value:

```js
test.use({ locale: 'en-GB' });

test.decsribe(() => {
  test.use({ locale: undefined });
});
```
2022-07-28 12:57:05 -07:00
Pavel Feldman
8c190c3e09
feat(testId): expose persistent test id (#16003) 2022-07-27 20:17:19 -07:00
Pavel Feldman
2eff208e54
feat(ct): allow unmounting components (#15974) 2022-07-27 15:12:36 -07:00
Max Schmitt
f663e5d6cc
chore: fix tests when repo checkout was not playwright (#15994) 2022-07-27 18:09:55 +02:00
Dmitry Gozman
6009804e0e
Revert "fix(test runner): ignore undefined values in fixtures definit…ions (#15119)" (#15979)
Revert "fix(test runner): ignore undefined values in fixtures definitions (#15119)"

Revert commit d7b63fa0b4.
Add a test for the broken behavior.
2022-07-27 08:51:45 -07:00
Dmitry Gozman
cd9dccbe27
fix(test runner): serial suites inside parallel suite should run in parallel (#15769) 2022-07-26 13:38:25 -07:00
Dmitry Gozman
c0d78c5642
fix(runner): friendly error message instead of "digests do not match" (#15939) 2022-07-26 08:53:32 -07:00
Dmitry Gozman
9ce727c936
feat(list reporter): number test runs to see testing progress (#15693)
Drive-by: replace a few colors.gray with colors.dim for better contrast.
2022-07-25 13:22:25 -07:00
Dmitry Gozman
f88b1e9cde
feat(reporters): separate onExit from onEnd (#15926)
This is now used by html reporter to open UI.
2022-07-25 13:20:33 -07:00
Max Schmitt
004cd9273c
fix(test-runner): multiple webServer types (#15901) 2022-07-25 10:39:06 +02:00
Dmitry Gozman
f954891491
fix(runner): globalTeardown without globalSetup should work (#15814) 2022-07-20 12:41:35 -07:00
Max Schmitt
507e921371
chore: bump 'ip' peer dependency (#15750) 2022-07-18 20:04:26 +02:00
Dmitry Gozman
a56d801352
fix(test runner): show fixture name when worker times out (#15724) 2022-07-15 13:05:48 -07:00
Yury Semikhatsky
582b5e08b2
docs: clarify toHaveURL parameter semantics (#15723) 2022-07-15 11:09:20 -07:00
Dmitry Gozman
da2fdc2e2e
fix(esm loader): support Node 18.6 (#15694)
A small change in the API requires `shortCircuit: true` when returning the
transformed source.
Another API change removes third argument from the chained resolve/load,
but passing three instead of two still works.
2022-07-14 19:10:39 -07:00
Max Schmitt
4bba41ab8f
Revert "feat(matchers): add toContainClass (#15491)" (#15670)
This reverts commit e4debd0bf6.
2022-07-14 22:03:37 +02:00
Andrey Lushnikov
df9beb4045
chore: cut v1.24 (#15654) 2022-07-14 09:42:40 -07:00
Pavel Feldman
d02914fa3a
chore: relax transpilation criteria to allow ems imports of .vue files (#15592) 2022-07-13 16:11:38 -07:00
Dmitry Gozman
22ead7b5ab
Revert "fix(test runner): handle istty in line reporter (#15455)" (#15633)
This reverts commit 767babc3a2.
2022-07-13 15:11:56 -07:00
Dmitry Gozman
51c3ea55ed
Revert "feat(line reporter): show testing progress (#15547)" (#15631)
This reverts commit e76d9b3b28.
2022-07-13 13:54:26 -07:00
Max Schmitt
ee7d60fcee
docs: migrate page actions to locator actions 2/n (#15603) 2022-07-13 11:50:18 +02:00
Pavel Feldman
00848b1bcf
fix(ct): restore public folder deployment (#15594) 2022-07-12 16:14:48 -07:00
Yury Semikhatsky
a6daf600a9
fix: support hasColors and getColorDepth in worker (#15590) 2022-07-12 14:47:14 -07:00
Pavel Feldman
3939b9f36e
chore: migrate component testing to server-side page reuse (#15477) 2022-07-12 14:30:24 -07:00
Max Schmitt
e4debd0bf6
feat(matchers): add toContainClass (#15491) 2022-07-12 23:17:10 +02:00
Pavel Feldman
f3d3231b29
feat(ct): allow configuring apps per test (#15551) 2022-07-12 09:37:33 -07:00
Dmitry Gozman
64353c4b96
fix(test runner): make sure worker cleans up if last test was skipped (#15552) 2022-07-11 21:33:56 -07:00
Dmitry Gozman
e76d9b3b28
feat(line reporter): show testing progress (#15547)
Line reporter now shows stats in addition to the test name:
```
[chromium] › page/page-click-react.spec.ts:108:1 › should not retarget when element changes on hover
[21/93] Passed: 17 Flaky: 0 Failed: 0 Skipped: 4 (7s)
```
2022-07-11 20:44:50 -07:00
Dmitry Gozman
7727ebe758
feat(html report): improve test list view (#15543)
- Two lines per test: title and location.
- Align project labels.
- Add trace badge that opens trace viewer.
- Add video and image diff badges that show scrolled test result view.
2022-07-11 19:47:15 -07:00
Pavel Feldman
3a9b29f46c
feat(ct-vue): allow configuring apps per test (#15538) 2022-07-11 13:54:05 -07:00
Pavel Feldman
5fc637e44a
chore: experimental resetForReuse (#15432) 2022-07-11 13:10:08 -07:00
Max Schmitt
98ea418124
fix(expect): expect.not types (#15487) 2022-07-11 18:31:53 +02:00
Pavel Feldman
dd0eb5fb1d
fix(ct): support components w/o mount options (#15501) 2022-07-09 11:22:49 -07:00
Dmitry Gozman
6dc4a51c92
fix(test runner): more friendly test duration (#15476)
fix(test runner): more firendly test duration

Reported test duration now does not include time spent in
`beforeAll`, `afterAll` and fixtures that have a separate timeout.

This is to avoid different reported test execution time,
depending on the test execution order.
2022-07-08 11:45:44 -07:00
Dmitry Gozman
894ead5198
fix(test runner): mention fixture in worker teardown timeout error message (#15499) 2022-07-08 11:44:37 -07:00
Yury Semikhatsky
51aa5fea78
fix: colors in console output from worker (#15421)
Color highlights regressed in #14455

Fixes #15366
2022-07-07 17:56:41 -07:00
Dmitry Gozman
738d71ebc2
chore: unify two copies of monotonicTime (#15473) 2022-07-07 15:59:49 -07:00
Ross Wollman
799d4703bc
feature(test-runner): multiple web servers (#15388)
Fixes #8206.

Since #8206 is a long-awaited (~ 1 year old), popular (~ 45 reactions, frequently requested in community channels, etc.), this PR aims to unblock folks.

Notably, we do not innovate on the `webServer` API, despite knowing we're not in love with it. We'll save the innovation for either Plugins or a new `LaunchConfigs` option. (We haven't yet arrived at a Plugin API we like, and instead of launching a new option guessing what the "better" launchConfig API would be, let's wait and see how folks use this new Array-variant of `webServer` which—despite its name—can be used for non-Web Server launches!
2022-07-07 15:27:21 -07:00
Dmitry Gozman
767babc3a2
fix(test runner): handle istty in line reporter (#15455)
When running without tty, line reporter outputs a line for each
percent of the tests, thus limiting the output to ~100 lines.

In addition, reporters now support PLAYWRIGHT_LIVE_TERMINAL
env variable to force tty mode.
2022-07-07 09:55:12 -07:00