Commit Graph

712 Commits

Author SHA1 Message Date
Pavel Feldman
e31b96cc26
feat(tracing): make context.request appear in the trace (#9555) 2021-10-15 15:22:49 -07:00
Joel Einbinder
4c9d7d5ccc
chore(webpack): fix watch for webpack 5 (#9516) 2021-10-14 15:16:15 -04:00
Andrey Lushnikov
cd92451b9f
fix: protocol generation in monorepo (#9513) 2021-10-14 11:14:50 -07:00
Joel Einbinder
c8f875a193
chore: move test runner types into the playwright test package (#9472)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2021-10-14 11:55:08 +02:00
Pavel Feldman
bb77912aee
chore: don't include babel compiled files in webpack bundles (#9491) 2021-10-13 19:27:50 -07:00
Max Schmitt
1a69b26db1
Revert "fix(build): don't compile our web files twice with babel (#9470)" (#9488)
This reverts commit 4d7b6b4b50.
2021-10-14 01:02:31 +02:00
Joel Einbinder
4d7b6b4b50
fix(build): don't compile our web files twice with babel (#9470) 2021-10-13 13:41:38 -07:00
Joel Einbinder
2a0a44bc09
chore: move diff_match_patch into the test package (#9475) 2021-10-13 13:38:26 -07:00
Joel Einbinder
74bb75ce03
chore: dont throw errors about deviceDescriptors.js on first watch (#9469) 2021-10-13 13:35:50 -07:00
Max Schmitt
617380ffee
chore: fix bots after adjusting package descriptions (#9454)
follow-up for: bcfd47343c
2021-10-13 00:07:21 +02:00
Pavel Feldman
c0945d9d00
chore(trace): make trace viewer a pwa (#9438) 2021-10-12 14:42:50 -07:00
Max Schmitt
ded1e718b5
types(test-runner): fix access worker fixtures in test.skip (#9447) 2021-10-12 17:44:00 +02:00
Pavel Feldman
9dfc0a3394
chore: make sw global in trace viewer (#9431) 2021-10-11 20:52:28 -07:00
Max Schmitt
9dd6bb8c6a Revert "feat(test-runner): allow parametrized tests that don't extend base (#9301)"
This reverts commit f63af830de.
2021-10-11 17:32:31 +02:00
Max Schmitt
f884103b62 devops: do not publish create-playwright pkg 2021-10-11 17:24:05 +02:00
Max Schmitt
4ae3a07a75 devops: allow dirty tree when publishing ToT release 2021-10-11 17:13:21 +02:00
Joel Einbinder
c89d5a50dd
chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
Max Schmitt
49a53e23df
chore: add iPhone 13 device family (#9392) 2021-10-08 22:43:23 +02:00
Michael Rienstra
09250fd265
chore: bump 'expect' dev dep from v26 to v27 (#8718)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2021-10-08 17:01:31 +02:00
Pavel Feldman
bc71d20d0f
feat(request): add global request fixture (#9332) 2021-10-06 10:09:27 -07:00
Pavel Feldman
f63af830de
feat(test-runner): allow parametrized tests that don't extend base (#9301) 2021-10-04 17:16:33 -07:00
Sidharth Vinod
ec5e7495df
types(test-runner): Add github to built in reporters (#9283) 2021-10-04 11:31:26 +02:00
Dmitry Gozman
edf07949be
test: use separate Playwright instance to automate inspector (#9270)
This will prevent inspector from picking up test actions.
2021-10-01 17:06:13 -07:00
Yury Semikhatsky
235eaca34a
fix(fetch): use data, form and multipart for different post data (#9248) 2021-10-01 12:11:33 -07:00
Nick Partridge
b126a5685b
feat: add path option to toMatchSnapshot (#9156) 2021-10-01 09:15:44 -07:00
Pavel Feldman
c4c6efe7c7
chore: dedupe return types in the dotnet api generator (#9181) 2021-09-27 13:25:07 -07:00
Dmitry Gozman
d22dd4a4e7
feat(test runner): improve fixture typings for function fixtures (#9138)
When fixture value `R` is a function, TypeScript sometimes confuses
function `R` and function `async ({}, use) => {}`. This leads to
`any` types in the latter because it could be either of the functions
as TS thinks.

The solution is to only accept the second syntax, assuming that noone
passes fixture value that is a function as is:

```js
// This will stop working.
test.extend<{ foo: (x: number) => number }>({
  foo: x => 2 * x,
});

// This will get inferred types and autocomplete.
test.extend<{ foo: (x: number) => number }>({
  foo: async ({}, use) => {
    await use(x => 2 * x);
  },
});
```
2021-09-24 19:59:30 -07:00
Max Schmitt
3632231cc1 chore: fix utils/roll_browser.js after #9078 2021-09-24 17:09:54 +02:00
Pavel Feldman
0908dc98c8
chore: migrate expect(locator).toMatchText to protocol (#9117) 2021-09-23 16:46:46 -07:00
Max Schmitt
89aace688f
fix: make Serializable type any (#9059) 2021-09-23 11:06:34 -07:00
Dmitry Gozman
2afe76d86d
feat(launch): connect to process.env.SELENIUM_REMOTE_URL instead of local launch (#9056) 2021-09-22 21:13:32 -07:00
Dmitry Gozman
e6f5404621
test: unflake "should timeout in socket while connecting" (#9093) 2021-09-22 17:08:49 -07:00
Yury Semikhatsky
79eb7744bc
feat(fetch): support options in playwright._newRequest (#9061) 2021-09-22 12:44:22 -07:00
Max Schmitt
5b93df0bab
chore(docker): upgrade to NPM 7 (#8915) 2021-09-22 16:38:50 +02:00
Dmitry Gozman
cb7285a8c0
docs(test): separate TestOptions from Fixtures (#9000) 2021-09-17 17:13:47 -07:00
Pavel Feldman
63ff405e6e
fix(inspector): stop on all snapshottable actions (#8990) 2021-09-17 15:24:15 -07:00
Max Schmitt
abc989eb3e
chore: use Node.js 14 (LTS) for driver (#8965) 2021-09-16 15:14:11 +02:00
Andrey Lushnikov
4f762ba90a
feat: introduce experimental general-purpose grid (#8941)
This patch adds a general-purpose grid framework to parallelize
Playwright across multiple agents.

This patch adds two CLI commands to manage grid:

- `npx playwright experimental-grid-server` - to launch grid
- `npx playwrigth experimental-grid-agent` - to launch agent in a host
  environment.

Grid server accepts an `--agent-factory` argument. A simple
`factory.js` might look like this:

```js
const child_process = require('child_process');

module.exports = {
  name: 'My Simple Factory',
  capacity: Infinity, // How many workers launch per agent
  timeout: 10_000, // 10 seconds timeout to create agent
  launch: ({agentId, gridURL, playwrightVersion}) => child_process.spawn(`npx`, [
    'playwright'
    'experimental-grid-agent',
    '--grid-url', gridURL,
    '--agent-id', agentId,
  ], {
    cwd: __dirname,
    shell: true,
    stdio: 'inherit',
  }),
};
```

With this `factory.js`, grid server could be launched like this:

```bash
npx playwright experimental-grid-server --factory=./factory.js
```

Once launched, it could be used with Playwright Test using env variable:

```bash
PW_GRID=http://localhost:3000 npx playwright test
```
2021-09-16 01:20:36 -07:00
Yury Semikhatsky
c58f34fb2e
feat(fetch): introduce global fetch request (#8927) 2021-09-14 18:31:35 -07:00
Yury Semikhatsky
5141407c6b
fix(fetch): prefix request with underscore (#8922) 2021-09-14 12:56:09 -07:00
Pavel Feldman
16baaa317d
chore: remove stale html experiments (#8905) 2021-09-13 20:34:46 -07:00
Dmitry Gozman
6722d95a7a
docs: fix markdown parser swallowing lines after code snippets (#8904) 2021-09-13 18:48:16 -07:00
Dmitry Gozman
d9d2d809a2
fix(test): make use in config accept option values only (#8828)
Also include default options in FullConfig/FullProject.
Also make examples compile and add a test.
2021-09-13 17:50:31 -07:00
Yury Semikhatsky
b79be5d98d
feat(fetch): introduce failOnStatusCode (#8896) 2021-09-13 15:38:27 -07:00
Yury Semikhatsky
f8c0f0d637
feat(fetch): support query params (#8893) 2021-09-13 14:29:44 -07:00
Pavel Feldman
7bbb63d143
feat(test): start authoring raw reporter (#8790) 2021-09-09 14:17:18 -07:00
Dmitry Gozman
eca82eee4a
fix(video): reduce buffering in ffmpeg, avoid overbooking cpu (#8786)
This is an attempt to improve video performance when encoding
does not keep up with frames. This situation can be reproduced
by running multiple encoders at the same time.

Added `utils/video_stress.js` to manually reproduce this issue.

Observing ffmpeg logs, it does not do any encoding initially and
instead does "input analysis / probing" that detects fps and other
parameters. By the time it starts encoding (launches vpx and creates
the video file), we already have many frames in the buffer.
Reducing probing helps:
`-avioflags direct -fpsprobesize 0 -probesize 32 -analyzeduration 0`

Another issue observed is questionable default `-threads` value.
We compile without threads support, so logs say "using emulated threads".
For some reason, setting explicit `-threads 1` (or any other value)
makes it better when cpu is loaded.
2021-09-09 12:41:06 -07:00
Joel Einbinder
e914f6bbc7
feat(network): remove Headers class and add headersArray method (#8749) 2021-09-07 10:27:53 -07:00
Yury Semikhatsky
152f6c6f1c
fix: support connectOverCDP over https (#8703) 2021-09-03 17:52:22 -07:00
Dmitry Gozman
962a33993f
fix(types): leave a single js-flavor=ts snippet in JSDoc (#8669) 2021-09-02 16:18:22 -07:00