Commit Graph

7325 Commits

Author SHA1 Message Date
Dmitry Gozman
3688e74e3e
fix(list mode): print errors to stderr (#13016)
`--list` mode now prints any errors encountered during test collection,
for example syntax errors, to `stderr`.
2022-03-24 07:33:33 -07:00
Andrey Lushnikov
174225697a
devops: cancel primary_tests workflow jobs for stale PR commits (#13018) 2022-03-23 17:16:32 -07:00
Dmitry Gozman
418dc9ea5d
docs(parallel): tell about fully parallel mode (#13013) 2022-03-23 16:43:46 -07:00
Yury Semikhatsky
7fe763c1fc
chore: align setInputFiles in webkit with other browsers (#13011) 2022-03-23 16:07:47 -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
Ross Wollman
39376cccd8
fix: allow unnamed cookies (#12991)
Fixes #12808.
2022-03-23 15:50:43 -07:00
dependabot[bot]
28b8c8d63a
chore(deps): bump node-forge in /tests-components/ct-react (#12958)
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/digitalbazaar/forge/releases)
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-23 14:08:16 -07:00
dependabot[bot]
3e3de0319c
chore(deps): bump node-forge in /tests-components/ct-vue-cli (#12957)
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/digitalbazaar/forge/releases)
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-23 14:07:37 -07:00
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
Andrey Lushnikov
4d41e51ee5
devops: use goma when compiling chromium (#12998) 2022-03-23 14:04:57 -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
Yury Semikhatsky
463b4b1c0d
browser(firefox): do not send post data > 10Mb to the client (#12969) 2022-03-23 08:58:29 -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
Xiaoxing Ye
04e9d2ec08
test(test-runner): fix reporter-list test cannot be run on win32 vscode (#12951) 2022-03-23 11:48:05 +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
Yury Semikhatsky
8c29803542
browser(webkit): introduce grantFileReadAccess command (#12965) 2022-03-22 15:27:41 -07:00
Andrey Lushnikov
bed0ed12ec
devops: improve chromium toolchain (#12897) 2022-03-22 14:14:20 -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
Max Schmitt
94f7c2dcba
devops: audit prod npm dependencies (#12959) 2022-03-22 20:46:45 +01:00
Brandon Walderman
7db40071a8
fix(selenium): Use ms:edgeOptions with Edge. (#12933) 2022-03-22 12:46:00 -07:00
Max Schmitt
2a7370bad2
fix: upgrade json5 dependency (#12946)
Fixes #12940
2022-03-22 11:33:23 -07:00
Max Schmitt
4aa7677f98
docs(dotnet): fix EvalueHandleAsync typo (#12920) 2022-03-22 16:36:21 +01:00
Max Schmitt
d8ab76bf64
chore: throw when a Promise was passed to toMatchSnapshot (#12906) 2022-03-22 16:36:09 +01: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]
e8fbe97211
browser(chromium): roll to r983172 (#12919)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-21 11:25:29 +01: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
Yury Semikhatsky
96b0a4b993
browser(firefox): fast post body conversion to base64 (#12898) 2022-03-18 18:30:28 -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
Pavel Feldman
4aaa63beaa
test: add a test for #12837 (#12838) 2022-03-18 18:09:59 -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
009185bb89
fix(test runner): do not print fixture location without a separate timeout (#12894)
Otherwise, user randomly sees some "extend" calls that have no real meaning.
2022-03-18 16:09:41 -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
Andrey Lushnikov
2ec3866f7c
devops: update electron build tools (#12891) 2022-03-18 14:48:10 -07:00
Max Schmitt
dd32956ccc
chore: improve handling with missing xserver (#12724) 2022-03-18 22:39:11 +01:00
Andrey Lushnikov
daff643516
Revert "devops: use i686 for webkit on win (#12881)" (#12889)
This reverts commit a10f6f3406.
2022-03-18 13:42:48 -07:00
Max Schmitt
d795f5dd64
chore: print error if install-deps is used != ubuntu (#12877) 2022-03-18 19:13:11 +01:00
Andrey Lushnikov
bb756c5b23
test: mark webkit ubuntu fonts test as fixme (#12885)
References https://github.com/microsoft/playwright/issues/12839
2022-03-18 09:35:41 -07:00
Andrey Lushnikov
a10f6f3406
devops: use i686 for webkit on win (#12881) 2022-03-18 09:09:27 -07:00