Commit Graph

639 Commits

Author SHA1 Message Date
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