Commit Graph

1069 Commits

Author SHA1 Message Date
Dmitry Gozman
9cd704220c
reland(test runner): run hooks/modifiers as a part of the test (#12518)
Reland: worker.stop() before worker.run() was hanging because
`_runFinished` promise was not initially resolved.
---
This moves `beforeAll`, `afterAll` and some modifiers from running
as a separate entity into running inside a test.

Pros:
- All errors are reported as test errors.
- All artifacts are collected as test artifacts.
- Reporters support this out of the box.

Details:
- Each test computes the necessary hooks to run and runs them.
- Teardown is usually performed during the test (on test failure or worker stop).
- `skipRemaining` is added to `DonePayload` to preserve the behavior
  where `beforeAll` hook failure skips subsequent tests.
  This behavior can now be improved to only target tests affected by this hook.
2022-03-08 16:35:14 -08:00
Andrey Lushnikov
b8af8458d6
fix: explicitly ignore maxDiffPixels in toMatchSnapshot (#12570)
Fixes #12564
2022-03-07 16:55:35 -08:00
Andrey Lushnikov
e8ad7eb3f2
browser(firefox): roll Firefox to M97 (#12574)
Firefox 98 doesn't work on Ubuntu aarch64 yet.

https://github.com/microsoft/playwright/issues/12557
2022-03-07 16:16:42 -08:00
Dmitry Gozman
d836ed41d3
feat(remote): send 'x-playwright-browser' header (#12556) 2022-03-07 10:30:53 -08:00
github-actions[bot]
702536d962
feat(webkit): roll to r1616 (#12541)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2022-03-06 12:22:47 +01:00
Andrey Lushnikov
d7648d390c
fix(toHaveScreenshot): round ratio up (#12540)
This way the ratio value could be used right away in configuation.
2022-03-04 18:55:48 -08:00
Andrey Lushnikov
a3dff45974
chore: remove maxDiffPixels from toMatchSnapshot (#12539)
References #12441
2022-03-04 18:27:04 -08:00
Andrey Lushnikov
4953fc4845
chore: introduce toHaveScreenshot configuration options (#12507)
References https://github.com/microsoft/playwright/issues/12441
2022-03-04 17:30:43 -08:00
Ross Wollman
281945c8b6
test: typo fix (#12531) 2022-03-04 17:09:18 -08:00
Karan Shah
fd1a1a2b1c
feat(android): Adding custom port parameter to connect to different adb server port (#12220) 2022-03-04 20:27:25 +01:00
Andrey Lushnikov
b45c788a33
fix(disable-animations): rename boolean to enum (#12503)
Enums are more flexible in the long run since they let us easily
extend API.

References #12441
2022-03-04 11:02:59 -08:00
Andrey Lushnikov
1f5cfcaeec
fix(to-have-screenshot): show number of bad pixels in mismatched error (#12502)
Drive-by: do not show empty call log.

References #12441
2022-03-04 11:01:05 -08:00
Andrey Lushnikov
279e579097
chore: address pixelCount and pixelRatio review comments (#12501)
- documentation fixes
- rename pixelCount to maxDiffPixels
- rename pixelRatio to maxDiffPixelRatio
2022-03-03 23:17:31 -08:00
Pavel Feldman
34bf0d4b87
feat(test-runner): allow grepping in project (#12469) 2022-03-02 15:02:35 -08:00
Max Schmitt
cfcdc3e19c
chore: roll stable test-runner to ToT (#12472) 2022-03-02 23:47:55 +01:00
Max Schmitt
cb5b4cf06b
test: skip highlight tests on != default mode (#12471) 2022-03-02 23:46:33 +01:00
Max Schmitt
b2e3357613
chore: throw error if setCookies expires value is not valid (#12470) 2022-03-02 23:10:40 +01:00
Yury Semikhatsky
608873e945
test: inputValue works for label selector (#12447) 2022-03-02 09:33:44 -08:00
Yury Semikhatsky
2d7ec26dc2
fix(fetch): send secure cookies for http://localhost requests (#12450) 2022-03-02 09:33:30 -08:00
Pavel Feldman
4b19d59ec5
feat(test): introduce fully parallel mode (#12446) 2022-03-01 18:12:21 -08:00
Pavel Feldman
61a6cdde70
feat(api): expose locator.highlight (#12420) 2022-03-01 13:56:21 -08:00
Max Schmitt
e0e6b66cbe
chore(android): align android context options with mixin (#12401) 2022-03-01 18:11:38 +01:00
Pavel Feldman
6a663ef54f
chore(test-runner): revert recent changes to fix tests (#12439)
* Revert "fix(hooks): separate test timeout from beforeAll/afterAll timeouts (#12413)"

This reverts commit 73dee69558.

* Revert "fix(test-runner): rely on test title paths instead of ordinal (#12414)"

This reverts commit d744a87aee.

* Revert "chore(test runner): run hooks/modifiers as a part of the test  (#12329)"

This reverts commit 47045ba48d.
2022-03-01 09:11:17 -08:00
Max Schmitt
d2ae6a9db2
fix: isDisabled check with option/optgroup (#12437) 2022-03-01 18:10:16 +01:00
Pavel Feldman
d14ecec612
chore: remove flaky-by-design test (#12434) 2022-03-01 08:52:52 -08:00
Andrey Lushnikov
1a7a3bf99d
chore: fix types for tests (#12429) 2022-03-01 01:32:40 -08:00
Andrey Lushnikov
66eda836c9
browser(ff-beta): roll Firefox-Beta to 98b10 (#12421)
Firefox reverted the third-party cookies recently:
https://bugzilla.mozilla.org/show_bug.cgi?id=1751435

Thus changes in tests.

References #12225
2022-03-01 00:17:33 -08:00
Andrey Lushnikov
d744a87aee
fix(test-runner): rely on test title paths instead of ordinal (#12414)
Fixes #11904
2022-02-28 15:40:23 -08:00
Dmitry Gozman
73dee69558
fix(hooks): separate test timeout from beforeAll/afterAll timeouts (#12413)
This makes it possible to have longer `beforeAll`/`afterAll` and not
affect first/last test timeout.
2022-02-28 15:09:04 -08:00
Mateusz Burzyński
eaa98ce53a
feat(keyboard): support simple copy-pasting using meta+c/v (#10828)
It's a straightforward change to support new, common, keyboard commands

Note that I've tested this locally with Chrome on my Mac but it seems that CI doesn't want to pass Chrome tests - it's running on ubuntu though. Does this mean that I should introduce per-platform editing commands? At the moment there is only a single [`macEditingCommands`](0ed33522c5/packages/playwright-core/src/server/macEditingCommands.ts) file.

References https://github.com/microsoft/playwright/issues/12000

Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2022-02-28 13:43:43 -08:00
Andrey Lushnikov
f47423d315
devops: upload test-runner test results to flakiness dashboard (#12412)
Fixes #12152
2022-02-28 13:41:30 -08:00
Andrey Lushnikov
396d920145
feat(test-runner): implement expect(pageOrLocator).toHaveScreenshot (#12242)
Fixes #9938
2022-02-28 12:25:59 -08:00
Dmitry Gozman
47045ba48d
chore(test runner): run hooks/modifiers as a part of the test (#12329)
chore(test runner): run hooks/modifiers as a part of the test

This moves `beforeAll`, `afterAll` and some modifiers from running
as a separate entity into running inside a test.

Pros:
- All errors are reported as test errors.
- All artifacts are collected as test artifacts.
- Reporters support this out of the box.

Details:
- Each test computes the necessary hooks to run and runs them.
- Teardown is usually performed during the test (on test failure or worker stop).
- `skipRemaining` is added to `DonePayload` to preserve the behavior
  where `beforeAll` hook failure skips subsequent tests.
  This behavior can now be improved to only target tests affected by this hook.
2022-02-28 11:42:47 -08:00
Dmitry Gozman
3c2bca2768
fix(test loader): implement tsconfig paths through resolveFilename (#12357)
This uses `Module._resolveFilename` to intercept module resolution and
check `tsconfig.paths` similarly to pirates usage ot `Module._compile`.

Previously, we resolved during compilation that required reproducible
resolution due to caching. Now we can resolve as we go and support
all `tsconfig.paths`.
2022-02-25 15:43:58 -08:00
Max Schmitt
6438aed36c test: skip test in electron
Follow-up for #12371
2022-02-26 00:17:37 +01:00
Max Schmitt
e035ed488c
test: add test for cookies with expiration (#12304) 2022-02-25 23:00:51 +01:00
Max Schmitt
a95d2320ad
test: mark failing android tests as fixme / fix them (#12371) 2022-02-25 22:56:51 +01:00
Max Schmitt
821a8e93c7
chore: do not double trim in trace viewer (#12338) 2022-02-24 21:55:50 +01:00
Dmitry Gozman
91672595f2
fix(reporters): normalize usage of isTTY, env.CI and debug env variables (#12295)
- `stdout.isTTY` controls whether list reporter updates lines or just adds them;
- `env.CI` is used in a few places to affect the defaults:
  - whether to open interactive html;
  - default reporter dot/line;
  - default terminal reporter added to non-terminal reporters;
- `env.PWTEST_SKIP_TEST_OUTPUT` is removed;
- `env.PW_TEST_DEBUG_REPORTERS` is introduced specifically for tests.
2022-02-24 12:39:28 -08:00
Andrey Lushnikov
5879c7f362
chore: refactor toMatchSnapshot once again (#12313)
Keep massaging code in preparation for `toHaveScreenshot`.

References #9938
2022-02-23 13:17:37 -08:00
Dmitry Gozman
4399623f9f
chore(test runner): make timeout a separate error in TestInfo.errors (#12315)
This way we control the timeout error message from the runner,
so that later on we can differentiate between test timeout, fixture
timeout and hook timeout.
2022-02-23 12:32:12 -08:00
Dmitry Gozman
114edecd3a
fix(list mode): keep outputDir intact (#12291) 2022-02-22 12:50:26 -08:00
Max Schmitt
be2e4866b0
test: add test for sendBeacon and asserting request body (#12274) 2022-02-22 20:15:24 +01:00
Dmitry Gozman
d3c4323021
fix(test runner): improve error message for unexpected calls (#12240) 2022-02-18 18:25:18 -08:00
Dmitry Gozman
ee0dd6ec71
fix(test runner): trim full output path (#12239)
Previously, we only trimmed the "full title" component, but
we should also trim the "relative path" component.
2022-02-18 15:40:36 -08:00
Andrey Lushnikov
0682672242
chore: move comparator logic to playwright-core (#12232)
This will enable implementation of `toHaveScreenshot` on the
server-side.

Drive-by: drop blink-diff

References #9938
2022-02-18 14:39:17 -08:00
Andrey Lushnikov
b9e86b79ee
chore: refactor toMatchSnapshot implementation (#12206)
This patch prepares for the `toHaveScreenshot` implementation
by splitting common parts from `toMatchSnapshot`.

Drive-by: fix default extension generation from `.bin` to `.dat`
for unknown buffers.
2022-02-18 11:21:58 -08:00
Dmitry Gozman
edac84d072
feat(remote): send browser/channel/headless in a header (#12205) 2022-02-18 07:54:33 -08:00
Dmitry Gozman
34eec7eae7
fix(webServer): route output through reporters (#12198) 2022-02-18 07:54:01 -08:00
Dmitry Gozman
15043801cb
chore: use transport for BrowserType.connect (#12196)
This gives us logging, ECONNRESET error handling and proper cleanup.
2022-02-17 20:48:14 -08:00