Commit Graph

542 Commits

Author SHA1 Message Date
Andrey Lushnikov
bbc1a4fea0
fix: print all missing libraries when used on unsupported linux distro (#12966)
This patch:
- Adds 3 new host platform types:
  * `generic-linux` and `generic-linux-arm64` for the unsupported
    linux distributions
  * `<unknown>` for non-supported OS versions
- Prints a warning when downloading Ubuntu browser builds on
  unsupported Linux distribution
- Makes sure launch doctor prints all missing shared libraries
  on unknown Linux distributions
- Also prints an `apt` command as an alternative to Playwright CLI
  dependency installation.
2022-03-23 14:06:14 -07:00
github-actions[bot]
53b84541ab
feat(chromium): roll to r983172 (#12995)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-23 20:34:23 +01:00
github-actions[bot]
2d5762c842
feat(webkit): roll to r1620 (#12971) 2022-03-23 11:30:42 -07:00
Max Schmitt
b69d0566bb
chore: disable Chromium CertificateTransparencyComponentUpdater feature (#12992) 2022-03-23 19:14:22 +01: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
Brian Rhoten
fb83d4b42c
fix(codegen): do not consider empty attributes for selector generation (#12880)
Co-authored-by: Brian Rhoten <brhoten@appriss.com>
2022-03-22 13:56:33 -07:00
Brandon Walderman
7db40071a8
fix(selenium): Use ms:edgeOptions with Edge. (#12933) 2022-03-22 12:46:00 -07:00
Dmitry Gozman
4b877213a1
fix(tracing): preserve control values without modifying DOM (#12939)
Previously, we preserved input/textarea values by providing
`value` attribute or text child. This produces DOM that does not
actually match the original page.

This change starts using special attributes to modify values
directly when rendering.

Same treatment is also applied to options in `select` and
`checked` property of checkboxes and radio buttons.
2022-03-21 18:51:48 -07:00
Dmitry Gozman
dea6528c0c
feat(aria): introduce role utils (#12916)
This includes aria role and accessible name computation.
Accessible name is covered by wpt tests.
2022-03-21 17:26:45 -07:00
Andrey Lushnikov
7f51336068
fix: allow toMatchSnapshot to use text comparator for text data (#12934)
This was regressed awhile ago.

In v1.17 we shipped the following code: 30e15ad36f/packages/playwright-test/src/matchers/golden.ts (L122-L131)

`toMatchSnapshot` should fallback to text comparator in case of
unknown extension and string data.

Fixes #12862
2022-03-21 16:42:21 -07:00
github-actions[bot]
478a75401a
feat(webkit): roll to r1619 (#12905) 2022-03-21 15:15:56 -07:00
Andrey Lushnikov
c18077c0de
feat(toHaveScreenshot): align screenshot generation & comparison (#12812)
This patch aligns the strategies that are used to generate new
screnshot expectations and to compare screenshot expectations against
baseline.

With this patch, `toHaveScreenshot` will:
- when generating a new expectation: will wait for 2 consecutive
  screenshots to match and accept the last one as expectation.
- when given an expectation:
  * will compare first screenshot against expectation. If matches,
    resolve successfully
  * if first screenshot doesn't match, then wait for 2 consecutive
    screenshots to match and then compare last screenshot with the
    expectation.

An example of a new detailed call log:

```
  1) a.spec.ts:3:1 › should work ===================================================================

    Error: Screenshot comparison failed:

      20000 pixels (ratio 0.03 of all image pixels) are different

    Call log:
      - expect.toHaveScreenshot with timeout 5000ms
      -   verifying given screenshot expectation
      - fast-path: checking first screenshot to match expectation
      - taking page screenshot
      -   disabled all CSS animations
      -   waiting for fonts to load...
      -   fonts in all frames are loaded
      - fast-path failed: first screenshot did not match expectation - 20000 pixels (ratio 0.03 of all image pixels) are different
      - waiting for 2 consecutive screenshots to match
      - waiting 100ms before taking screenshot
      - taking page screenshot
      -   disabled all CSS animations
      -   waiting for fonts to load...
      -   fonts in all frames are loaded
      - 2 consecutive screenshots matched
      - final screenshot did not match expectation - 20000 pixels (ratio 0.03 of all image pixels) are different
      - 20000 pixels (ratio 0.03 of all image pixels) are different

    Expected: /Users/andreylushnikov/tmp/test-results/a-should-work/should-work-1-expected.png
    Received: /Users/andreylushnikov/tmp/test-results/a-should-work/should-work-1-actual.png
        Diff: /Users/andreylushnikov/tmp/test-results/a-should-work/should-work-1-diff.png

      3 | test('should work', async ({ page }) => {
      4 |   await page.goto('file:///Users/andreylushnikov/prog/playwright/tests/assets/rotate-z.html');
    > 5 |   await expect(page).toHaveScreenshot();
        |                      ^
      6 | });
      7 |
```
2022-03-21 15:10:33 -07:00
github-actions[bot]
67e754f6b5
feat(firefox): roll to r1320 (#12928) 2022-03-21 13:40:41 -07:00
Yury Semikhatsky
0adf5536af
docs(fetch): clarify cookie handling (#12892) 2022-03-21 13:20:17 -07:00
github-actions[bot]
9a60067fc2
feat(chromium): roll to r982481 (#12903)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-19 13:06:55 +01:00
Pavel Feldman
e044bae888
chore: make count() work with _vue selectors (#12899) 2022-03-18 21:22:33 -07:00
Dmitry Gozman
85b01056b6
fix(click): workaround elementsFromPoint issue in Chromium (#12888)
Block elements inside elements are not returned correctly
from `document.elementsFromPoint(x, y)` in some cases.
See https://bugs.chromium.org/p/chromium/issues/detail?id=1307458 for details.
2022-03-18 18:20:48 -07:00
Pavel Feldman
98ed81dc00
chore: do not initialize full sessions for pages used in session restore (#12886) 2022-03-18 18:17:37 -07:00
Max Schmitt
dd32956ccc
chore: improve handling with missing xserver (#12724) 2022-03-18 22:39:11 +01:00
Max Schmitt
d795f5dd64
chore: print error if install-deps is used != ubuntu (#12877) 2022-03-18 19:13:11 +01:00
Yury Semikhatsky
a8d80621b2
feat(chromium): large file uploads (#12860) 2022-03-18 09:00:52 -07:00
Pavel Feldman
c7d6f96328
chore: disambiguate internal flags (#12866) 2022-03-17 18:27:33 -07:00
Yury Semikhatsky
1284ab8101
feat(webkit): bump to 1617, freeze macOS 10.15 (#12790) 2022-03-15 16:09:56 -07:00
Dmitry Gozman
f8c4cb3d24
fix(screenshot): do not stall on hideHighlight (#12764) 2022-03-15 14:13:45 -07:00
github-actions[bot]
08c29b305b
feat(chromium): roll to r980398 (#12757)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-14 18:51:46 -07:00
Andrey Lushnikov
88610c8b4c
fix: properly define apiName for web-first assertions (#12706)
Turns out relying on PWTRAP in stack is not reliable: depending on the
call structure, the stack might be cut unpredictably by Node.js.

This patch removes PWTRAP and instead plumbs explicit stack and
pre-set `apiName` all the way down to `wrapApiCall`.
2022-03-14 18:01:13 -07:00
Yury Semikhatsky
990224bde4
Revert "feat(webkit): bump to 1617 (#12738)" (#12760)
This reverts commit 77824ee19e.
2022-03-14 17:08:32 -07:00
Yury Semikhatsky
77824ee19e
feat(webkit): bump to 1617 (#12738) 2022-03-14 15:11:21 -07: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
Yury Semikhatsky
19de9cacc3
docs: delete verification guide (#12698) 2022-03-12 09:32:54 -08:00
Max Schmitt
adcd32fc6e
fix(expect): toHaveCSS with custom CSS properties (#12709) 2022-03-12 09:32:40 -08:00
github-actions[bot]
ffc8031bad
feat(chromium): roll to r980066 (#12705)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-12 09:07:57 +01:00
Andrey Lushnikov
ef4b34fb7a
feat(toHaveScreenshot): enhance messaging in case of failures (#12677)
This patch:
- adds call logs to track screenshot timeouts, e.g. due to
  waiting for web fonts
- makes sure all snapshot expectations have `.png` extension
- throws a polite error when given a buffer or a string instead of a
  page or a locator
- removes stray NL between error description and call log
- makes sure `apiName` is always correct (and adds a test for it)
2022-03-11 22:40:28 -08:00
Andrey Lushnikov
e83549e8a0
fix: support all commong screenshot options in toHaveScreenshot (#12670)
This patch adds support for all common options in
`expect.toHaveScreenshot`.
2022-03-10 18:36:20 -08:00
Andrey Lushnikov
65b9cba143
chore: follow-up to animations default option (#12669)
This is a follow-up to 42765804bc
that was landed without bots.

I ran the bots manually on Linux & Mac.
2022-03-10 17:26:50 -08:00
Andrey Lushnikov
689d8196e0
chore: follow-up to fix docs (#12668)
This is a follow-up to 49e66c7f08 that was landed without bots.

I ran bots manually on Mac & Linux.
2022-03-10 17:19:44 -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
Yury Semikhatsky
cf643ff04c
docs: remove unsupported permission "push" from docs (#12654) 2022-03-10 14:00:25 -08:00
Dmitry Gozman
a388bb2302
feat(screenshot): size:'css'|'device' option (#12634)
With this experimental option, screenshot dimensions are in CSS pixels,
not physical device pixels, effectively ignoring the device scale factor.
2022-03-10 13:07:10 -08:00
Yury Semikhatsky
d49843edaa
fix(firefox): add missing dependency on Ubuntu 18.04 (#12625) 2022-03-09 11:21:15 -08:00
Dmitry Gozman
682eeb4ae0
reland(hooks): separate test timeout from beforeAll/afterAll timeouts (#12609)
This makes it possible to have longer `beforeAll`/`afterAll` and not
affect first/last test timeout.
2022-03-08 19:05:23 -08:00
Dmitry Gozman
62a032baa0
chore: remove env.PLAYWRIGHT_NO_LAYOUT_SHIFT_CHECK (#12605) 2022-03-08 16:42:39 -08:00
Andrey Lushnikov
4bccf2f6aa
chore: cut v1.20 branch (#12593) 2022-03-08 14:01:20 -08:00
github-actions[bot]
04e03728b8
feat(chromium): roll to r978106 (#12585)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2022-03-08 21:05:56 +01:00
Andrey Lushnikov
497b51ad8c
fix(toHaveScreenshot): fix initial screenshot time (#12576)
Instead of being taken immediately, first screenshot was actually
taken after 1 second.
2022-03-08 09:30:14 -08:00
github-actions[bot]
18e6aa3f15
feat(firefox): roll to r1319 (#12587)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-08 09:19:00 -08:00
Dmitry Gozman
d836ed41d3
feat(remote): send 'x-playwright-browser' header (#12556) 2022-03-07 10:30:53 -08:00
Siddharth Singha Roy
a2b3d4f570
feat(cli) : allow passing PlaywrightServer.startDefault parameters via cli (#12530) 2022-03-07 09:15:46 -08:00