Commit Graph

8 Commits

Author SHA1 Message Date
Pavel Feldman
5a79054544
feat(innerloop): allow reusing browsers over the remote connection (#16065) 2022-07-31 14:31:17 -07:00
Dmitry Gozman
82032be368
chore(server): validate/convert protocol both ways (#14811)
Previously, we only validated/converted on the way to the server,
but not from the server.

Validating both ways catches issues earlier, and allows us to
perform automatic conversions, for example only converting
buffers to base64 when sending over wire.
2022-07-01 09:58:07 -07:00
Yury Semikhatsky
aee6ba299a
chore: remove GridClient, run only page tests in service mode (#13566) 2022-04-14 15:30:04 -07:00
Pavel Feldman
40d5e3a3c9
chore: use utils via index export (3) (#13403) 2022-04-07 13:55:44 -07:00
Pavel Feldman
5ae2017a5b
chore: always import type (#13365) 2022-04-06 14:57:14 -07:00
Dmitry Gozman
66b5cf5ae1
feat(remote): make PlaywrightServer work with browserType.connect (#11849)
This changes PlaywrigtServer to serve connections like `ws://localhost:3333/?browser=chromium`:
- launches the browser;
- talks `browserType.connect`-style protocol over websocket;
- compatible with `connectOptions` fixture.

```js
await playwright.chromium.connect({ wsEndpoint: 'ws://localhost:3333/?browser=chrome' });
```
2022-02-10 16:36:23 -08:00
Dmitry Gozman
d9f849fb14
feat(test runner): replace declare/define with "options" (#10293)
1. Fixtures defined in test.extend() can now have `{ option: true }` configuration that makes them overridable in the config. Options support all other properties of fixtures - value/function, scope, auto.
```
const test = base.extend<MyOptions>({
  foo: ['default', { option: true }],
});
```

2. test.declare() and project.define are removed.

3. project.use applies overrides to default option values and nothing else. Any test.extend() and test.use() calls take priority over config options.

Required user changes: if someone used to define fixture options with test.extend(), overriding them in config will stop working. The solution is to add `{ option: true }`.

```
// Old code
export const test = base.extend<{ myOption: number, myFixture: number }>({
  myOption: 123,
  myFixture: ({ myOption }, use) => use(2 * myOption),
});

// New code
export const test = base.extend<{ myOption: number, myFixture: number }>({
  myOption: [123, { option: true }],
  myFixture: ({ myOption }, use) => use(2 * myOption),
});
```
2021-11-18 15:45:52 -08:00
Pavel Feldman
31faa7d9a7
chore: sort out base fixtures (#9809) 2021-10-27 08:28:53 -07:00