Commit Graph

6693 Commits

Author SHA1 Message Date
Andrey Lushnikov
237b4d5821
devops: download new MacOS 12 WebKit builds (#11066)
Drive-by: simplify management of executable paths since they are
the same for each platform.

References #11031
2021-12-29 20:40:45 -08:00
Andrey Lushnikov
056d310e20
feat(ffmpeg): roll ffmpeg to 1007 (#11081)
This build:
- Includes a native build for Mac Arm64
- Changes executable name for the linux arm64 build
2021-12-29 20:10:29 -08:00
Andrey Lushnikov
c27a27d561
devops: move docker tests to internal (#11137)
We'll re-use M1 hardware to run Ubuntu arm64 smoke tests.
2021-12-29 19:14:15 -08:00
Andrey Lushnikov
b6c2b32b53
test: introduce #smoke tests (#11135)
This patch introduces 109 "#smoke" tests - a subset of tests that makes
sure that basic Playwright functionality works. This set is loosely
defined; feel free to add/remove tests to the set. The only goal is to
keep this set minimal & fast to run.

I tried to pick tests so that various parts of Playwright functionality
are exercised.
2021-12-29 18:51:28 -08:00
github-actions[bot]
d43f78f384
feat(firefox): roll to r1312 (#11124)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
2021-12-29 17:47:32 -08:00
github-actions[bot]
450c8086b9
feat(firefox-beta): roll to r1312 (#11125)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-29 16:54:58 -08:00
Andrey Lushnikov
fba29aa319
browser(firefox): fix HTTP->HTTPS fallback for refused connection (#11123)
In this case, there's no protocol version that we can extract for
nsIHttpChannel.

The code that does the redirect is here: 7f3d9fce41/docshell/base/nsDocShell.cpp (L6079-L6095)

To trigger this codepath, we'd need to run test inside a special
docker container that has https server running on the 443 port. We lack
infrastructure for this kind of tests (but it'll be cool to have it).

References #11118
2021-12-28 12:23:53 -08:00
Ross Wollman
dadb5cbc30
fix(html reporter): fix too much strikethrough in diffs (#11115)
Textual snapshot diffs were previously broken in the HTML Report. The strikethrough'd text extended beyond the intended region.

HTML Report Before: 
<img width="693" alt="Screen Shot 2021-12-27 at 4 43 35 PM" src="https://user-images.githubusercontent.com/11915034/147518750-a60f9002-6eed-48a1-a412-20fabd076fa6.png">

HTML Report After:
<img width="206" alt="Screen Shot 2021-12-27 at 4 48 37 PM" src="https://user-images.githubusercontent.com/11915034/147518762-19a4c8f9-ccc3-4a3c-a962-5a42edc6fc5d.png">

This now matches what's expected and shown in the terminal (which has always been correct):

<img width="1384" alt="Screen Shot 2021-12-27 at 4 36 29 PM" src="https://user-images.githubusercontent.com/11915034/147518799-f538259e-5a45-4d6f-916c-a12ccb620c5b.png">

NB: This MR is a workaround, but not a root cause fix. It works, but I never fully got to the root cause so a bug upstream may be required. It's unclear whether it's (1) in [`colors`](https://www.npmjs.com/package/colors), (2) in [`ansi-to-html`](https://www.npmjs.com/package/ansi-to-html), or (3) Playwright's use of the two. Since the terminal output is correct, I suspect it is in `ansi-to-html`. For example:

```js
const colors = require("colors");
const Convert = require('ansi-to-html');
const convert = new Convert();

// original (strike incorrectly wraps everything in the HTML)
console.log(convert.toHtml(colors.strikethrough("crossed out") + ' ' + colors.red("red")))
// prints: <strike>crossed out <span style="color:#A00">red<span style="color:#FFF"></span></span></strike>

// workaround
console.log(convert.toHtml(colors.reset(colors.strikethrough("crossed out")) + ' ' + colors.red("red")))
// prints: <strike>crossed out</strike> <span style="color:#A00">red<span style="color:#FFF"></span></span>
```

Fixes #11116
2021-12-28 09:56:34 -08:00
github-actions[bot]
db47b3e392
feat(chromium): roll to r953978 (#11097)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-27 10:13:18 -07:00
github-actions[bot]
74da6240fd
browser(chromium): roll to r954117 (#11107)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-27 10:12:45 -07:00
github-actions[bot]
6358c9813d
browser(chromium): roll to r953978 (#11094)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-24 07:54:48 -07:00
Andrey Lushnikov
fdf750522a
devops: attempt to use ubuntu 18.04 for docker tests (#11093)
Folks on the internet claim 18.04 never runs out of disk space for them
for github actions.
2021-12-23 22:08:44 -08:00
spaniardmaximus
dbac5a5298
docs(selectors.md and locators.md): Fixed typos and added missing words (#11088) 2021-12-23 13:32:28 -08:00
Andrey Lushnikov
db227e1059
devops: attempt to free space before running docker tests (#11084)
Docker runs fail with "No space left on device" error.
This patch follows advice given here: https://github.com/actions/virtual-environments/issues/2840#issuecomment-790492173
2021-12-22 18:13:07 -08:00
Andrey Lushnikov
bc78faba70
devops: bring back channel installation sanity test inside docker (#11083)
This was regressed in https://github.com/microsoft/playwright/pull/11079/files
2021-12-22 16:54:41 -08:00
Andrey Lushnikov
a58dda29c7
devops: disable docker tests workflow in forks (#11082) 2021-12-22 16:52:56 -08:00
Andrey Lushnikov
5fafd943cb chore: fix workflow syntax 2021-12-22 17:26:37 -07:00
Andrey Lushnikov
3bce3444e2
devops: fix tests on Ubuntu 20.04 arm64 (#11080) 2021-12-22 16:19:47 -08:00
Andrey Lushnikov
a21dcf0184
devops: run tests on Ubuntu 20.04 arm64 (#11079)
Since our Docker images for Ubuntu 18.04 and Ubuntu 20.04 are almost
identical, we can avoid testing all permutations.

With this patch, we will run our test only under 2 docker
configurations:
- Ubuntu 20.04 arm64 + root user
- Ubuntu 18.04 x86_64 + pwuser
2021-12-22 16:13:32 -08:00
Andrey Lushnikov
13b1e52d95
devops: support --full flag for ffmpeg compilation (#11076)
- This flag installs dependencies using brew on MacOS
- This flag is a noop on other platforms
2021-12-22 14:59:10 -08:00
Andrey Lushnikov
3dc22245d8
devops: support ffmpeg MacOS arm64 builds (#11075)
Drive-by's:
- support ffmpeg build on MacOS 12
- rename ffmpeg executable for Ubuntu arm64 to `ffmpeg-linux`
2021-12-22 14:43:13 -08:00
Dmitry Gozman
0514ecc1af
test: mark trace-viewer tests as slow, unflake resource order (#11070) 2021-12-22 11:17:43 -08:00
Dmitry Gozman
af153b9826
test: unflake some websocket tests (#11069) 2021-12-22 11:17:34 -08:00
Dmitry Gozman
f933759ad1
chore(test runner): minor improvements (#11067)
- Types for fixture options and more.
- Refined type for deadline runner.
2021-12-22 09:59:58 -08:00
github-actions[bot]
97a43b4bed
feat(chromium): roll to r952821 (#11040)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-22 09:14:23 -08:00
Andrey Lushnikov
d79e7517c4
devops: support WebKit builds on MacOS 12 arm64 (#11051)
References #11031
2021-12-22 08:03:10 -08:00
Andrey Lushnikov
1ee2d01f1c
test: unflake page-click.spec.ts test (#11050) 2021-12-21 17:31:13 -08:00
Andrey Lushnikov
9294947862
devops: support compiling webkit on MacOS 12 (#11049)
References #11031
2021-12-21 13:45:37 -08:00
Yury Semikhatsky
8f9eaf7cba
fix(types): allow specifying element type in locator.evaluate callback (#11048) 2021-12-21 13:17:45 -08:00
Dmitry Gozman
f5304e3bda
fix(fixtures): await fixture teardown when shutting down the worker (#11033) 2021-12-20 16:19:21 -08:00
Yury Semikhatsky
ea1948fabb
test: can open page with mp4 video (#11030) 2021-12-20 12:44:06 -08:00
github-actions[bot]
50a9a8763b
browser(chromium): roll to r952821 (#11021)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-20 08:17:56 -07:00
github-actions[bot]
16ae0af0fd
feat(chromium): roll to r952597 (#11010)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-18 10:59:42 -08:00
Dmitry Gozman
e48231655f
chore: roll stable-test-runner to dec-18-2021 (#11008) 2021-12-18 10:12:35 -08:00
Dmitry Gozman
2d00836f0e
fix(test runner): show the location of afterAll timeout (#11007) 2021-12-18 09:32:41 -08:00
Dmitry Gozman
c9ba49936f
feat(reporters): show retry #x when running a test (#11003) 2021-12-17 21:07:04 -08:00
Pavel Feldman
8f98074fc8
chore: add blink-diff third party library (#10984) 2021-12-17 15:53:37 -08:00
Dmitry Gozman
b6aad54b9f
fix(test runner): test.setTimeout whould not break debugging (#11004)
We ignore test.setTimeout() when timeout is already zero for debugging.
2021-12-17 15:17:48 -08:00
Dmitry Gozman
f5780be41b
fix(list reporter): make sure that duration suffix survives truncation (#11002) 2021-12-17 13:08:02 -08:00
Pavel Feldman
037baf0945
fix(trace-viewer): scroll action into view (#10978) 2021-12-17 12:20:01 -08:00
Yury Semikhatsky
eb9c8a8f06
fix(tracing): check if source exists before adding to zip (#10986) 2021-12-17 11:52:28 -08:00
Dmitry Gozman
0d277fa589
fix(selenium): allow setting additional capabilities (#11000)
Also clarify docs about Selenium v4.
2021-12-17 11:33:24 -08:00
Aarjith Nandakumar
64c3b189c4
docs(intro): fix optionally install browsers url (#11001) 2021-12-17 11:14:05 -08:00
Yury Semikhatsky
1dd8325c9a
docs(java): add API for providing source locations (#10998) 2021-12-17 10:50:47 -08:00
musou1500
7d39d345c2
fix(tracing): trace frame (#10846) 2021-12-17 10:43:19 -08:00
github-actions[bot]
551c8d1309
browser(chromium): roll to r952597 (#10991)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-17 06:20:46 -08:00
Dmitry Gozman
93ad12978c
fix(test runner): disable expect, action and navigation timeouts on debug (#10958)
We disable these timeouts when test timeout is set to zero.
This covers PWDEBUG=1, --debug and manual `test.setTimeout(0)` scenarios.
2021-12-16 18:32:46 -08:00
Dmitry Gozman
dd57843404
fix(inspector): do not show internal calls (#10982)
Also mark setDefault{Navigation,}Timeout as always internal.
2021-12-16 17:17:24 -08:00
Andrey Lushnikov
773ebe04c6
chore: follow-up to handling docker corner cases (#10981) 2021-12-16 15:29:20 -08:00
Mario Nebl
70ed020c87
fix: handle docker edge cases (#10501)
## Before

* When docker wasn't running: crashed with a TypeError 
* When any image without `RepoTags` was present: crashed with TypeError
* Typo in recommended command ("playwight")
* No indication of `PW_TEST_IMAGE` env var in error output

<details>
<summary>Docker not running</summary>

```
Using config at ~redacted/playwright.config.ts
ERROR get /images/json 500 dial unix docker.raw.sock: connect: connection refused

TypeError: Cannot read property 'find' of null
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:43:9)
    at GridServer.createAgent (~redacted/node_modules/playwright-core/lib/grid/gridServer.js:356:5)
    at launchDockerContainer (~redacted/node_modules/@playwright/test/lib/cli.js:259:3)
    at Runner._run (~redacted/node_modules/@playwright/test/lib/runner.js:236:98)

Running 1 test using 1 worker

     test.ts:9:1 › some redacted description
ERROR get /images/json 500 dial unix docker.raw.sock: connect: connection refused

TypeError: Cannot read property 'find' of null
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js
```

</details>

<details>
<summary>Image without repo tags</summary>

```
Using config at ~redacted/playwright.config.ts
TypeError: Cannot read property 'includes' of undefined
    at ~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:55
    at Array.find (<anonymous>)
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:43:9)
    at GridServer.createAgent (~redacted/node_modules/playwright-core/lib/grid/gridServer.js:356:5)
    at launchDockerContainer (~redacted/node_modules/@playwright/test/lib/cli.js:259:3)
    at Runner._run (~redacted/node_modules/@playwright/test/lib/runner.js:236:98)

Running 1 test using 1 worker

     some-test.ts › some description
TypeError: Cannot read property 'includes' of undefined
    at ~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:55
    at Array.find (<anonymous>)
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:67:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.j  ✘  editor-editor-wysiwyg--editor-wysiwyg.vr.ts:9:1 › actual element matches expected element (26ms)


  1) some-test.ts › some description =====

    'Grid agent creation failed'


  1 failed
  some-test.ts › some description ======
```

</details>

## After

* Helpful error message if docker isn't running
* Doesn't crash when local-only images in list
* No typo in `playwright install docker-image` command
* When other playwright images are found they are listed and  `PW_TEST_IMAGE` is mentioned

### After: Docker not running

```
Using config at ~redacted/playwright.config.ts
Error fetching json: Error: connect ECONNREFUSED /var/run/docker.sock
Error:
╔═════════════════════════════════════════╗
║ Failed to list docker images            ║
║ Please ensure docker daemon is running. ║
║                                         ║
║ <3 Playwright Team                      ║
╚═════════════════════════════════════════╝
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:61:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:43:9)
    at GridServer.createAgent (~redacted/node_modules/playwright-core/lib/grid/gridServer.js:356:5)
    at launchDockerContainer (~redacted/node_modules/@playwright/test/lib/cli.js:259:3)
    at Runner._run (~redacted/node_modules/@playwright/test/lib/runner.js:236:98)

Running 1 test using 1 worker

     test.ts:9:1 › description
Error fetching json: Error: connect ECONNREFUSED /var/run/docker.sock
Error:
╔═════════════════════════════════════════╗
║ Failed to list docker images            ║
║ Please ensure docker daemon is running. ║
║                                         ║
║ <3 Playwright Team                      ║
╚═════════════════════════════════════════╝
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:61:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.j  ✘  test.ts:9:1 › description


  1) test.ts:9:1 › description =====

    'Grid agent creation failed'


  1 failed
    test.ts:9:1 › description ======
```

## After: No exact match found 

```
Using config at ~redacted/playwright.config.ts
Error:
╔════════════════════════════════════════════════════════════════════════════╗
║ Failed to find mcr.microsoft.com/playwright:v1.16.3-focal docker image.    ║
║                                                                            ║
║ Available images:                                                          ║
║ - mcr.microsoft.com/playwright:v1.16.3                                     ║
║ - mcr.microsoft.com/playwright:v1.16.2-focal                               ║
║                                                                            ║
║ Use available images via PWTEST_IMAGE_NAME environment variable:           ║
║     PWTEST_IMAGE_NAME=mcr.microsoft.com/playwright:v1.16.3 playwright test ║
║                                                                            ║
║ Alternatively, please pull docker image with the following command:        ║
║                                                                            ║
║     npx playwright install docker-image                                    ║
║                                                                            ║
║ <3 Playwright Team                                                         ║
╚════════════════════════════════════════════════════════════════════════════╝
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:92:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:43:9)
    at GridServer.createAgent (~redacted/node_modules/playwright-core/lib/grid/gridServer.js:356:5)
    at launchDockerContainer (~redacted/node_modules/@playwright/test/lib/cli.js:259:3)
    at Runner._run (~redacted/node_modules/@playwright/test/lib/runner.js:236:98)

Running 1 test using 1 worker

     editor-editor-wysiwyg--editor-wysiwyg.vr.ts:9:1 › actual element matches expected element
Error:
╔════════════════════════════════════════════════════════════════════════════╗
║ Failed to find mcr.microsoft.com/playwright:v1.16.3-focal docker image.    ║
║                                                                            ║
║ Available images:                                                          ║
║ - mcr.microsoft.com/playwright:v1.16.3                                     ║
║ - mcr.microsoft.com/playwright:v1.16.2-focal                               ║
║                                                                            ║
║ Use available images via PWTEST_IMAGE_NAME environment variable:           ║
║     PWTEST_IMAGE_NAME=mcr.microsoft.com/playwright:v1.16.3 playwright test ║
║                                                                            ║
║ Alternatively, please pull docker image with the following command:        ║
║                                                                            ║
║     npx playwright install docker-image                                    ║
║                                                                            ║
║ <3 Playwright Team                                                         ║
╚════════════════════════════════════════════════════════════════════════════╝
    at launchDockerGridAgent (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.js:92:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.launch (~redacted/node_modules/playwright-core/lib/grid/dockerGridFactory.j  ✘  test.ts:9:1 › description


  1) test.ts:9:1 › description =====

    'Grid agent creation failed'


  1 failed
    test.ts:9:1 › description ======
```
2021-12-16 15:11:51 -08:00