Commit Graph

73 Commits

Author SHA1 Message Date
Max Schmitt
9a3e0967e6
fix(electron): tracing with @playwright/test (#31437) 2024-07-01 19:19:38 +02:00
Max Schmitt
90765a226f
fix(electron): allow launching with spaces in path (#30820)
Fixes https://github.com/microsoft/playwright/issues/30755
2024-05-15 18:20:00 +02:00
Viktor Szépe
150cbcbdf3
chore: fix typos (#30645) 2024-05-08 19:40:03 +01:00
Max Schmitt
43745210a5
fix(trace-viewer): exit if given trace.zip does not exist (#30222) 2024-04-03 18:47:03 +02:00
Pavel Feldman
d48aadac7e
fix: point to the right cli program export (#29715)
Fixes: https://github.com/microsoft/playwright/issues/29711
2024-02-28 14:05:42 -08:00
Max Schmitt
f741f08b3b test: fix itest (follow up to #28932) 2024-01-25 23:55:24 +01:00
Max Schmitt
4c4789c740
chore: validate deps during install (#28932)
Motivation: On Windows we call around 50 times `PrintDeps.exe` which
takes on a very fast machine 500+ms. On Linux we do it around 120 times
(`ldd`) which takes around 150ms.

This change validates the dependencies once on browser install (`npx
playwright install`). In case its failing, it will emit a warning, in
case of a success, it will create a marker file that the binary has been
validated. For future `launch()` calls, we'll read this file and if
exists, we'll not validate again. Otherwise we'll validate again.

Note: If the marker file is older than 30 days, the browser will be
validated again.
2024-01-25 20:55:53 +01:00
Pavel Feldman
71a48c2562
chore: migrate ct to vite5 (#29033)
Closes https://github.com/microsoft/playwright/issues/28607
2024-01-19 11:13:03 -08:00
Yury Semikhatsky
9c845365f7
chore: revert TestProject.botName for this release (#28670)
This is essentially a revert of f88288d71d

Reference https://github.com/microsoft/playwright/issues/27284
2023-12-15 09:48:34 -08:00
Yury Semikhatsky
411abdb752
feat: add fileName option to blob reporter (#28525)
Reference https://github.com/microsoft/playwright/issues/27284
2023-12-06 20:44:06 -08:00
Max Schmitt
958e45316e
test(itest): add CDN TCP connection hangs test (#28301) 2023-11-22 22:39:59 +01:00
Max Schmitt
2f1b0d6ff7
fix(install): hang on server side connection close (#28278) 2023-11-22 20:26:21 +01:00
Max Schmitt
5f366088be
chore: get rid of rimraf package (#27790)
This seems more reliable nowadays as rimraf.

https://github.com/microsoft/playwright/issues/27712

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
2023-10-26 19:41:00 +02:00
Pavel Feldman
7de0ccd36e
chore: support await using for close() and dispose() (#27766)
This change assumes that the user has Node 18 with Symbol.dispose
available.

Fixes https://github.com/microsoft/playwright/issues/27141
2023-10-24 12:25:53 -07:00
Max Schmitt
fe7847b126
fix: require JSX inside PWT with pnpm (#27744)
Fixes https://github.com/microsoft/playwright/issues/27285
2023-10-23 22:48:12 +02:00
Pavel Feldman
393bd36e0a
chore: composed->merge (#27555) 2023-10-11 13:56:27 -07:00
Jim Hays
dcc8dcca73
Fix various typos (Fixes #27396) (#27391)
Fixes https://github.com/microsoft/playwright/issues/27396
2023-10-04 19:56:42 -07:00
Dmitry Gozman
daba77644c
feat: composedExpect (#27432)
Allows to merge multiple expects with custom matchers added by
`expect.extend()`.
2023-10-04 15:01:25 -07:00
Dmitry Gozman
65ce4cd213
feat: expose composedTest() instead of test._extendTest() (#27414) 2023-10-03 13:26:30 -07:00
Dmitry Gozman
9116a81c17
test: add more installation test scenarios (#27240) 2023-10-02 21:10:26 -07:00
Dmitry Gozman
dfc75a1e1a
test: speed up installation tests by not isolating browser unless required (#27370) 2023-10-02 11:26:08 -07:00
Dmitry Gozman
08e71fec5d
test: add installation tests for supposed plugin story (#27331) 2023-09-28 17:18:22 -07:00
Pavel Feldman
a6a0257c88
feat(expect): allow chaining expects (#27248) 2023-09-22 12:12:17 -07:00
Dmitry Gozman
14a3659071
test: speed up installation tests by not downloading from cdn multiple times (#27220) 2023-09-21 12:40:18 -07:00
Dmitry Gozman
186f86905c
chore: make @playwright/test depend on playwright (#26946) 2023-09-08 14:23:35 -07:00
Dmitry Gozman
e6d9b2a818
test: add installation tests for yarn and pnpm (#26937) 2023-09-08 10:06:31 -07:00
Dmitry Gozman
36347e7fea
feat: make playwright package not install browsers automatically (#26672)
Additionally introduce `@playwright/browser-<browser>` packages that
just download the respective browser, but do not export anything.

References #26614.
2023-08-27 07:24:35 -07:00
Yury Semikhatsky
39a6b23309
devops: create blob reports for all "tests 1" (#26694) 2023-08-24 16:06:41 -07:00
Max Schmitt
d08b38013d
test: remove itest folders using rimraf (#26646)
This should fix:

Error: ENOTEMPTY: directory not empty, rmdir
'C:\Users\RUNNER~1\AppData\Local\Temp\pwt\workspaces\playwright-xyz-should-work-playwright-chromium-should-work-installation-tests\browsers\chromium-1076\chrome-win'
2023-08-23 17:59:19 +02:00
Max Schmitt
aede3c5ea9
devops: fix installation tests on low disk space machines (#24473)
Before all the browser downloads were stored in the workspace folder for
the corresponding test. After this change, we clean it up once the test
has finished to save disk space.

~800 MB per test before, now 30MB.
2023-07-27 22:43:20 +02:00
Max Schmitt
ad467446bb
devops: fix Selenium tests (#24472)
The issue was that it got unzipped under "chromedriver/chromedriver" and
not just under "chromedriver"
2023-07-27 22:25:57 +02:00
Andrey Lushnikov
4d38d84612
test: fix chromedriver download URL (#24464) 2023-07-27 05:53:45 -07:00
Marcin Strzyz
d5e7b4f16f
chore: update rimraf package to version 4 to eliminate "promisify" (#24190)
Migrate to version 4 which returns a promise rather than leverages a
callback. -> https://www.npmjs.com/package/rimraf?activeTab=readme

- contains its own types, eliminate "@types/rimraf"
- Parameter `maxBusyTries` changed to `maxRetries`
2023-07-18 19:58:07 +02:00
Max Schmitt
9e636687ea
chore: add more logging for browser install process (#23675) 2023-06-14 15:33:06 +02:00
Dmitry Gozman
b518d1f6da
chore: update error message when using wrong cli (#23512)
Now recommends uninstalling other packages. Fixes #23314.

Example messages:

```
Please install @playwright/test package before running "npx playwright show-report"
  npm uninstall playwright playwright-firefox
  npm install -D @playwright/test
```

```
Please install @playwright/test package before running "yarn playwright show-report"
  yarn remove playwright playwright-chromium playwright-firefox playwright-webkit
  yarn add -D @playwright/test
```

```
Please install @playwright/test package before running "pnpm exec playwright show-report"
  pnpm remove playwright
  pnpm add -D @playwright/test
```
2023-06-05 09:51:08 -07:00
Max Schmitt
75971af55b
feat(cli): introduce npx playwright uninstall (#23128)
Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2023-06-05 18:50:21 +02:00
Max Schmitt
3cd21cb6d4
chore: ignore SIGINT inside driver process (#23028)
https://github.com/microsoft/playwright-python/issues/1843

Almost reverts https://github.com/microsoft/playwright/pull/11826 since
this is not used by VSCode anymore and was legacy.
2023-05-17 01:44:17 +02:00
Andrey Lushnikov
da87a0af76
test: update selenium server and try to reenable tests (#22391)
This patch updates selenium server to 4.8.3, hoping that it
fixed the issue.

Fixes https://github.com/microsoft/playwright/issues/21733
2023-04-13 14:15:09 -07:00
Andrey Lushnikov
8bb708be70
test: unflake inspector-cli tests (#22347)
This patch:
- changes the `childProcess` fixture to reliably SIGKILL all descendants
  (children and grand-children, regardless of their process group).
This is achieved using the `ps` command to build the process tree, and
then send
  `SIGKILL` to the descendant process groups.
- changes the `runCLI` fixture to **not** auto-close codegen by default;
  the `childProcess` fixture will clean up all processes. This makes
sure that all `runCLI.waitFor()` commands actually wait until the
necessary
  output.
- for a handful of tests that do actually want to auto-close codegen,
  introduce an optional `autoCloseWhen` flag for the `runCLI` fixture
that makes sure to close the codegen once a certain output was reached.
2023-04-12 09:37:24 -07:00
Max Schmitt
054fcd39ba
chore: remove Selenium jar files from repo (#21939) 2023-03-23 22:00:30 +01:00
Andrey Lushnikov
36a1055524
test: selectively disable selenium tests (#21741)
https://github.com/microsoft/playwright/issues/21733
2023-03-17 17:48:45 -07:00
Andrey Lushnikov
86de14965c
test: disable connect-to-selenium.spec.ts:20 (#21734)
https://github.com/microsoft/playwright/issues/21733
2023-03-17 00:13:33 -07:00
Andrey Lushnikov
31460f7ad6
chore: do not build docker image for installation tests (#20871)
This used to be needed to test docker integration and is not needed
any more.
2023-02-13 12:31:38 -08:00
Andrey Lushnikov
0a752f3fd6
chore(docker): remove experimental docker integration (#20676)
This removes everything related to docker integration experiments that
we conducted over the last 6 months.

I'll send a follow-up with an alternative suggestion that was demo'ed on
a team meeting in the end of December.
2023-02-06 10:50:45 -08:00
Dmitry Gozman
821949d580
test: update stale test expectations (#20423) 2023-01-27 21:52:34 -08:00
Pavel Feldman
d1c161ce99
chore: merge the util exports (#20110) 2023-01-13 13:50:38 -08:00
Pavel Feldman
e065d608b6
chore: introduce defineConfig for easier JS typing (#20061)
Fixes https://github.com/microsoft/playwright/issues/19694
2023-01-12 13:12:02 -08:00
Max Schmitt
ddccb59093
chore: fix Java CLI invocation on Windows (#19895)
For reference: https://stackoverflow.com/a/64300409
2023-01-05 10:55:07 -08:00
Andrey Lushnikov
858c2453b3
feat(containers): implement reverse proxy for novnc and server (#18569)
This patch adds a reverse proxy in front of novnc and playwright
server inside the container.

As a result:
- container exposes a single HTTP port to the host
- all Playwright clients can connect using this exposed port, e.g.
  `http://127.0.0.1:5400`
- navigating to the exposed port in the browser lands on a nice HTML
page
  with a link to view container screen
- users can also manually navigate to `http://127.0.0.1:5400/screen` to
  view screen
2022-12-08 17:17:18 -08:00
Andrey Lushnikov
6d491f928d
feat(playwright-test): introduce snapshotPathTemplate configuration (#18568)
This configuration option allows to set a string with template
values for precise control over snapshot path location.

An example of `snapshotPathTemplate` usage:

```ts
// playwright.config.ts
// Notice the `testDir` configuration!
export default {
  testDir: './tests',
  snapshotPathTemplate: './__screenshots__/{platform}/{projectName}/{testFilePath}/{arg}{ext}',
}
```

Currently supported "magic tokens" inside the `snapshotPathTemplate`
are:

- `{testDir}` - project's `testDir`
- `{snapshotDir}` - project's `snapshotDir`
- `{platform}` - `process.platform`
- `{projectName}` - Project's sanitized name
- `{testFileDir}` - Directories in relative path from `testDir` to test
  file path (e.g. `page/` in the example below)
- `{testFileName}` - Test file name (with extension) (e.g.
  `page-click.spec.ts` in the example below)
- `{testFilePath}` - Relative path from `testDir` to test file path
  (e.g. `page/page-click.spec.ts` in the example below)
- `{ext}` - snapshot extension (with dots)
- `{arg}` - joined snapshot name parts, without extension (e.g.
`foo/bar/baz` in the example below)
- `{snapshotSuffix}` - `testInfo.snapshotSuffix` value.

Consider the following file structure:

```
playwright.config.ts
tests/
└── page/
    └── page-click.spec.ts
```

The following `page-click.spec.ts`:

```ts
// page-click.spec.ts
import { test, expect } from '@playwright/test';

test('should work', async ({ page }) => {
  await expect(page).toHaveScreenshot(['foo', 'bar', 'baz.png']);
});
```

Fixes #7792
2022-11-09 15:29:07 -08:00