Commit Graph

1986 Commits

Author SHA1 Message Date
Pavel Feldman
8b018f6b41
chore: make role name case-insensitive (#17888) 2022-10-06 14:35:10 -07:00
Pavel Feldman
eb4baf76bf
feat(api): make aria roles an enum (#17885) 2022-10-06 11:34:22 -07:00
Dmitry Gozman
9a12ae9890
chore(docker): make sure failed commands exit with non-zero code (#17863) 2022-10-05 21:31:50 -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
Pavel Feldman
f2685cab95
chore: use api selectors in codegen hover (#17855) 2022-10-05 17:59:34 -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
Pavel Feldman
3ecaa36e25
chore: make locators generator isomorphic (#17850) 2022-10-05 13:13:22 -07:00
Dmitry Gozman
30179d4d78
fix(tsconfig): remove TS_NODE envs, update docs (#17847)
References #17469.
2022-10-05 12:51:12 -07:00
Pavel Feldman
c168f5494f
chore: generate getByLabel for inputs (#17845) 2022-10-05 12:02:15 -07:00
Pavel Feldman
ff15fcf911
chore: hide selector factories (#17844) 2022-10-05 12:00:01 -07:00
Stephen Li
0b1b718afc
feat(core): type addInitScript function arg (#17651)
Allows autocomplete on the arg passed to the init script

```ts
await page.addInitScript((arg) => {
    window.localStorage.setItem('init_user_state', JSON.stringify(arg.initUserState)) // arg was previously 'any'
}, {
    initUserState: { foo: 'bar' },
})
```
2022-10-05 09:08:30 -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
Dmitry Gozman
a9c02b9753
fix(locators): properly escape various locator methods (#17798)
References #17604.
2022-10-04 13:21:38 -07:00
Pavel Feldman
8810b55504
feat(api): shorted getByLabel, getByPlaceholder (#17816) 2022-10-04 10:29:26 -07:00
Pavel Feldman
1311767f87
chore: generate api calls (#17794) 2022-10-03 17:14:02 -07:00
Playwright Service
ade75d66cf
feat(firefox-beta): roll to r1360 (#17793)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-03 17:07:18 -07:00
Playwright Service
b364d1c6ac
feat(firefox): roll to r1357 (#17786)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-03 17:04:57 -07:00
Dmitry Gozman
b07690f408
docs: use getBy... in documentation (#17795) 2022-10-03 17:02:46 -07:00
Playwright Service
7fb3cb497d
feat(webkit): roll to r1724 (#17753) 2022-10-03 10:28:57 -07:00
Pavel Feldman
42a4d8a829
chore(codegen): prioritize role selectors (#17750) 2022-10-03 08:44:24 -07:00
Max Schmitt
4306b38c2e
chore: download browsers out of process (#17743)
https://github.com/microsoft/playwright/issues/17394
2022-10-01 01:06:36 +02:00
Yury Semikhatsky
9b35a8071f
fix(fetch): support SameSite attribute (#17748)
Fixes https://github.com/microsoft/playwright/issues/17398
2022-09-30 15:01:59 -07:00
Playwright Service
4a32010dbc
feat(chromium): roll to r1028 (#17749)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-30 23:53:16 +02:00
Pavel Feldman
5754fb9c6d
chore: do not emit comments from codegen (#17747) 2022-09-30 12:36:54 -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
Andrey Lushnikov
5b57789c6d
devops: proper error for the Webkit @ MacOS 10.15 (#17731)
The error looks like this:

```
aslushnikov:~/prog/playwright(main)$ npx playwright wk
[object.<anonymous>: Browser closed.
==================== Browser output: ====================
<launching> /Users/andreylushnikov/Library/Caches/ms-playwright/webkit-1616/pw_run.sh --inspector-pipe --no-startup-window
<launched> pid=15076
[pid=15076][out] ****************************************************************
[pid=15076][out] ****************************************************************
[pid=15076][out]
[pid=15076][out] ERROR: MacOS version is too old!
[pid=15076][out]
[pid=15076][out] This version of Playwright does not support running
[pid=15076][out] WebKit on MacOS 10.15. Please either:
[pid=15076][out] - update your operating system to version 11 or higher
[pid=15076][out] - use Playwright v1.25 or older
[pid=15076][out]
[pid=15076][out] ****************************************************************
[pid=15076][out] ****************************************************************
[pid=15076] <process did exit: exitCode=1, signal=null>
[pid=15076] starting temporary directories cleanup
=========================== logs ===========================
```

Fixes #17699
2022-09-30 01:40:17 -07:00
wodyjowski
33bbb15e30
fix: grid connection invalid method (#17706)
This patch fixes invalid method (GET instead of POST) used when
connecting to Selenium Grid by http with proxy.

Fixes #17707
2022-09-30 00:41:03 -07:00
Playwright Service
f1f4af2f7d
feat(firefox): roll to r1356 (#17685)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-29 21:47:03 -07:00
Pavel Feldman
bfb8a43ece
feat(api): all getByTitle, getByAltText (#17724) 2022-09-29 21:45:44 -07:00
Playwright Service
7d3997e620
feat(firefox-beta): roll to r1359 (#17681)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-29 21:45:21 -07:00
Pavel Feldman
6e839ff404
fix(test): remove component.get usages (#17723) 2022-09-29 20:18:26 -07:00
Pavel Feldman
083fb4401c
feat(api): add getByPlaceholderText (#17722) 2022-09-29 18:12:49 -07: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
Andrey Lushnikov
d897407833
chore: hide docker integration behind the curtain (#17715)
This is not ready for the prime time yet.
2022-09-29 14:22:09 -07:00
Max Schmitt
d009500fa1
chore: fix WebKit deps on Ubuntu 18 (#17718) 2022-09-29 23:15:04 +02:00
Pavel Feldman
e09945c637
chore: handle unexpected ws response (#17714) 2022-09-29 14:04:19 -07:00
Pavel Feldman
a97deb1600
chore: hide reporter project id (#17710) 2022-09-29 12:51:06 -07:00
Pavel Feldman
b4ee84fb0c
chore(api): remove locator.get() (#17709) 2022-09-29 12:50:52 -07:00
Max Schmitt
d715ad116d
chore: fix WebKit on debian after deps changes (#17712)
Follow-up on https://github.com/microsoft/playwright/pull/17676.
2022-09-29 21:14:33 +02:00
Pavel Feldman
e3a2316013
feat(api): add getByLabelText (#17684) 2022-09-29 11:06:58 -07:00
Yury Semikhatsky
43ccd7bc96
chore(runner): remove watch mode (#17682) 2022-09-29 10:20:21 -07:00
Dmitry Gozman
a49ea7357a
fix(firefox): remove pref override (#17674)
There is no need for the workaround anymore.

Fixes #17528.
2022-09-29 09:22:39 -07:00
Playwright Service
afa9c1528b
feat(webkit): roll to r1722 (#17676) 2022-09-29 09:00:31 -07:00
Yury Semikhatsky
9f17ee6871
feat: group filter (#17646) 2022-09-28 18:45:01 -07:00
Pavel Feldman
2a85806cc0
chore: follow up to getTestById, escape it (#17650) 2022-09-28 09:23:47 -07:00
Playwright Service
fbef53ba6c
feat(firefox): roll to r1355 (#17640)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-09-28 07:13:30 -07:00
Playwright Service
1a0c54dd46
feat(firefox-beta): roll to r1358 (#17643)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-28 07:10:09 -07:00
Playwright Service
7896346810
feat(chromium-tip-of-tree): roll to r1046 (#17653)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-09-28 12:13:07 +02:00
Playwright Service
57c4f703a7
feat(chromium): roll to r1027 (#17641)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-09-28 10:53:21 +02:00
Pavel Feldman
d8f67eb75d
feat(api): introduce getByTestId (#17645) 2022-09-27 21:06:07 -07:00
Playwright Service
57337e8df8
feat(firefox): roll to r1354 (#17601)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-09-27 17:48:32 -07:00
Pavel Feldman
d9a28bd244
feat(api): introduce get/getByText/getByRole (#17577) 2022-09-27 16:13:56 -07:00
Pavel Feldman
8ad201b802
chore: add snippet to the json report (#17567) 2022-09-27 13:23:08 -07:00
Pavel Feldman
06e73b414f
chore: move connect utility into localUtils (#17590) 2022-09-27 13:05:06 -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
bfd38bf7df
chore: introduce md templates (#17632) 2022-09-27 10:29:34 -07:00
Playwright Service
c25fb04030
feat(firefox): roll to r1353 (#17598)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-27 10:13:42 -07:00
Playwright Service
a3d89e0de3
feat(firefox-beta): roll to r1356 (#17597)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-27 10:11:59 -07:00
Pavel Feldman
3a13a897b9
Revert "fix(pwt): compatibility in CWD with wrong casing (#16636)" (#17599) 2022-09-26 18:53:08 -07:00
Yury Semikhatsky
72a24973f3
fix: ignore timing data when request served from memory cache (#17595)
`Response.timing` contains stale data when the request is served from
memory cache, in that we should ignore it and return -1 where we don't
know the value.

Fixes https://github.com/microsoft/playwright-java/issues/1080
2022-09-26 17:12:47 -07:00
Max Schmitt
cf75f8ca20
chore: custom error if HTML report gets uploaded in Trace Viewer (#17558)
Fixes https://github.com/microsoft/playwright/issues/17309
2022-09-26 20:57:05 +02:00
Playwright Service
d6dbfe547f
feat(webkit): roll to r1721 (#17591)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-26 20:39:52 +02: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
Yusuke Iwaki
f5d7089819
fix: accept post data params for request.get and request.head (#17566) 2022-09-26 09:28:07 -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
Playwright Service
04f77f2319
feat(chromium): roll to r1026 (#17545)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-22 23:24:16 +02:00
Joey Arhar
ab323122d8
feat(chromium): use Element.checkVisibility in isElementVisible (#16592)
Element.checkVisibility is a new browser API that was shipped in
chromium 105:
https://bugs.chromium.org/p/chromium/issues/detail?id=1309533

Using checkVisibility accounts for the content-visibility:hidden in the
user-agent ShadowRoot of the details element, which means we can remove
the usage of the AutoExpandDetailsElementFlag (I am trying to remove the
flag in chromium).

This behavior is covered by the existing "isVisible and isHidden should
work with details" test in locator-convenience.spec.ts.
2022-09-22 13:48:58 -07:00
Andrey Lushnikov
4cd2176155
feat(containers): introduce separate container commands (#17541)
This patch introduces hidden commands to control container
lifecycle:
- `npx playwright docker install-server-deps` to install fluxbox,
  vnc, novnc & to configure them.
- `npx playwright docker run-server` to run a server inside the
  container.

Drive-by: remove old version of container image when building a new
version with the same name. This way we won't pile up untagged
container images.
2022-09-22 13:38:54 -07:00
Andrey Lushnikov
6b4afbb8df
chore: support http protocol with browserType.connect() (#17483) 2022-09-22 11:59:58 -07:00
sand4rt
9564306297
feat(ct): solid render children complete (#17417) 2022-09-21 21:16:30 -07:00
sand4rt
d85d615846
feat(ct): type-safe hook config (#17232) 2022-09-21 21:14:20 -07:00
Pavel Feldman
cb10ef3c71
chore: rename reuseController to debugController (#17520) 2022-09-21 15:35:52 -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
Playwright Service
d2300674ef
feat(firefox-beta): roll to r1355 (#17492)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-21 11:13:07 -07:00
Playwright Service
292b3e998e
feat(firefox): roll to r1352 (#17494)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-21 11:12:45 -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
Philip Langer
26150b7064
docs: fix typo persistet -> persisted (#17498) 2022-09-21 13:58:34 +02:00
Jérémy Lal
840a1f6436
chore: replace __proto__ by getPrototypeOf (#17386) 2022-09-20 19:01:12 -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
Yury Semikhatsky
cd9a5946d2
fix(expect): toHaveAttribute with empty value should not match missing attribute (#17477)
Reference #16517
2022-09-20 17:11:12 -07:00
Playwright Service
68f029e047
feat(chromium-tip-of-tree): roll to r1044 (#17474)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-21 00:39:48 +02:00
Pavel Feldman
3abbe0d850
chore: migrate codegen to controller events (#17450) 2022-09-20 14:32:21 -07:00
Bastian
29ff00ead2
docs(cli): typo in --debug flag (#17455) 2022-09-20 14:00:59 +02:00
Playwright Service
426301dc6d
feat(firefox): roll to r1351 (#17391)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-19 08:52:37 -07:00
Playwright Service
57cc54fd96
feat(firefox-beta): roll to r1354 (#17414)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-19 08:50:38 -07:00
Pavel Feldman
e9f926e536
fix(docker): do not sync primary selection into clipboard (#17424) 2022-09-19 06:08:40 -07:00
Max Schmitt
ffbfacd732
docs: add code snippets for drag'n drop (#17390)
Fixes https://github.com/microsoft/playwright.dev/issues/775
2022-09-19 13:00:46 +02: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
Playwright Service
1303e3e355
feat(chromium-tip-of-tree): roll to r1043 (#17384)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-16 11:00:27 +02:00
Playwright Service
58b43004d2
feat(chromium): roll to r1025 (#17372)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-16 10:59:17 +02:00
Playwright Service
8d696868c1
feat(webkit): roll to r1719 (#17364)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-16 10:58:22 +02:00
Andrey Lushnikov
7019cc8b97
feat(docker): closeAllBrowsers command for reuseController (#17383) 2022-09-15 20:38:28 -07:00
Dmitry Gozman
43304e980d
feat: show browser.close() stack in "Browser has been closed" error (#17376)
Often times we see "Browser has been closed" error, but it's not
entirely clear why. Showing the close stack might help.

```js
page.goto: Connection closed
    ==== Closed by ====
    at /Users/dgozman/code/playwright/tests/library/browsertype-connect.spec.ts:477:32
```
2022-09-15 17:04:41 -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
Dmitry Gozman
e1a2f7a168
fix(socks proxy): destroy sockets on close to avoid hanging (#17349) 2022-09-14 21:15:46 -07:00
Andrey Lushnikov
58873908ba
devops: add docker screenshot expectations for html-reporter tests (#17341) 2022-09-14 15:44:13 -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
59c32bf2c6
Revert "chore(generator): use new .NET test attributes (#17172)" (#17344)
This reverts commit 15add13a6a.
2022-09-14 22:44:38 +02: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
Yury Semikhatsky
35a86a2d02
docs(fetch): post file examples (#17312) 2022-09-13 16:05:57 -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
Max Schmitt
00a3b1b0a2
fix: make evaluate work with overridden Window/Document/Node (#17288)
Fixes https://github.com/microsoft/playwright/issues/17287
2022-09-13 18:21:07 +02: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
sand4rt
f61d3c9cc4
feat(ct): svelte type-safe hook config (#17237) 2022-09-12 21:00:41 -07:00
sand4rt
eb3666328d
feat(ct): vue2 type-safe hook config (#17236) 2022-09-12 21:00:09 -07:00
Andrey Lushnikov
bc942ef9ea
chore: cut v1.26.0 (#17265) 2022-09-12 10:45:27 -07:00
sand4rt
344077b04e
feat(ct): svelte mount type (#17228) 2022-09-12 09:30:04 -07:00
Jean-François Greffier
81bcbd284f
docs: migration typos (#17247) 2022-09-12 17:41:49 +02: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
Yury Semikhatsky
24ee456d43
chore: make maxRedirects available in java, improve docs. tests (#17227) 2022-09-09 13:25:36 -07:00
Vincenzo Gasparo
17b203affb
feat: added follow and redirect arguments to fetch (#17033) 2022-09-09 12:14:42 -07:00
Dmitry Gozman
bca13bc35a
feat(assertions): support toBeVisible({ visible }) (#17207) 2022-09-09 08:33:23 -07:00
Playwright Service
9e93913900
feat(chromium): roll to r1024 (#17203)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-09 14:36:55 +02:00
Playwright Service
0c663d9f58
feat(chromium-tip-of-tree): roll to r1041 (#17209)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-09 08:21:52 +02:00
Max Schmitt
5e56bc413a
chore: set default http request timeouts (#17200)
* chore: set default http request timeouts

* Update chromium.ts
2022-09-09 06:18:57 +02:00
Andrey Lushnikov
ea7ef328e7
fix: inject caret-hiding style in every shadow tree (#16907)
Style inheritance disregards selector specificity, so we can't
dominate local shadow dom styles.

To mitigate this, we inject the style tag with caret-hiding
style in every shadowDom tree.

Fixes #16732
2022-09-08 09:50:08 -07:00
Andrey Lushnikov
b0ff4f58ce
feat: implement --dry-run for npx playwright install (#17158)
* feat: implement `--dry-run` for `npx playwright install`

The `--dry-run` command prints URLs for browsers to be installed.

Demo output:

```
browser: chromium version 106.0.5249.21
  Install location:    /Users/andreylushnikov/Library/Caches/ms-playwright/chromium-1023
  Download url:        https://playwright.azureedge.net/builds/chromium/1023/chromium-mac-arm64.zip
  Download fallback 1: https://playwright-akamai.azureedge.net/builds/chromium/1023/chromium-mac-arm64.zip
  Download fallback 2: https://playwright-verizon.azureedge.net/builds/chromium/1023/chromium-mac-arm64.zip

browser: firefox version 104.0
  Install location:    /Users/andreylushnikov/Library/Caches/ms-playwright/firefox-1350
  Download url:        https://playwright.azureedge.net/builds/firefox/1350/firefox-mac-11-arm64.zip
  Download fallback 1: https://playwright-akamai.azureedge.net/builds/firefox/1350/firefox-mac-11-arm64.zip
  Download fallback 2: https://playwright-verizon.azureedge.net/builds/firefox/1350/firefox-mac-11-arm64.zip

browser: webkit version 16.0
  Install location:    /Users/andreylushnikov/Library/Caches/ms-playwright/webkit-1714
  Download url:        https://playwright.azureedge.net/builds/webkit/1714/webkit-mac-12-arm64.zip
  Download fallback 1: https://playwright-akamai.azureedge.net/builds/webkit/1714/webkit-mac-12-arm64.zip
  Download fallback 2: https://playwright-verizon.azureedge.net/builds/webkit/1714/webkit-mac-12-arm64.zip

browser: ffmpeg
  Install location:    /Users/andreylushnikov/Library/Caches/ms-playwright/ffmpeg-1007
  Download url:        https://playwright.azureedge.net/builds/ffmpeg/1007/ffmpeg-mac-arm64.zip
  Download fallback 1: https://playwright-akamai.azureedge.net/builds/ffmpeg/1007/ffmpeg-mac-arm64.zip
  Download fallback 2: https://playwright-verizon.azureedge.net/builds/ffmpeg/1007/ffmpeg-mac-arm64.zip
```

Fixes #16926
2022-09-08 09:05:09 -07:00
Playwright Service
cf8f662f13
feat(webkit): roll to r1715 (#17192)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-08 18:00:55 +02:00
Max Schmitt
aad745acab
docs: provide examples for connectOverCDP (#17189) 2022-09-08 18:00:28 +02:00
sand4rt
158408a2af
fix(ct): mount type (#17076) 2022-09-08 08:39:25 -07:00
sand4rt
3f941865a0
fix(ct): svelte slot type (#17074) 2022-09-08 08:39:00 -07:00
sand4rt
69b5104967
fix(ct): vue2 slot type (#17073) 2022-09-08 08:38:40 -07:00
sand4rt
80df84b49e
fix(ct): vue slot type (#17071) 2022-09-08 08:38:20 -07:00
Max Schmitt
1e517731ef
chore: have a socket timeout when downloading browsers (#17187) 2022-09-08 14:40:41 +02:00
Pavel Feldman
80e9c5dc55
fix(reuse): restore storage state (#17175) 2022-09-07 19:15:04 -07:00
Max Schmitt
15add13a6a
chore(generator): use new .NET test attributes (#17172) 2022-09-08 01:44:58 +02:00
Pavel Feldman
c91df61ca3
chore: optionally connect instead of launching (#17174) 2022-09-07 15:57:20 -07:00
Cody Kaup
6a54b5ec88
chore: Fix README link (#17148) 2022-09-07 09:05:43 -07:00
Playwright Service
5a5011621b
feat(chromium-tip-of-tree): roll to r1040 (#17136)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-07 14:48:46 +02:00
Dmitry Gozman
6e1c94b5fe
fix(click): allow clicking inside closed shadow root (#16900)
Although Playwright selectors do not pierce closed shadow roots,
one can still obtain a reference to an element inside a closed shadow root:
- through `page.evaluate()`;
- through `handle.$()` where `handle` is inside the shadow root;
- through `frame.locator()` by choosing an iframe that belongs
  to a closed shadow root.

In this case, `click()` action fails during the hit check test,
but it's possible to make it work by going bottom up from the target
rather than top down from the document.
2022-09-06 17:55:15 -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
Pavel Feldman
92f44e34d6
chore: silenсe best effort cleanup errors (#17137) 2022-09-06 12:48:40 -07:00
Dmitry Gozman
306ab34aa3
feat(assertions): support toBeEnabled({ enabled }) (#17058) 2022-09-06 11:40:34 -07:00
Dmitry Gozman
b734f36f8b
fix(frameElement): should work for frames inside closed shadow root (#17055) 2022-09-06 08:52:25 -07:00
Pavel Feldman
f4b90e5cc8
chore: reparent network back to context (#17023) 2022-09-05 10:19:44 +02:00
Yury Semikhatsky
01d83f1d5e
fix(har): record request overrides to har (#17027) 2022-09-04 10:52:20 -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
Playwright Service
4dc919fb71
feat(webkit): roll to r1714 (#17053)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-03 11:26:01 +02:00
Playwright Service
f051948400
feat(chromium): roll to r1023 (#17061)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-03 11:24:25 +02:00
Dmitry Gozman
1dc2a33896
docs: clarify that toBeHidden works when nothing matches (#17057) 2022-09-02 16:36:19 -07:00
Playwright Service
74187290f1
feat(chromium-tip-of-tree): roll to r1039 (#17044)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-03 00:53:53 +02:00
Dmitry Gozman
54e7f44974
fix(firefox): disable cookie partitioning (#17051) 2022-09-02 15:46:03 -07:00
Dmitry Gozman
3548f3f898
feat(firefox): roll ff to 1350, beta to 1353 (#17006) 2022-09-02 08:35:29 -07:00
Yury Semikhatsky
da19219323
fix: throw clear message when requested screenshot is too large (#17025) 2022-09-01 18:15:49 -07:00
Yury Semikhatsky
27ffdcc944
fix: accept post data for GET and HEAD http methods (#17008) 2022-09-01 08:36:08 -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
Playwright Service
791dcc39f5
feat(webkit): roll to r1713 (#17001)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-01 11:57:25 +02:00
Yury Semikhatsky
5d6253f743
fix: stop har recording when APIRequestContext is disposed (#17007) 2022-08-31 21:51:38 -07:00
Playwright Service
74d52138ff
feat(chromium-tip-of-tree): roll to r1038 (#17000)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-31 22:49:33 +02:00
Yury Semikhatsky
aaa28394cd
feat(trace): include url into route.fulfill call params (#16934) 2022-08-31 12:37:49 -07:00
Andrey Lushnikov
38f2a5d5f5
fix: include headlessness as a launch argument to browser (#16898) 2022-08-31 10:26:13 -07:00
Max Schmitt
6533eb2e5b
chore: fix deps for WebKit on ubuntu20 (#16950) 2022-08-31 12:27:09 +02: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
Playwright Service
77f6b25941
feat(webkit): roll to r1712 (#16933) 2022-08-30 14:24:14 -07:00
DetachHead
bcf2a06e53
docs: explain that the Selectors.register script is executed in the page context (#16917) 2022-08-30 09:17:17 -07:00
Yury Semikhatsky
11dfd31dd9
feat: --pass-with-no-tests option (#16902) 2022-08-29 15:46:34 -07:00
sand4rt
3af548604e
feat(ct): svelte default slot (#16869) 2022-08-29 09:11:51 -07:00
sand4rt
3464edf89d
chore(ct): svelte mount options type dedupe (#16868) 2022-08-29 09:10:50 -07:00
sand4rt
996468d4b7
feat(ct): solid default child (#16839) 2022-08-26 15:48:05 -07:00
Dmitry Gozman
fea8772d95
fix: emit load/domcontentloaded events as reported by the browser (#16861)
Instead of requiring all frames in the subtree to receive a particular
event, we rely on the browser's definition of load and DOMContentLoaded.

This changes logic in a few edge cases:
- Some browsers do not emit load event upon window.stop() at all.
- DOMContentLoaded does not wait for subframes, so they might not be
  ready when passing `{ waitUntil: 'domcontentloaded' }`.

`networkidle` preserves the old logic.
2022-08-26 13:48:05 -07:00
JJetmar
b93668e301
docs: spelling fix (#16842)
Co-authored-by: Ross A. Wollman <ross.wollman@gmail.com>
2022-08-26 12:57:18 -07:00
sand4rt
0972f1469a
feat(ct): solid unmount (#16838) 2022-08-26 11:51:36 -07:00
Pavel Feldman
6319b14069
chore: dispatcher is a scope (#16843) 2022-08-26 09:30:27 -07:00
Playwright Service
fa234f4611
feat(chromium-tip-of-tree): roll to r1037 (#16854)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-26 07:34:08 +02:00
Playwright Service
3b1af7d75d
feat(chromium): roll to r1022 (#16844)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-25 21:42:58 +02:00
Pavel Feldman
a07a4a25a2
chore: make parent scope explicit (#16819) 2022-08-25 11:58:41 -07:00
sand4rt
8d4a94bfd3
feat(ct): solid set props (#16813) 2022-08-25 08:40:14 -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
74ab343e2b
feat(codegen): add NUnit/MSTest (#16803) 2022-08-25 11:58:58 +02:00
Dmitry Gozman
2c1723b6f5
chore: avoid protocol calls on disposed context (#16812)
Otherwise, we always get a failing protocol message when closing a context.
2022-08-24 17:21:01 -07:00
Playwright Service
c4e91bded1
feat(firefox): roll to r1347 (#16788) 2022-08-24 08:37:52 -07:00
Max Schmitt
9341bf12c6
docs(dotnet): enable api response assertions (#16799) 2022-08-24 08:30:47 -07:00
Playwright Service
80389c7d47
feat(firefox-beta): roll to r1348 (#16786)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-24 00:11:05 -07:00
Andrey Lushnikov
6ebd3ea61f
chore(electron): put client-provided arguments in front (#16782)
Fixes #16614
2022-08-23 15:08:36 -07:00
Playwright Service
b57b30033a
feat(chromium-tip-of-tree): roll to r1036 (#16775)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-23 23:42:17 +02:00
sand4rt
ad46e980bc
feat(ct): initial solid (#16703) 2022-08-23 14:08:53 -07:00
Ross Wollman
aa23914659
chore: remove invalid device configurations (#16777)
Resolves #16622.

- removes current invalid configurations
- validates future changes
2022-08-23 14:03:41 -07:00
sand4rt
e194b2ae6b
feat(ct): vue2 rerender (#16734) 2022-08-23 11:37:55 -07:00
Andrey Lushnikov
1cedd805ed
chore: a nicer message to urge updating docker image with Playwright (#16758)
This will result in the following message:

```
root@docker-desktop:/playwright# node a.mjs
node:internal/process/esm_loader:94
    internalBinding('errors').triggerUncaughtException(
                              ^

browserType.launch: Executable doesn't exist at /ms-playwright/chromium-1021/chrome-linux/chrome
╔══════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just updated to 1.26.0. ║
║ Please update docker image as well.                                  ║
║ -  current: mcr.microsoft.com/playwright:v1.23.0-focal               ║
║ - required: mcr.microsoft.com/playwright:v1.26.0-focal               ║
║                                                                      ║
║ <3 Playwright Team                                                   ║
╚══════════════════════════════════════════════════════════════════════╝
    at file:///playwright/a.mjs:3:43 {
  name: 'Error'
}
```

Fixes #15483
2022-08-23 10:39:59 -07:00
Pavel Feldman
4d892475da
chore: do not use experimental loader for web server (#16733) 2022-08-23 10:22:05 -07:00