Commit Graph

1643 Commits

Author SHA1 Message Date
Max Schmitt
a0c24c01c8
chore: fix docs links for .NET roll (#13787) 2022-04-27 16:06:30 +02:00
Max Schmitt
992b47910f
docs(ci): remove providers which don't support GHA on deployment event (#13786)
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2022-04-27 16:06:19 +02:00
Pavel Feldman
bc6f8e1f20
feat(poll): expose custom poll interval (#13776) 2022-04-26 21:32:38 -07:00
Ari
f989e86538
docs(docker.md): add a note clarifying Docker vs. Playwright image (#13768)
Addresses feedback from #12772
2022-04-26 12:04:45 -07:00
Max Schmitt
37bee74ae5
chore: set minimum version to Node.js 14 (#13469) 2022-04-26 17:52:32 +02:00
Dmitry Gozman
00b4fb8bad
docs: describe layout selectors sorting logic (#13753) 2022-04-26 15:02:01 +01:00
Dmitry Gozman
416b56a0c8
fix: await expect.poll in docs (#13743) 2022-04-25 20:22:53 +01:00
Dmitry Gozman
97750ccf9a
feat: locator.that (#13731)
Filters existing locator by options, currently `has` and `hasText`.
2022-04-25 20:06:18 +01:00
Pavel Feldman
5e51c17d41
chore: use plugin story for components (#13717) 2022-04-25 10:40:58 -07:00
Dmitry Gozman
8e5854033a
fix: types generation for attach and GlobalInfo (#13727) 2022-04-25 13:56:37 +01:00
Dmitry Gozman
d2bdb1d7cf
docs: explain label retargeting in selectors doc and some input actions (#13725) 2022-04-25 13:55:41 +01:00
Dmitry Gozman
01a8977b4d
feat: make scrollIntoView work with zero-sized elements (#13702)
We skip waiting for "visible" state that enforces non-zero size.
Other invisible conditions like "display:none" fail during the
actual "scrolling" step and will retry.
2022-04-23 21:48:36 +01:00
Ross Wollman
3eac9c694c
fix(test-runner): mark attach as async (#13687)
Also brings back generation of experimental types as part of lint.
2022-04-22 09:27:02 -07:00
Andreas Opferkuch
c7212e6d56
docs(extensions): list all extension requirements (#13688) 2022-04-22 13:44:18 +02:00
Max Schmitt
4a3180aca9
chore: make Android host option configurable (#13685) 2022-04-21 22:16:42 +02:00
Sean Perkins
8c4fc62e8f
docs(test-annotations): add isMobile to typescript snippet (#13686) 2022-04-21 20:58:40 +02:00
Guriy Samarin
cde7c5df44
docs(dotnet): migrate to top-level style code snippets (#13559) 2022-04-19 20:23:26 +02:00
Yury Semikhatsky
0a401b2d86
docs: clarify semantics of redirected response (#13636) 2022-04-19 09:36:38 -07:00
Mahesh Sundaram
05527bf110
docs: add example for global setup process.env (#13397)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-04-19 17:44:30 +02:00
Andrey Lushnikov
88a9262dbb
fix: resolve WebServer cwd dir wrt configDir (#13626)
Drive-by: speed-up webserver tests by not waiting 750ms to start it.

Fixes #13115
2022-04-19 07:45:36 -07:00
Yury Semikhatsky
ed0dcdabc9
docs: clarify toBeDisabled behavior (#13616) 2022-04-18 17:06:01 -07:00
Meir Blachman
48a8b3fddd
fix(docs): fix typo in network (#13613) 2022-04-18 12:29:16 -07:00
Dmitry Gozman
02aa4fe617
chore: generate types for TestProject/TestConfig (#13574) 2022-04-15 10:27:38 -07:00
spaniardmaximus
05f67d27cc
docs(selectors.md): fix typo (#13569) 2022-04-14 17:36:26 -07:00
Dmitry Gozman
634f40e850
docs: expand TypeScript doc with modules and path mappings (#13567) 2022-04-14 15:02:36 -07:00
azad-derakhshani-GS
562fd989df
docs(input.md): add Locator API references (#13562)
Resolves #13561
2022-04-14 13:24:06 -07:00
Dmitry Gozman
c86c2e8762
feat: restore toHaveScreenshot as experimental feature (#13549)
- Restore docs.
- Make `TestConfig.expect` generated.
- Allow experimental properties with "e" marker: `- foo e<float>`.
2022-04-14 13:22:42 -07:00
Max Schmitt
02a5417746
docs(docker): some enhancements (#13558) 2022-04-14 17:12:21 +02:00
Dmitry Gozman
20dcc45afa
feat: support experimental doc entries (#13446)
feat: support experimental doc entries

- Params/options/members are marked as experimental in the docs.
- `experimental.d.ts` is generated that contains all types and
  includes experimental features.
- `experimental.d.ts` is references in our tests so that we
  can test experimental features.
- `fonts` option is restored as experimental.
2022-04-13 16:13:30 -07:00
Andrey Lushnikov
52e326abd1
docs: release notes for 1.21 (#13491) 2022-04-11 16:53:57 -07:00
Dmitry Gozman
1e1df6395f
chore: generate expect types (#13439) 2022-04-11 10:42:19 -07:00
Yury Semikhatsky
1ee42a366d
docs: mark fetch params as optional again (#13479) 2022-04-11 10:01:32 -07:00
Ross Wollman
962361abd7
docs: fix test.step return type (#13464)
Fixes #13463.
2022-04-11 09:40:46 -07:00
Dmitry Gozman
f6ccd4847e
fix(test runner): default workerIndex to -1 (#13440) 2022-04-08 15:23:23 -07:00
Ross Wollman
1af32e400f
feat(test-runner): introduce GlobalInfo (#13083) 2022-04-08 13:22:14 -07:00
kaivean
d65263f151
feat(android): allow getting webviews by socket name (#13248) 2022-04-08 20:52:16 +02:00
Yury Semikhatsky
10b8a8b199
docs(java): clarify source list format (#13431) 2022-04-08 10:44:48 -07:00
Dmitry Gozman
cef476b89f
docs: support optional methods (#13415)
So far, these are used in `Reporter`.
2022-04-07 18:51:05 -07:00
Andrey Lushnikov
91333daf09
chore: cut v1.21.0 (#13405) 2022-04-07 18:16:22 -07:00
Max Schmitt
5536e64538
feat(test-runner): support filtering by columns (#13401) 2022-04-07 22:45:45 +02:00
Steve Zhang
de518338ce
docs: fix class-coverage snippet for v8toIstanbul (#13371)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-04-07 18:34:45 +02:00
Dmitry Gozman
c68f57d2d0
docs: mark optional properties/arguments explicitly with "?" (#13369)
Previously, we were guessing whether something is optional from the
comment (looking for stuff like "defaults to" or "optional").

To remove this error-prone technique, every optional property or
argument (but not option) is explicitly marked with "?".
2022-04-06 19:02:10 -07:00
Dmitry Gozman
4123a55be5
chore: generate more types (#13358)
As a result, fix documentation issues:
- Removed `TestStep.data` that is not a thing.
- Added `TestConfig.name` documentation.
- Refined a lot of optional types in the documentation.
- Aligned `test.fail()` and `test.slow()` docs with `test.skip()`.
- Strict set of docs vs types inconsistensies in the generator
2022-04-06 13:36:20 -07:00
Akul Srivastava
d9d826b7f6
docs: fixes typo (#13094)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-04-06 12:00:51 +02:00
Dmitry Gozman
4bb563b015
fix(expect): proper return types (#13334)
A few changes:
- `Matchers<R, T>` now carries both return and argument type.
- Based on the argument type, we apply playwright-specific Page/Locator matchers.
- Return type is usually void, unless wrapped with `expect.resolves`,
  `expect.rejects` or `expect.poll()`.
- To preserve compatibility with any extended types in the wild,
  argument type is optional.
2022-04-05 16:11:11 -07:00
Josep Vidal
c69c74caba
docs: fix wrong input field name on GitHub auth (#13315) 2022-04-05 13:13:02 -07:00
Dmitry Gozman
e31a5b690a
chore: unrelease toHaveScreenshot and screenshotsDir (#13304) 2022-04-05 08:34:51 -07:00
Max Schmitt
cb4fba5e56
docs: fix toMatchSnapshot optional name usage (#13321) 2022-04-05 15:34:04 +02:00
Dmitry Gozman
a09b8dfa36
chore: unrelease 'fonts' screenshot option (#13300) 2022-04-04 14:51:11 -07:00
Dmitry Gozman
4e1fb1728f
docs: small clarifications to hasText and has-text (#13298) 2022-04-04 13:18:03 -07:00
Pavel Feldman
8232497c88
feat(electron): expose app process(), detach on exit (#13280) 2022-04-04 11:50:46 -07:00
Ben Hammond
66a95c6897
docs(ci): fix typo (#13276) 2022-04-03 18:01:02 -07:00
kaivean
5d2e8918d8
feat(android): add androidDevice.options.omitDriverInstall (#13249) 2022-04-02 16:00:38 -07:00
Dmitry Gozman
bba36dcae4
docs: add locator options to selectors doc (#13263) 2022-04-01 20:58:48 -07:00
Dmitry Gozman
f9ae423eab
docs: attempt to fix rendering of test-timeouts page (#13256) 2022-04-01 15:06:26 -07:00
Ross Wollman
16efbdef98
chore: remove/rename FullConfig._attachments (#13233)
This was originally introduced in #12734.

It will be replaced with GlobalInfo (#13083), but not before the 1.21
release.
2022-04-01 12:36:05 -07:00
Dmitry Gozman
a200fe3528
feat(screenshot): rename "size" option to "scale" (#13254)
Drive-by: fix `caret` handling in `toHaveScreenshot`.
2022-04-01 12:28:40 -07:00
Yury Semikhatsky
7d7fe3c618
fix(route): remove cors option, compare origin (#13231) 2022-03-31 19:21:21 -07:00
Dmitry Gozman
e5182259b1
feat(role selector): docs and minor fixes (#13203)
- Added docs to `selectors.md`.
- `[pressed]` and `[checked]` do not match `"mixed"` states.
- Disallow `[name]` shorthand without a value.
- Renamed `includeHidden` to `include-hidden`.
2022-03-31 13:06:39 -07:00
Marcus Felling
705a994f18
docs: add VS Code extension (#12372) 2022-03-30 09:31:35 -07:00
Jim Fisher
7d734802fc
docs: explain why video has gray borders 2022-03-30 09:19:05 -07:00
Andrey Lushnikov
a9989852d5
feat(vrt): new option "caret" for taking screenshots (#13164)
This has two values:
- `"hide"` to hide input caret for taking screenshot
- `"initial"` to keep caret behavior unchanged

Defaults to `"hide"`.

Fixes #12643
2022-03-29 17:48:13 -07:00
Dmitry Gozman
eb09306db2
feat(connect): add connectOptions.timeout (#13163) 2022-03-29 15:03:43 -07:00
Ross Wollman
bb90ab1471
docs: use case-sensitive keyword (#13136) 2022-03-28 14:16:33 -07:00
Yury Semikhatsky
5734c18ef8
feat(route): add cors header in route.fulfill (#12943) 2022-03-25 14:56:57 -07:00
Max Schmitt
c8cc62a2e6
chore: add link validation for docs (#13047) 2022-03-25 19:30:45 +01:00
Andrey Lushnikov
0243bb4920
docs: refresh CI docs (#13020)
- Travis CI docs are badly rotten. I recall there was a need to
  list all the custom apt packages in the `travis.yml`, and it's a
  hassle to maintain this list for us. I remove the whole section for now
  since we don't see lots of Travis CI usage among our clients.
- Refresh other bits

Fixes #12855
2022-03-24 14:08:32 -07:00
Max Schmitt
1797c5c249
chore(test-runner): support self signed certificate in webServer (#13032) 2022-03-24 17:30:52 +01:00
Max Schmitt
434a729396
docs(dotnet): add missing Docker image (#13043) 2022-03-24 16:58:21 +01:00
Max Schmitt
81050c406e
chore: fix snippets in release-notes (#13033) 2022-03-24 07:52:04 -07:00
Dmitry Gozman
418dc9ea5d
docs(parallel): tell about fully parallel mode (#13013) 2022-03-23 16:43:46 -07:00
Dmitry Gozman
03b08c1ff9
docs(webServer): prefer url over port (#13008) 2022-03-23 16:07:30 -07:00
Andrey Lushnikov
e1700bd167
feat: use package.json directory as a default for outputDir (#12942)
This patch:
- starts using directory of `package.json` to resolve default
  output directory path
- starts using either `package.json` directory or configuration
  directory to resolve all relative paths

References #12970
2022-03-23 16:05:49 -07:00
Andrew Hayward
ab39cfcb18
docs: fixing example code in accessibility API docs (#12664)
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-03-23 11:50:35 +01:00
Dmitry Gozman
722302799e
feat(selectors): support regular expressions in attribute selectors (#12960)
Supports inline regex in addition to string: `_react=BookItem[author = /Ann?a/i]`.
This is similar to `text=` selector, but applies to `_react` and `_vue`
selectors. In the future, will also apply to `role=` selector.
2022-03-22 17:00:56 -07:00
Ross Wollman
541fb39a51
feat(html-reporter): add report context header (#12734)
Resolves #11318.

* Adds `TestConfig.attachments` public API. (We opted to not implement an analog to the async `TestInfo.attach(…)` API.)
* Adds `TestConfig.attachments` to common reporters.
* Dogfoods some git and CI-info inference to generate useful atttachments
* Updates HTML Reporter to include a side bar to present a pre-defined set of attachments (a.k.a git/commit context sidebar)

Here's what it looks like:

<img width="1738" alt="Screen Shot 2022-03-21 at 3 23 28 PM" src="https://user-images.githubusercontent.com/11915034/159373291-8b937d30-fba3-472a-853a-766018f6b3e2.png">

See `tests/playwright-test/reporter-html.spec.ts` for an example of usage (for dogfood-ing only). In the future, if this becomes user-facing, there the Global Setup bit would likely become unnecessary (as would interaction with attachments array); there would likely just be a nice top-level config and/or CLI flag to enable collecting of info.
2022-03-22 16:28:04 -07:00
Max Schmitt
4aa7677f98
docs(dotnet): fix EvalueHandleAsync typo (#12920) 2022-03-22 16:36:21 +01:00
Yury Semikhatsky
0adf5536af
docs(fetch): clarify cookie handling (#12892) 2022-03-21 13:20:17 -07:00
Andrey Lushnikov
cfe92e1608
feat(test-runner): implement expect.poll (#12815)
This patch implements `expect.poll()` method that polls given
predicate until a given synchronous predicate completes.

Usage:

```js
// wait until page gets 3 frames.
await expect.poll(() => page.frames().length, {
  timeout: 1000,
  message: 'custom error message',
}).toBe(3);
```

Fixes #10235
2022-03-18 16:31:26 -07:00
Dmitry Gozman
209bde5000
feat(test runner): descrbe.skip (#12865)
`describe.skip` declares a test group that is skipped.
2022-03-18 16:07:11 -07:00
Dmitry Gozman
25483452c0
feat(fixtures): per-fixture timeout (#12751)
By default, fixtures share timeout with the test they are instantiated for.
However, for more heavy fixtures, especially worker-scoped ones, it makes
sense to have a separate timeout.

This introduces `{ timeout: number }` option to the list of fixture options
that opts the fixture into a dedicated timeout rather than sharing it
with the test.
2022-03-17 09:36:03 -07:00
Andrey Lushnikov
fa81561073
docs: remove ---disable-dev-shm-usage recommendation from docs (#12811)
We now pass this flag to chromium unconditionally.
2022-03-16 15:44:31 -07:00
Andrey Lushnikov
e16f3c46b4
docs: always keep docker references up-to-date in documentation (#12795)
References #12796
2022-03-16 13:51:39 -07:00
o.mingaleev
9fc9aeeb23
docs: fixed wrong types for WebServerConfig.cwd (#12817)
Co-authored-by: Oleg Mingaleev <oleg.m@profi.io>
2022-03-16 12:14:12 +01:00
Ross Wollman
964eeba0dc
docs: remove mis-placed command (#12787) 2022-03-15 17:38:36 -07:00
Pavel Feldman
9ff9a9711d
docs: fix grep release notes (#12801) 2022-03-15 17:28:25 -07:00
Max Schmitt
61c66bb82b
docs(docker): stop advertising :focal tag (#12791)
Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
2022-03-15 19:28:19 +01:00
Max Schmitt
01beb6310a
docs: mention locator.nth is zero based (#12750)
Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
2022-03-14 21:06:44 +01:00
Max Schmitt
fff4681c6c
docs: fix broken release-notes links (#12747) 2022-03-14 12:25:26 -07:00
Andrey Lushnikov
cd81fc9945
docs(release-notes): fix release notes for .net (#12743) 2022-03-14 11:04:59 -07:00
Andrey Lushnikov
b7e92a44cb
docs: add release notes for all other languages (#12596)
Drive-by:
- backport removal of toHaveScreenshot from release 1.20
- change webkit 10.15 announcement
2022-03-14 10:52:52 -07:00
Yury Semikhatsky
19de9cacc3
docs: delete verification guide (#12698) 2022-03-12 09:32:54 -08:00
Max Schmitt
d15910b450
docs(test-runner): add note about custom annotations (#12681)
o-authored-by: Dmitry Gozman <dgozman@gmail.com>
2022-03-11 19:09:23 +01:00
Andrey Lushnikov
e3ab6388a9
feat(toHaveScreenshot): enable sensible defaults (#12675)
This patch:
- Enables configuration of certain defaults for some options of `expect.toHaveScreenshot` method via `TestProject.expect.toHaveScreenshot` property
- Sets sensible defaults for these options:
  * `fonts: "ready"`
  * `animations: "disabled"`
  * `size: "css"`
2022-03-11 08:45:36 -08:00
Yury Semikhatsky
9d4f330411
docs: fix python link to test-assertions (#12665) 2022-03-11 08:28:06 -08:00
Andrey Lushnikov
b51157bdea
feat: bring back maxDiffPixels in toMatchSnapshot (#12627)
This patch reverts 2 commits that removed the feature from the method:
- "fix: explicitly ignore maxDiffPixels in toMatchSnapshot (#12570)"
  commit b8af8458d6.
- "chore: remove `maxDiffPixels` from toMatchSnapshot (#12539)"
  commit a3dff45974.
2022-03-10 18:41:16 -08:00
Andrey Lushnikov
42765804bc
chore: add "allow" as a default value for animations. (#12663) 2022-03-10 17:15:36 -08:00
Andrey Lushnikov
49e66c7f08
feat(screenshot): introduce new "fonts" option for screenshots (#12661)
This option will wait for webfonts to load before taking screenshots.
2022-03-10 16:54:36 -08:00
Andrey Lushnikov
12d8a262be
feat: support screenshotsDir option (#12642)
The `screenshotsDir` option controls the expectation storage
for `toHaveScreenshot()` function.

The new expectation management for screenshots has the following
key properties:
- All screenshots are stored in a single folder called `screenshotsDir`.
- Screenshot names **do not** respect `snapshotDir` and `snapshotSuffix`
  configurations.
- `screenshotsDir` is configurable per project. This way a "smoke tests"
  project can re-use screenshots from "all tests" project.
- Host platform is a top-level folder.

For example, given the following config:

```js
// playwright.config.ts
module.exports = {
  projects: [
    { name: 'Mobile Safari' },
    { name: 'Desktop Chrome' },
  ],
};
```

And the following test structure:

```
smoke-tests/
└── basic.spec.ts
```

Will result in the following screenshots folder structure by default:

```
__screenshots__/
└── darwin/
    ├── Mobile Safari/
    │   └── smoke-tests/
    │       └── basic.spec.ts/
    │           └── screenshot-expectation.png
    └── Desktop Chrome/
        └── smoke-tests/
            └── basic.spec.ts/
                └── screenshot-expectation.png
```
2022-03-10 16:50:26 -08:00
Yury Semikhatsky
10bf5f3e49
docs: update links to assertions docs (#12662) 2022-03-10 15:45:18 -08:00