playwright/tests/config
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
..
android.config.ts test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
baseTest.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
browserTest.ts test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
checkCoverage.js feat(download): introduce Download.cancel (#7462) 2021-07-06 09:38:50 +02:00
commonFixtures.ts test: do not print output from child processes in skipped tests (#10422) 2021-11-18 14:35:51 -08:00
coverage.js chore: sort out base fixtures (#9809) 2021-10-27 08:28:53 -07:00
coverageFixtures.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
default.config.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
electron.config.ts test: migrate to upstream fixtures (#9835) 2021-10-28 08:31:30 -07:00
platformFixtures.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
proxy.ts chore: roll Electron to 12.2.1 (#9271) 2021-10-01 19:40:47 -07:00
remote-server-impl.js chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
remoteServer.ts test: remove browserOptions (#9829) 2021-10-27 19:00:06 -07:00
serverFixtures.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
testMode.ts chore: sort out base fixtures (#9809) 2021-10-27 08:28:53 -07:00
testModeFixtures.ts feat(test runner): replace declare/define with "options" (#10293) 2021-11-18 15:45:52 -08:00
utils.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00