Commit Graph

118 Commits

Author SHA1 Message Date
Max Schmitt 47ad692952
chore: mark 1.53.0-next (#35615) 2025-04-15 14:07:49 +02:00
dependabot[bot] 63d6e466f2
chore(deps): bump vite from 6.2.5 to 6.2.6 (#35585)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-11 18:43:18 +02:00
dependabot[bot] ef4421c07b
chore(deps): bump vite from 6.2.4 to 6.2.5 (#35495) 2025-04-04 13:01:53 -07:00
dependabot[bot] b6d3ffa367
chore(deps): bump vite from 6.2.3 to 6.2.4 (#35427)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-02 18:37:09 +02:00
dependabot[bot] 4e0d5742c4
chore(deps): bump vite from 6.1.0 to 6.2.3 (#35345)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-25 15:46:37 +01:00
Dmitry Gozman 218e4e90aa
chore: mark v1.52.0-next (#34974) 2025-02-28 20:38:53 +00:00
Max Schmitt 3584e72223
chore: remove 'as *' imports because of `esModuleInterop: true` (#34854) 2025-02-19 15:32:12 +01:00
Max Schmitt 081031f50e
chore: bump vite to v6 (#34663) 2025-02-18 13:29:16 +01:00
Pavel Feldman bd74fc4964
chore: move utils that are user in server to server/utils (2) (#34736) 2025-02-11 17:19:27 -08:00
Pavel Feldman d5d47f2b6e
chore: organize imports in packages (#34681) 2025-02-07 14:44:00 -08:00
Pavel Feldman 7da3be4a1a
chrome: update eslint 9 (#34666) 2025-02-06 19:48:27 -08:00
dependabot[bot] a689e534ac
chore(deps): bump vite from 5.4.6 to 5.4.14 (#34420)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 14:23:05 +01:00
Adam Gastineau 3c160df06a
chore: mark v1.51.0-next (#34382) 2025-01-17 12:34:59 -08:00
yangsisi d029b03d9f
fix(defineConfig): fix type issue passing custom property in the seco… (#33774)
Signed-off-by: yangsisi <13655750+yangsisi0422@users.noreply.github.com>
2024-12-09 09:20:47 -08:00
Max Schmitt cd41404b05
chore: mark v1.50.0-next (#33572) 2024-11-13 12:51:54 +01:00
Max Schmitt 5a8b49910a
fix(ct): msw interception after msw v2.6.4 release (#33536) 2024-11-11 11:37:29 +01:00
Dmitry Gozman 541ce9f0bb
chore: mark 1.49.0-next (#32873) 2024-09-30 04:24:57 -07:00
Max Schmitt 9fa06be49e
fix(ct): throw error if inline component is getting mounted (#32531)
What was happening?
- When we use CT, we go over the test files, look at the imports using
`tsxTransform.ts` and store them inside a map, these we feed into the
import registry which we build using Vite and have access inside the
browser
- In case of an inline component in the same file as where the test file
is, this is not happening.
- jsx-runtime via babel kicks in, transforms every JSX component in
something like that:

```
{
  __pw_type: 'jsx',
  type: [Function: MyInlineComponent],
  props: { value: 'Max' },
  key: undefined
}
```

this then gets passed into `wrapObject` which maps any function from the
Node.js side into expose function calls so they work inside the browser.
The assumption for `wrapObject` was to do it mostly for callbacks. So it
does for `type` - which is actually our component. We then pass this to
the React render function, which calls back the exposed function but we
never return anything, so it mounts `undefined`.

---

While there have been experiments from certain vendors to get the
'client only' code inside a server side file, we should throw for now to
not confuse users. We might revisit this in the future since Babel / TSX
doesn't support it outside of the box.

Fixes https://github.com/microsoft/playwright/issues/32167
2024-09-10 11:15:20 +02:00
Dmitry Gozman 1402dee9e6
Revert "fix(test runner): align with typescript behaviour for resolving `index.js` and `package.json` through path mapping (#32078)" (#32492)
This reverts commit effb1ae234.

This broke path mapping into directories in ESM mode. References #32480.
2024-09-06 12:08:10 -07:00
Dmitry Gozman 1ba3db6864
chore: implement clear-cache through plugins (#32471)
Also switches it to task runner.
2024-09-05 13:50:16 -07:00
Dmitry Gozman d4c77ce260
chore: make find-related-test-files work through plugins (#32465)
Also switches it to the task runner.
2024-09-05 06:52:11 -07:00
Simon Knott 0f636116e2
chore: mark 1.48.0-next (#32466) 2024-09-05 12:57:16 +02:00
Dmitry Gozman 91012833c6
chore: move 'dev-server' extensibility point to plugin (#32448)
Instead of plumbing it through a custom unspecified config field, make
it a part of plugin interface.

Additionally, use task runner for starting/stopping dev server.
2024-09-05 02:22:27 -07:00
Dmitry Gozman 60631409d6
chore: make dev server only use public config (#32441)
In preparation to make it a part of a plugin.
2024-09-04 01:29:55 -07:00
Simon Knott effb1ae234
fix(test runner): align with typescript behaviour for resolving `index.js` and `package.json` through path mapping (#32078)
Supercedes https://github.com/microsoft/playwright/pull/31915, closes
https://github.com/microsoft/playwright/issues/31811.

When TypeScript resolves a specifier via path mapping, it does not
interpret `package.json`. If path mapping resolves to a directory, it
only looks at the `index.js` file in that directory if it's in CommonJS
mode.

We need to mirror this in our `esmLoader.ts`.

---------

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
2024-08-12 15:05:19 +02:00
Simon Knott 8412d973c0
fix(ui): added test in watched file should be run (#31842)
Closes https://github.com/microsoft/playwright/issues/22211

Currently, when the server notifies the UI about changed files, the UI
determines what files to re-run based on an old test list. By listing
tests before that, we make sure that the test list is up-to-date, and
that added tests are included in the next run.

I've also removed the `listChanged` event as discussed in the team sync.
The event isn't used anywhere and fires in exactly the same cases where
`testFilesChanged` fired, so i've folded them into one another. This allowed simplifying `Watcher`.
2024-07-30 14:17:41 +02:00
Max Schmitt e784e2df01
chore: mark 1.47.0-next (#31879) 2024-07-26 17:50:11 +02:00
Simon Knott f23d02a211
feat(test runner): `--only-changed` option (#31727)
Introduces an `--only-changed [base ref]` option.

`playwright test --only-changed` filters the test run to only run test
suites that have uncommitted changes.
`playwright test --only-changed=foo` runs only tests that were changed
since commit `foo`.

In pull request CI, this can be used to run changed tests first and fail
fast: `--only-changed=$GITHUB_BASE_REF`.
During local development, it can be used to quickly filter down to the
touched set of tests suites.
In some rare usecases, this can also help to cut down on CI usage for
pull requests. Tread with caution though.

File dependencies are taken into account to ensure that if you touched a
utility file, all relevant tests are still executed.

Closes https://github.com/microsoft/playwright/issues/15075
2024-07-23 18:04:17 +02:00
Dmitry Gozman e86c8af599
chore: rename `route` fixture in ct (#31817)
Addresses review feedback.
2024-07-23 07:43:28 -07:00
Simon Knott 1408a45595
chore(ct): remove `suite` dependency by connecting dependency graphs at read time, not write time (#31794)
Broken out of https://github.com/microsoft/playwright/pull/31727 as per
@dgozman's
[request](https://github.com/microsoft/playwright/pull/31727#discussion_r1685793229).

The PR goal is to remove the `suite` argument from the Component
testing's Vite Plugin. `suite` is used to enrich Vite's dependency graph
with information about dependencies between test suites and helper
files. It essentially merges the Vite graph with the
`compilationCache.ts > fileDependencies` graph, and then writes the
result back into `compilationCache.ts > externalDependencies`.

By refactoring this to make the connection on the reading end in
`collectAffectedTestFiles`, we can drop the `suite` parameter.

We didn't yet have a test that depended on the dependency graph being
connected correctly between `fileDependencies` and
`externalDepedencies`, so I've [extended an existing
test](53a539938b)
to capture that.
2024-07-23 10:19:58 +02:00
Max Schmitt 6a9e60d6a1
fix(ct): import ct* flavour types from ct-core and then from pwt (#31642) 2024-07-16 19:32:51 +02:00
Dmitry Gozman 369a1eca48
feat(ct): experimental `route` fixture (#31554)
This fixture accepts the same arguments as `context.route()`, but also
supports request handlers compatible with msw syntax.
2024-07-06 09:35:20 -07:00
Dmitry Gozman 32e25a252b
chore: mark v1.46.0-next (#31324) 2024-06-14 18:22:42 -07:00
Sander e047c478a4
feat(ct): resolve hooksConfig import refs (#31024)
closes https://github.com/microsoft/playwright/issues/30453
2024-05-28 12:29:52 -07:00
Max Schmitt a0938fc7a4
chore: set minimum Node.js requirement to 18 (#30684) 2024-05-08 17:41:27 +01:00
Yury Semikhatsky ad0938c659
chore: mark 1.45.0-next (#30598) 2024-04-29 17:19:05 -07:00
Pavel Feldman e91d372544
fix(ct): allow importing components from node_modules (#30493)
Fixes https://github.com/microsoft/playwright/issues/29854
2024-04-24 12:32:28 -07:00
Sander 1a34c85886
chore(ct): bump vite to v5.2.8 (#30264) 2024-04-08 09:48:05 +02:00
Pavel Feldman 3cea258a9c
chore: expose clear cache to test server (#30268) 2024-04-05 09:31:34 -07:00
Pavel Feldman 5043bd55dc
chore: move dev server to config-based framework extensibility (#30234) 2024-04-05 08:39:51 -07:00
dependabot[bot] 0d5964d3f9
chore(deps): bump vite from 5.0.12 to 5.0.13 (#30227) 2024-04-04 09:25:46 +02:00
Yury Semikhatsky 81bcf2a53b
docs: document FullReporter API (#30186)
* FullConfig split into FullConfig and ConfigInWorker
* FullProject split into FullProject and ProjectInWorker
* Tests can only access {Config, Project}InWorker, while reporters can
only access Full{Config,Project}. This will allow in the future to
change the reporter API independently from the tests.
* Added documentation for the 4 classes.
2024-04-02 16:15:02 -07:00
Pavel Feldman baaf8c8093
chore: hide internal commands (#30170) 2024-03-28 12:19:03 -07:00
Dmitry Gozman b9b06cb010
chore: mark version 1.44.0-next (#30129) 2024-03-26 13:44:10 -07:00
Max Schmitt 65d82797f1
fix(ct): ct ID clash on similar imports (#30108)
This restores the [best
effort](https://github.com/microsoft/playwright/pull/29407/files#diff-8dd3534dc5013c3779edeaded71324b0dd1c1807668f3c6d9e9a1aab1c20ae91L152)
logic if its a relativ path.

Fixes https://github.com/microsoft/playwright/issues/30085

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
Co-authored-by: Pavel Feldman <pavel.feldman@gmail.com>
2024-03-25 23:50:45 +01:00
Dmitry Gozman 7a3c002944
fix(ct): allow importing json files (#30067)
While we are not fully resolving imports during compilation, do not
treat `json` as a non-importable asset.

Fixes #29926.
2024-03-25 07:41:54 -07:00
Pavel Feldman baf2cdf936
fix(ct): stop-gap for shared file import (#29744)
Fixes: https://github.com/microsoft/playwright/issues/29739
2024-02-29 19:13:32 -08:00
Flo Becker 772345c83c
fit(ct): remove unused type import (#29706)
Signed-off-by: Flo Becker <flo@die-beckerei.de>
2024-02-28 13:31:43 +01:00
Pavel Feldman 9d0430fa26
chore: strengthen linting (#29669) 2024-02-26 16:52:28 -08:00
Yury Semikhatsky 01846b954d
chore: mark 1.43.0-next (#29670) 2024-02-26 16:45:25 -08:00