Commit Graph

131 Commits

Author SHA1 Message Date
Adam Gastineau 635f2bb0f0
fix(ct): don't modify React core in Node development mode (#37451) 2025-09-18 05:24:21 -07:00
Shai Reznik 81b020652b
fix: do not crash component tests on stale cached files (#37070) 2025-09-16 14:32:18 -07:00
dependabot[bot] 728b8b2ec1
chore(deps): bump vite from 6.3.5 to 6.3.6 (#37369) 2025-09-10 09:00:26 -07:00
Max Schmitt 64983cf0ec
chore: update TypeScript to 5.9 (#37182) 2025-08-26 17:56:22 +02:00
Max Schmitt 40eefce085
chore: mark 1.56.0-next (#37088) 2025-08-19 14:22:44 +02:00
Dmitry Gozman 6971d75024
chore: cleanup api calls in builtin fixtures (#36937) 2025-08-06 12:07:11 +01:00
Adam Gastineau b9adde8fda
feat(ct): update to Svelte 5 (#36918) 2025-08-05 12:40:57 -07:00
Dmitry Gozman 9287ca086d
chore: mark v1.55.0-next (#36623) 2025-07-09 17:52:07 +01:00
Adam Gastineau 4c25573c3b
fix(ct): enhance error messages when no index.html template is provided (#36556) 2025-07-08 06:48:47 -07:00
Adam Gastineau 13dd4fddeb
fix(ct): properly type `_wrapApiCall` references and mark as internal (#36554) 2025-07-07 05:37:17 -07:00
Max Schmitt 777d1e54b6
chore: use different babel import in tsxTransform (#36370) 2025-06-20 10:10:54 +02:00
Max Schmitt 227b1230a0
chore: mark v1.54.0-next (#36200) 2025-06-04 16:31:13 +01:00
dependabot[bot] 8a7047e2a4
chore(deps): bump vite from 6.2.6 to 6.3.4 (#35818)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-01 10:11:22 +02:00
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