1626 Commits

Author SHA1 Message Date
Pavel Feldman
676f014b5f
chore: use objects for string aria template notes (#33371) 2024-10-30 17:25:51 -07:00
Pavel Feldman
a43b99368e
chore: support aria snapshots in tsx (#33369) 2024-10-30 17:25:30 -07:00
Simon Knott
64802fc284
fix(line reporter): wrap chinese characters correctly (#33322) 2024-10-30 13:29:31 +01:00
Pavel Feldman
9ce401d44a
chore: suggest aria snapshots w/ regex (#33334) 2024-10-29 16:19:08 -07:00
Max Schmitt
9eb4fe5546
feat(pwt): serialize and expose Error.cause from Worker process (#32833) 2024-10-29 00:01:59 +01:00
Max Schmitt
19e863191c
test: use 'chrome' for UI mode tests (#33329) 2024-10-28 21:56:46 +01:00
Pavel Feldman
4b7c8d8a20
chore: use stable library along with the test runner in ttest (#33312) 2024-10-25 23:15:10 -07:00
Pavel Feldman
74e5e5560f
chore: update missing snapshots by default (#33311) 2024-10-25 16:13:38 -07:00
Yury Semikhatsky
1e8884621a
chore: unify toHaveScreenshot error formatting (#33300) 2024-10-25 12:36:39 -07:00
Pavel Feldman
9707e97867
chore: revert #33228 - it needs a proper review (#33284) 2024-10-25 09:36:03 +02:00
Pavel Feldman
ff5f1628dc
chore: allow aria snapshot rebaselines (#33256) 2024-10-24 16:49:10 -07:00
Dmitry Gozman
67471cb3c5
test: make a few tests headed/headless agnostic (#33268) 2024-10-24 06:03:36 -07:00
Simon Knott
3641e5984f
chore: HMR for Trace Viewer (#33228) 2024-10-24 14:34:59 +02:00
Dmitry Gozman
2e01154bb5
feat: screenshot:on-first-failure (#33266) 2024-10-24 04:41:35 -07:00
Max Schmitt
0d12fbe002
fix: have more friendly playwright-report error when opening TV via file:// (#33239) 2024-10-23 12:19:29 +02:00
Pavel Feldman
2a3d67195d
chore: use aria snapshots in some ui mode tests (#33212) 2024-10-21 21:54:06 -07:00
Pavel Feldman
97d26e8166
chore: add aria attribute tests (#33184) 2024-10-19 14:23:08 -07:00
Max Schmitt
b1fb4f16a7
chore: hide 'markdown' reporter (#33140) 2024-10-18 23:00:05 +02:00
Pavel Feldman
2e8e7a66cd
chore: implement tree w/o list (#33169) 2024-10-18 13:50:43 -07:00
Simon Knott
0d63df4875
feat(test runner): allow multiple global setups (#32955)
Signed-off-by: Simon Knott <info@simonknott.de>
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-10-18 11:03:00 +02:00
Pavel Feldman
29c84a33c3
chore: compute aria text consistently with the role accumulated text (#33157) 2024-10-17 17:06:18 -07:00
Pavel Feldman
623a8916f9
chore: implement tree w/o list (#33167) 2024-10-17 16:57:45 -07:00
Dmitry Gozman
aa952c1b03
fix(html report): generate test snippets when test dir is non-root (#33162) 2024-10-17 08:33:15 -07:00
Pengoose
d10a5e5693
feat(testType): add support for test.fail.only method (#33001) 2024-10-16 06:47:23 -07:00
Dmitry Gozman
ecd147ce43
fix(test runner): when sharding with beforeAll, use shards total instead of workers (#33083)
Otherwise, we might split the `beforeAll`-grouped test group into
`workers` parts instead of `shard.total` parts as the user would expect.

Fixes #33077.
2024-10-14 13:46:06 -07:00
Yury Semikhatsky
b9cce598dd
fix(screenshot): show image diff inline in errors list (#32997)
The diff is now shown inline in the errors list.

There are 2 possible failures of toHaveScreenshot
* Previous and actual snapshot mismatch. In this case html report will
show diff between Actual/Previous and have Expected as a separate
screenshot.
* Actual/Previous are equal but they differ from the expected. In this
case html report only contains Actual/Expected images and the diff.

Reference: https://github.com/microsoft/playwright/issues/32341

<img width="1039" alt="image"
src="https://github.com/user-attachments/assets/b458f986-cc25-4721-862c-0cc2c1b01a42">
2024-10-10 16:49:17 -07:00
Dmitry Gozman
25dd9b5cd4
feat: config.build.tsconfig (#33026)
Allows to specify `tsconfig` in the configuration file, which applies to
test files but not the config file itself.

Fixes #32808.
2024-10-10 01:37:46 -07:00
Simon Knott
892d67ffef
feat(test runner): allow stopping testrun with escape (#32584)
Closes https://github.com/microsoft/playwright/issues/32579
2024-10-08 11:39:54 -07:00
Max Schmitt
d0f2170e21
Revert "fix(test): do not allow mixing tests from different types (#29284)" (#33002)
This reverts commit 4784139bb0bce071c0745c6c07f623c37d3c70ce.

Closes https://github.com/microsoft/playwright/issues/29734
2024-10-08 16:00:40 +02:00
Max Schmitt
47a889ac48
chore: roll stable-test-runner to 1.48.0-beta-1728384960000 (#33008) 2024-10-08 14:01:45 +02:00
Dmitry Gozman
814f7eb556
test: fix/fixme/update a few tests (#33006) 2024-10-08 03:59:35 -07:00
Mark
04bf425268
feat(base-reporter): Add tags to test output (#32930) 2024-10-07 17:14:46 -07:00
Yury Semikhatsky
6ba5ee3a83
chore(ui-mode): expand all button (#32994)
<img width="230" alt="image"
src="https://github.com/user-attachments/assets/dd7fa3a1-39ec-4b88-9279-d664c9c4e5cd">


Reference https://github.com/microsoft/playwright/issues/32825
2024-10-07 15:42:12 -07:00
Max Schmitt
dfa4ab8726
test: speed up only-changed CT test (#32947) 2024-10-04 10:06:56 +02:00
Simon Knott
29ffcdfc4e
test(html reporter): filtering by type works (#32931)
The folks who opened
https://github.com/microsoft/playwright/issues/32925 would benefit from
filtering by annotation existence. Turns out we already have it! This PR
adds a test to ensure it stays that way.
2024-10-02 16:29:27 +02:00
Simon Knott
c67a7335ab
chore(ui): ensure that --ignore-snapshots is respected (#32875)
Closes https://github.com/microsoft/playwright/issues/32868.

The actual fix was already delivered in
https://github.com/microsoft/playwright/pull/32798/files#diff-98ff2ff92b08ca7e8b274abb3ba6b2eec9bab332e340d062cc18ad1dfe505bf2R299,
this PR adds a test to ensure we don't regress.
2024-09-30 15:12:37 +02:00
Yury Semikhatsky
728b4814b4
test: fix recently added junit tests (#32844) 2024-09-26 19:32:54 -07:00
Yury Semikhatsky
5b85c71722
fix(junit): env variable should take precedence over config (#32842)
Fixes https://github.com/microsoft/playwright/issues/32826
2024-09-26 15:29:09 -07:00
Dmitry Gozman
6465f0b1bd
test: make sure custom asymmetric matchers work (#32829)
This adds a test for a regression introduced by #32366 and fixed by
#32795.
2024-09-26 06:27:37 -07:00
Dmitry Gozman
ff954b58eb
fix(test runner): cleanup DEBUG_COLORS usage (#32764)
`DEBUG_COLORS` we default to `1`, but we should not do that when it is
already defined to some value supplied by the user.

Closes #32543.
2024-09-26 03:15:46 -07:00
Yury Semikhatsky
b6783bb18b
fix(ui-mode): respect --tsconfig option (#32798)
Fixes https://github.com/microsoft/playwright/issues/32797
2024-09-24 19:59:15 -07:00
Pavel Feldman
755edfba5b
chore: fallback expect.extend to legacy (#32795) 2024-09-24 14:00:13 -07:00
Max Schmitt
8557b98aee
test: fix CR/LF warning on only-changed tests (#32772) 2024-09-24 01:32:36 +02:00
Dmitry Gozman
b3a82bef46
feat: do not record route calls in the trace (#32723)
These are represented in the network pane instead.
2024-09-21 10:17:59 -07:00
Dmitry Gozman
ace8cb2427
fix(test runner): page.pause() should enable debug mode (#32714)
Fixes #32706.
2024-09-20 00:41:16 -07:00
Max Schmitt
2b2a57abad
chore: enable @babel/plugin-syntax-import-attributes all the time (#32713) 2024-09-19 16:51:35 +02:00
Max Schmitt
48030a4eff
test: fix test expecations after Node.js 22.9.0 (#32695) 2024-09-19 10:52:29 +02:00
Max Schmitt
523ec83cad
chore: move Location type from testReporter.d.ts to test.d.ts (#32687) 2024-09-18 16:57:11 +02:00
Simon Knott
443f72dcbe
feat(watch): hide show-report prompt (#32666)
Closes https://github.com/microsoft/playwright/issues/32665
2024-09-18 08:17:13 +02:00
오소현
8761dafc73
feat(test runner): allow to pass arbitrary location to test.step (#32504)
Fixes https://github.com/microsoft/playwright/issues/30160

### Description:
This pull request introduces the ability to specify custom locations for
test steps in Playwright. By enabling the provision of arbitrary
locations to the test.step method, it resolves the limitation where
helper methods obfuscate the original call site, providing more accurate
and meaningful location data in test reports.

### Motivation:
To enhance the utility and clarity of test reports in Playwright.
Specifically, it addresses the need to trace test steps back to their
precise location in the code, which is especially important when steps
are abstracted in helper functions. This feature is crucial for
maintaining accurate documentation and facilitating debugging processes.

### Changes:
Added functionality to pass a custom location object to test.step.

### Expected Outcome:
This PR is expected to significantly improve the precision and
usefulness of diagnostic data in test reports by allowing specific
locations within helper functions to be accurately documented. It
facilitates better tracking of test executions and simplifies the
debugging process, making it easier for developers to understand and
address issues within complex tests.

### References:
Closes https://github.com/microsoft/playwright/issues/30160 -
"[Feature]: allow to pass arbitrary location to test.step"

**Code Check**
I conducted tests on this new feature by integrating it into some
existing test codes, and it worked well. I will attach the code used for
testing and a screenshot showing the successful outcome.

<details>
<summary>toggle dropdown</summary>
<div markdown="1">

```
import type { Location } from '../../../packages/playwright/types/testReporter'
...
test('should respect the back button', async ({ page }) => {
    await page.locator('.todo-list li .toggle').nth(1).check();
    await checkNumberOfCompletedTodosInLocalStorage(page, 1);
...
    await test.step('Showing active items', async () => {
      await page.getByRole('link', { name: 'Active' }).click();
    }, {location});
```

<img width="1109" alt="image"
src="https://github.com/user-attachments/assets/359feafa-0949-4c71-9426-46debef21bdd">
</div>
</details>
2024-09-17 08:11:21 -07:00