Dmitry Gozman
56dbd1fcb0
chore: remove usesCustomOutputDir from tests ( #21011 )
2023-02-18 11:41:41 -08:00
Dmitry Gozman
55f4b670a9
fix(test runner types): allow sync step functions ( #20996 )
2023-02-17 14:26:40 -08:00
Yury Semikhatsky
09be9d6425
feat: key value store backed by filesystem ( #20932 )
...
Keys are used as a relative file path without any sanitization assuming
that the underlying fs will throw on error.
2023-02-16 16:48:28 -08:00
Pavel Feldman
96050a260e
chore(junit): render project as an agent name / hostname ( #20927 )
2023-02-16 07:59:05 -08:00
Dmitry Gozman
6f140d79d4
chore: do not create dummy config file in tests ( #20935 )
2023-02-16 06:56:52 -08:00
Yury Semikhatsky
90c4e6f9b2
chore: revert sharded html report ( #20923 )
...
We've decided not to ship it in the current form.
#10437
2023-02-15 12:38:03 -08:00
Dmitry Gozman
91da67fab1
test: remove magic headers in ttest ( #20867 )
...
Instead, explicitly import from '@playwright/test'.
2023-02-14 19:20:56 -08:00
Pavel Feldman
08be39a80e
fix(watch): fix the tests on win ( #20844 )
2023-02-14 14:55:49 -08:00
Pavel Feldman
7f0763d789
chore: hide watch mode, it is not ready ( #20905 )
2023-02-14 13:22:44 -08:00
Pavel Feldman
798696a18a
chore: fix context reuse disposal ( #20876 )
...
Fixes: https://github.com/microsoft/playwright/issues/20409
2023-02-14 12:56:47 -08:00
Dmitry Gozman
6d03211439
fix(test runner): --list should ignore '.only' annotations ( #20868 )
2023-02-13 11:13:30 -08:00
Andrey Lushnikov
fdcd7b549d
chore: mark comparator
option back as experimental ( #20816 )
...
This reverts commit 303c5998f8
.
Reason for revert: I tried enabling `ssim-cie94` by default on
ionic-framework test suite, and it proves to be overly strict for their
usecase.
2023-02-13 11:11:44 -08:00
Joel Einbinder
997dfa9274
fix(reporter): properly indent multiline attachments ( #20847 )
...
Text attachments were only indented on the first line.
2023-02-13 10:28:34 -08:00
Dmitry Gozman
de69b766d9
test: code health in ttest ( #20837 )
...
- Remove duplicate tests.
- Remove unused test helpers.
- Print full watch output on failures.
- Unflake some tests.
2023-02-10 20:26:19 -08:00
Dmitry Gozman
789b1c75e6
fix(expect): report received when timedOut during oneShot ( #20806 )
2023-02-10 14:59:21 -08:00
Pavel Feldman
1ba768bf60
chore: make watch + ct happy ( #20804 )
2023-02-10 08:33:25 -08:00
Pavel Feldman
4469e57695
chore: always grow component bundle ( #20799 )
...
Fixes https://github.com/microsoft/playwright/issues/20581
2023-02-09 18:39:20 -08:00
Pavel Feldman
69c4653c6b
chore: speculative windows cli fix ( #20801 )
2023-02-09 16:04:07 -08:00
Pavel Feldman
e1f287f255
chore: more watch tests ( #20797 )
2023-02-09 16:03:54 -08:00
Pavel Feldman
596ed97791
chore: add more watch tests ( #20793 )
2023-02-09 13:57:00 -08:00
Pavel Feldman
5112abc1d2
chore: fix a racy time-based test ( #20783 )
2023-02-09 08:49:51 -08:00
Pavel Feldman
b247bfe153
test(watch): start adding tests ( #20764 )
2023-02-09 08:31:02 -08:00
Pavel Feldman
7a093329fa
chore: do not run all on watch ( #20758 )
2023-02-08 12:44:51 -08:00
Pavel Feldman
11168efb0e
chore: roll stable-test-runner to ToT ( #20754 )
2023-02-08 10:02:20 -08:00
Yury Semikhatsky
a93cf767a1
feat: html reporter sharded option ( #20737 )
...
Make sharded report feature an opt-in:
```ts
{
reporter: [['html', { sharded: true }]]
};
```
#10437
2023-02-07 22:21:50 -08:00
Pavel Feldman
4259d4e1d6
chore: implement repeat last run ( #20727 )
2023-02-07 15:56:39 -08:00
Pavel Feldman
1b941bcf2e
chore: simplify ttests ( #20733 )
2023-02-07 15:11:44 -08:00
Yury Semikhatsky
f10b29fd5e
feat: show warning when some report shards are missing ( #20731 )
...
When some of the report shards are missing still show the report but
display an error in the status line:
![image](https://user-images.githubusercontent.com/9798949/217371112-2317a307-204e-4c11-8d01-42e91fe6ca7a.png )
#10437
2023-02-07 14:22:10 -08:00
Yury Semikhatsky
8f53bf7b41
feat: sharded html report ( #20700 )
...
This implementation is based on the [original
PR](https://github.com/microsoft/playwright/pull/19691 ) by @kevin940726.
It makes the reporter produce single file when there is no sharding and
multiple out-of-line report-x-of-y.zip reports which are automatically
merged together when put in one folder.
References https://github.com/microsoft/playwright/issues/10437
Co-authored-by: Kai Hao <kevin830726@gmail.com>
2023-02-07 10:21:26 -08:00
Andrey Lushnikov
303c5998f8
feat: release "comparator" option from experiment ( #20720 )
...
The option defines a comparator to be used to compare images.
Possible values are `"pixelmatch"` and `"ssim-cie94"`.
Note: This reverts commit 8167f8bf54
.
2023-02-07 08:51:48 -08:00
Pavel Feldman
361ea949aa
chore: respect deps when watching files ( #20695 )
2023-02-06 17:09:16 -08:00
Pavel Feldman
b6df48758d
chore: collect test dependencies ( #20645 )
2023-02-06 14:52:40 -08:00
Dmitry Gozman
e64c623e61
feat(expect): strip down Expect types ( #20601 )
...
This only leaves:
- documented assertions;
- asymmetric matchers;
- `resolves`/`rejects`;
- `expect.extend()`;
- `expect.getState()` with selected properties.
References #20432 .
2023-02-03 15:56:31 -08:00
Sam Chen
340cacf4fd
feat: show diff tab by default ( #19820 )
...
Close https://github.com/microsoft/playwright/issues/19803
I had to manually inject `window.playwrightReportBase64` data into
`playwright/packages/html-reporter/index.html` when developing,
wondering if there's any method I don't know.
2023-02-03 10:32:23 -08:00
Andrey Lushnikov
f45f20a8c9
fix: handle not.toPass() with expect.soft inside ( #20596 )
...
Fixes #20518
2023-02-03 09:14:05 -08:00
Dmitry Gozman
3180bc9804
fix(types): make most fixtures non-undefined ( #20573 )
...
Fixes #20416 .
2023-02-02 13:11:50 -08:00
Andrey Lushnikov
4f61105032
fix: swallow expect.soft errors inside successful toPass matcher ( #20509 )
...
Fixes #20437
2023-02-02 10:47:20 -08:00
Dmitry Gozman
5fb430a743
fix(test runner): do not print timeout message upon interrupt ( #20574 )
...
We should only print "Test was interrupted."
Regressed in #18321 .
2023-02-01 19:39:43 -08:00
Dmitry Gozman
f46883e58e
feat(expect): add GenericAssertions documentation ( #20564 )
...
References #20432 .
2023-02-01 16:55:52 -08:00
Pavel Feldman
421dd884a7
chore: implement --no-deps ( #20569 )
2023-02-01 16:32:13 -08:00
Pavel Feldman
635b47025e
chore: expose project dependencies api ( #20546 )
2023-02-01 08:39:07 -08:00
Pavel Feldman
08e4b50ff6
chore: project deps ( #20514 )
2023-01-31 15:59:13 -08:00
Dmitry Gozman
9c6c31a442
fix(types): update PlaywrightTestConfig types ( #20540 )
...
This makes errors more focused on the custom properties.
References #20416 .
2023-01-31 15:02:01 -08:00
Yury Semikhatsky
a03f3223c4
fix: trim long expect messages ( #20517 )
...
Fixes #20324
2023-01-30 17:24:12 -08:00
chimurai
f72d400952
chore: fix typos ( #20473 )
2023-01-30 09:53:28 +01:00
Pavel Feldman
2c27bd3b07
chore: remove plugin registration sink ( #20460 )
2023-01-27 14:36:41 -08:00
Pavel Feldman
f7ff252455
chore: remove addFatalError ( #20383 )
2023-01-25 17:26:30 -08:00
Pavel Feldman
fe1dd7818d
chore: extract task runner for global setup ( #20345 )
2023-01-25 15:38:23 -08:00
Dmitry Gozman
d1fb3a2384
fix(test runner): do not send entirely skipped test groups to a worker ( #20346 )
...
Move TestCase properties calculation from WorkerMain to suite building
phase.
Fixes #20156 .
2023-01-25 12:54:50 -08:00
Dmitry Gozman
b971dd3417
fix(test runner): show deep strack traces during imports ( #20305 )
...
Fixes #20239 .
2023-01-24 08:49:06 -08:00
Pavel Feldman
147bb6b292
chore: run global setup before onBegin ( #20285 )
2023-01-23 17:44:23 -08:00
Pavel Feldman
9f31bcfbab
chore: refactor graceful close, rename to host/main ( #20283 )
2023-01-22 15:04:29 -08:00
Dmitry Gozman
b700c08dc5
feat(screenshots): when actual and expected have different sizes, pad and produce the diff image ( #20208 )
...
Also show sizes in the html report to easier spot the size mismatch
issue.
<img width="1030" alt="diff"
src="https://user-images.githubusercontent.com/9881434/213327632-b8fcd69c-8d08-460c-9de1-b5f4f8c56359.png ">
Fixes #15802 .
2023-01-20 19:41:43 -08:00
Pavel Feldman
7ff27600b4
chore: experimental oop loader ( #20269 )
2023-01-20 18:24:15 -08:00
Dmitry Gozman
eafa6fda13
fix(expect): poll/toPass should not wait over specified timeout ( #20266 )
...
Drive-by: unflake some timeout-dependent tests.
2023-01-20 15:47:24 -08:00
Pavel Feldman
3066ffd577
chore: use fake pool on the runner side ( #20241 )
2023-01-20 08:36:31 -08:00
Pavel Feldman
e08168e16e
chore: temporarily remove project and global setup, store ( #20181 )
2023-01-18 12:56:03 -08:00
Max Schmitt
0656ab4811
chore: roll stable test-runner to 1.30.0-alpha-jan-16-2023 ( #20139 )
2023-01-17 19:23:24 +01:00
Andrey Lushnikov
92375f6333
fix: support import assertions ( #20009 )
...
Fixes #19928
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-01-16 08:26:14 -08:00
Pavel Feldman
d1c161ce99
chore: merge the util exports ( #20110 )
2023-01-13 13:50:38 -08:00
Pavel Feldman
736cf5c585
fix(tsx): resolve .js imports to .tsx as well ( #20092 )
...
Fixes: https://github.com/microsoft/playwright/issues/20039
2023-01-13 10:49:10 -08:00
Pavel Feldman
e065d608b6
chore: introduce defineConfig for easier JS typing ( #20061 )
...
Fixes https://github.com/microsoft/playwright/issues/19694
2023-01-12 13:12:02 -08:00
Yury Semikhatsky
730a197c80
feat: config.globalScripts ( #20062 )
...
Introduce config.globalScripts. Tests from the matching files will run
before all projects. We'll only allow beforeAll/afterAll instead of
tests in such files (next PR).
Global scripts are executed as part of 'Global Scripts' project which is
not present in FullConfig.projects but may be referenced by
corresponding global setup Suites.
Signed-off-by: Yury Semikhatsky <yurys@chromium.org>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2023-01-12 13:02:54 -08:00
Max Schmitt
e2a2196e6a
chore(html-reporter): show project name always for the test file ( #19905 )
...
Fixes https://github.com/microsoft/playwright/issues/19874
2023-01-10 17:11:38 +01:00
Dmitry Gozman
28577afde4
feat(soft expect): mark steps with failed soft expects as failed ( #19973 )
...
Fixes #19673 .
2023-01-09 16:17:06 -08:00
Yury Semikhatsky
a39a97f0ee
chore: setup -> test.projectSetup ( #19932 )
...
* Changed `setup` to `test.projectSetup`
* Only `test.projectSetup.only` is supported on the new method
* test.* methods except for before/after/Each/All hooks can be called
inside the project setup files
2023-01-09 11:21:48 -08:00
Dmitry Gozman
31a63b5c2a
fix(reuse): make reuse work with tracing ( #19733 )
...
Fixes #19059 .
2023-01-05 14:50:47 -08:00
Andrey Lushnikov
1afa38d5a7
chore(expect): extract polling from expect.poll and expect().toPass ( #19882 )
...
This extracts & unifies polling machinery from `expect.poll` and
`expect.toPass` methods.
2023-01-05 11:14:37 -08:00
Dmitry Gozman
388a3e1f37
fix(test runner): make sure to run afterAll after skipped tests ( #19878 )
...
Fixes #19745 .
2023-01-04 14:13:49 -08:00
Dmitry Gozman
6193e6d8ea
fix(reuse): reset tracing ( #19876 )
...
References #19059 .
2023-01-04 13:19:05 -08:00
Grant Colestock
a30aac5668
fix: make sure jsx fragments are transformed ( #19755 )
...
Fixes : #19142
2022-12-31 11:08:36 -08:00
Sander
b363902e1b
feat(ct): https ( #19697 )
2022-12-28 17:04:23 -08:00
Dmitry Gozman
5cdf118a42
fix(reuse): disable trace/video when reusing the context ( #19764 )
...
Previously, we disabled reuse when trace/video was on. Component testing
keeps this behavior.
References #19059 .
2022-12-28 16:58:34 -08:00
Yury Semikhatsky
137070d889
Revert "chore: hide setup, store, TestProject.setupMatch, storageStat… ( #19756 )
...
…eName (#19442 )"
This reverts commit 92dd734e04
.
2022-12-28 15:39:31 -08:00
Pavel Feldman
233664bd30
chore: report more fatal errors via reporter ( #19640 )
2022-12-22 17:31:02 -08:00
Ross Wollman
06c7f1fb6c
fix(html): test and fix reporter timing display ( #19670 )
...
#19576 introduced a regression where the CLI reporters displayed some
times with way too many decimals. e.g. 7.123456789ms.
Prior to #19576 , there were two monotonicTime implementations; that PR
updated the reporters to use the common definition that had existed in
utils.ts. However, that introduced a regression in the base.ts reporters
which used the ms duration humanizing package which did not account for
the more precise decimals used by the shared monotonicTime function.
This fix removes the dependency on the third-party ms package and now
consistently uses Pavel's humanize function which the HTML reporter had
been using and proved to have better defaults for decimals.
Additionally, we add more test coverage to limit future regressions
since this was caught in passing.
Closes #19556 .
Relates #19576 .
2022-12-22 15:57:55 -08:00
Dmitry Gozman
b8848fb499
fix(test runner): make sure undefined options in config result in default values ( #19632 )
...
Note: this keeps existing behavior of `undefined` in `test.use()`
reverting to the config value and not to the original default value.
References #19615 .
2022-12-21 14:34:43 -08:00
Dmitry Gozman
eaae8ebbf3
chore: throw InvalidSelectorError from selector parser, add some tests ( #19636 )
2022-12-21 14:27:35 -08:00
Dmitry Gozman
d12bc0be9a
fix(screenshot): account for screenshot === undefined
( #19627 )
2022-12-21 10:16:36 -08:00
Pavel Feldman
675f0eb4a0
chore: report error location for fatal errors ( #19610 )
2022-12-21 09:36:59 -08:00
Ross Wollman
0844394270
feat(html): display overall duration ( #19576 )
...
<img width="1390" alt="Screenshot 2022-12-19 at 4 15 33 PM"
src="https://user-images.githubusercontent.com/11915034/208552484-c0127615-d2c6-414f-ae3b-e7836553d890.png ">
* Adds duration (time ellapsed from `onBegin` to `onEnd`); roughly
equivalent to `time npx playwright test …`.
* Removes cumulative per-file time
Resolves #19566 .
2022-12-20 14:13:10 -08:00
Andrey Lushnikov
d7e7cab44a
fix: properly handle negated timed-out toPass
matcher ( #19580 )
2022-12-20 08:41:32 -08:00
Han Yeong-woo
00ffd74727
fix(runner): import export assignment from ts ( #19559 )
2022-12-19 14:41:29 -08:00
Vladimir Semenov
467d9f37fc
feat(reporter): Add parallelIndex
field to TestResult
( #19570 )
2022-12-19 14:37:04 -08:00
Pavel Feldman
0e2732decf
feat(api): introduce expect().toPass ( #19463 )
2022-12-14 19:23:13 -08:00
Andrey Lushnikov
8167f8bf54
chore: hide "comparator" option from documentation and types ( #19441 )
2022-12-14 09:58:19 -08:00
Yury Semikhatsky
92dd734e04
chore: hide setup, store, TestProject.setupMatch, storageStateName ( #19442 )
2022-12-13 22:48:38 -08:00
Dmitry Gozman
ab9602bebf
chore: remove unused PW_TEST_OUT_OF_PROCESS_DRIVER ( #19434 )
2022-12-13 16:04:44 -08:00
Fernando Garcia Llorente
cd4ccdfa29
feat: allow options in automatic screenshots ( #19143 )
...
Closes #9983
Allowing Automatic Screenshots in `PlaywrightTestConfig` to have
`fullPage` & `omitBackground` as optional parameters.
2022-12-07 08:45:33 -08:00
Dmitry Gozman
d294c5da33
chore: roll stable-test-runner to 1.28.1 ( #19310 )
...
This required `allowJs: false` in our `tsconfig.json` due to the
following error:
```
Error: Cannot find module './utilsBundleImpl'
Require stack:
- <playwright>/packages/playwright-core/src/utilsBundle.ts
- <playwright>/packages/playwright-test/lib/reporters/html.js
- <playwright>/tests/playwright-test/reporter-html.spec.ts
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/@playwright/test/lib/loader.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/@playwright/test/lib/runner.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/@playwright/test/lib/cli.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/playwright-core/lib/cli/cli.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/playwright-core/cli.js
- <playwright>/tests/playwright-test/stable-test-runner/node_modules/@playwright/test/cli.js
at ../../packages/playwright-core/src/utilsBundle.ts:20
18 | import path from 'path';
19 |
> 20 | export const colors: typeof import('../bundles/utils/node_modules/colors/safe') = require('./utilsBundleImpl').colors;
| ^
21 | export const debug: typeof import('../bundles/utils/node_modules/@types/debug') = require('./utilsBundleImpl').debug;
22 | export const getProxyForUrl: typeof import('../bundles/utils/node_modules/@types/proxy-from-env').getProxyForUrl = require('./utilsBundleImpl').getProxyForUrl;
23 | export const HttpsProxyAgent: typeof import('../bundles/utils/node_modules/https-proxy-agent').HttpsProxyAgent = require('./utilsBundleImpl').HttpsProxyAgent;
at Object.<anonymous> (<playwright>/packages/playwright-core/src/utilsBundle.ts:20:83)
at Object.<anonymous> (<playwright>/packages/playwright-test/src/reporters/html.ts:17:1)
```
2022-12-06 15:46:19 -08:00
Yury Semikhatsky
beb15bb504
chore: rename setup => setupMatch ( #19309 )
2022-12-06 14:55:22 -08:00
Yury Semikhatsky
1b3e53697b
chore: TestStorage => TestStore ( #19308 )
2022-12-06 13:33:43 -08:00
Yury Semikhatsky
3c1b26b9f1
feat: make storage a global variable ( #19283 )
2022-12-05 21:37:37 -08:00
Yury Semikhatsky
f9ef18912d
feat: use setup() instead of test() for project setup ( #19281 )
2022-12-05 18:15:01 -08:00
Andrey Lushnikov
6d82460a02
feat: implement a new image comparison function ( #19166 )
...
This patch implements a new image comparison function, codenamed
"ssim-cie94". The goal of the new comparison function is to cancel out
browser non-determenistic rendering.
To use the new comparison function:
```ts
await expect(page).toHaveScreenshot({
comparator: 'ssim-cie94',
});
```
As of Nov 30, 2022, we identified the following sources of
non-determenistic rendering for Chromium:
- Anti-aliasing for certain shapes might be different due to the
way skia rasterizes certain shapes.
- Color blending might be different on `x86` and `aarch64`
architectures.
The new function employs a few heuristics to fight these
differences.
Consider two non-equal image pixels `(r1, g1, b1)` and `(r2, g2, b2)`:
1. If the [CIE94] metric is less then 1.0, then we consider these pixels
**EQUAL**. (The value `1.0` is the [just-noticeable difference] for
[CIE94].). Otherwise, proceed to next step.
1. If all the 8 neighbors of the first pixel match its color, or
if the 8 neighbors of the second pixel match its color, then these
pixels are **DIFFERENT**. (In case of anti-aliasing, some of the
direct neighbors have to be blended up or down.) Otherwise, proceed
to next step.
1. If SSIM in some locality around the different pixels is more than
0.99, then consider this pixels to be **EQUAL**. Otherwise, mark them
as **DIFFERENT**. (Local SSIM for anti-aliased pixels turns out to be
very close to 1.0).
[CIE94]: https://en.wikipedia.org/wiki/Color_difference#CIE94
[just-noticeable difference]:
https://en.wikipedia.org/wiki/Just-noticeable_difference
2022-12-02 15:22:05 -08:00
Dmitry Gozman
6471e8536e
feat(test runner): support jsconfig.json's baseUrl+paths ( #19219 )
...
Fixes #19129 .
2022-12-01 16:42:25 -08:00
Dmitry Gozman
b1b21bdac5
fix(shards): zero-sized shard should not include all tests ( #19148 )
...
Fixes #19073 .
2022-11-29 16:02:11 -08:00
Dmitry Gozman
23e02dd006
test: unflake some timeout-dependent tests ( #19139 )
2022-11-29 12:54:53 -08:00
Shubham Kanodia
3d804ff7cd
chore: rewrite error message for missing snapshot ( #19104 )
2022-11-29 12:51:15 -08:00
Yury Semikhatsky
31d45ad4dc
chore(runner): add all setup files in separate pass ( #18978 )
2022-11-22 16:22:48 -08:00