34 Commits

Author SHA1 Message Date
Simon Knott
ae10d56836
docs(fixtures): add rules of thumb for fixture usage (#33472) 2024-11-20 09:06:54 +01:00
Yury Semikhatsky
d8137f228f
docs: update snippets to fix typescript errors (#32363)
Reference: https://github.com/microsoft/playwright/issues/9468
2024-08-28 14:24:01 -07:00
Yury Semikhatsky
acd2a4ddad
docs: global beforeEach/beforeAll hooks (#32348)
Fixes https://github.com/microsoft/playwright/issues/9468
2024-08-27 17:04:53 -07:00
Dmitry Gozman
dc4a8e48eb
docs(fixtures): explain an option array value edge case (#32261)
Closes #32033.
2024-08-22 05:47:19 -07:00
Dmitry Gozman
9227d1c598
docs: explain a bit more about fixture boxing and custom titles (#31877) 2024-07-26 07:43:58 -07:00
Pavel Feldman
122818c62c
feat: allow boxing and titling fixtures, simulate context fixture deps (#31423)
Fixes https://github.com/microsoft/playwright/issues/31411
2024-06-24 21:43:43 -07:00
Joonas Häkkinen
a300a15afe
docs(test-fixtures): fix minor grammar mistake (#31046) 2024-05-28 14:17:34 +02:00
Brian Scramlin
2550ba3396
Update test-fixtures-js.md (#29283) 2024-02-13 11:28:34 -08:00
jaktestowac.pl
297f2af16b
docs: add info about merging fixtures to fixtures page (#28468) 2023-12-05 17:02:55 -08:00
Debbie O'Brien
3773f004db
docs: add intros for all pages (#27480) 2023-10-06 15:08:51 +02:00
Max Schmitt
9980f054bc
docs: align Node.js code snippets with ESLint (#23916) 2023-06-27 11:53:53 +02:00
Debbie O'Brien
759d14b881
docs: add titles for remaining examples (#22939)
Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-05-10 23:30:51 +02:00
Debbie O'Brien
7a8eb15820
docs: add titles to config snippets (#22910)
Docs PR: https://github.com/microsoft/playwright.dev/pull/1039

---------

Co-authored-by: Max Schmitt <max@schmitt.mx>
2023-05-10 18:38:12 +02:00
Max Schmitt
7c76258972
docs: add missing POM classes to fixture guide (#22902) 2023-05-09 23:28:11 +02:00
Max Schmitt
771abe15fb
docs(node): consolidate JS/TS snippets for guides (#21710)
https://github.com/microsoft/playwright/issues/21385
2023-03-16 21:16:18 +01:00
Adi
bdefaa9f9e
docs: added missing generic declaration (#21442) 2023-03-06 22:03:43 +01:00
Debbie O'Brien
f6095f6a5e
docs: fix title cases (#21439) 2023-03-06 20:52:58 +01:00
Pavel Feldman
e065d608b6
chore: introduce defineConfig for easier JS typing (#20061)
Fixes https://github.com/microsoft/playwright/issues/19694
2023-01-12 13:12:02 -08:00
Yevhen Laichenkov
ed1c4b582f
docs: add missed request fixture in the pre-defined list (#20038) 2023-01-11 14:07:57 -08:00
Debbie O'Brien
c1a1090eb3
docs: improve locators in fixtures (#19210) 2022-12-15 10:21:08 +01:00
Max Schmitt
48d7bfc55f
docs: delete old auth + pom guides (#18615) 2022-11-07 15:31:42 -08:00
Pavel Feldman
8810b55504
feat(api): shorted getByLabel, getByPlaceholder (#17816) 2022-10-04 10:29:26 -07:00
Dmitry Gozman
b07690f408
docs: use getBy... in documentation (#17795) 2022-10-03 17:02:46 -07:00
Debbie O'Brien
da1598d45f
docs: Remove tocs (#17133) 2022-09-07 12:30:31 +02:00
Ross Wollman
51fd212906
docs(test-runner): add a note re: fixture naming (#15203) 2022-06-28 14:55:06 -07:00
Pavel Feldman
76abb3a5be
chore: unify tab generation (#14802) 2022-06-10 17:34:31 -07:00
Pavel Feldman
f724fa570f
docs: make ts snippets esm-friendly (#14451) 2022-05-27 12:36:59 -07:00
Dmitry Gozman
c3beb71b07
fix(test runner): do not run automatic fixtures for beforeAll hooks (#14104)
There are a few issues this covers:
- Some fixtures like `page` and `context` are not allowed in `beforeAll`
  hooks, so using them in automatic fixture makes it throw.
- Running automatic fixture solely for `afterAll` is unexpected.
  This currently happens when `afterAll` is run for cleanup after
  fixture timeout/throw.

For built-in playwright fixture, we keep `'all-hooks-included'` auto mode.

Added a doc explaining the execution order.
2022-05-13 11:17:20 +01:00
hirohe
3ab0ecf143
docs: update Worker-scoped fixtures code example (#13951) 2022-05-05 11:27:53 -07:00
Dmitry Gozman
25483452c0
feat(fixtures): per-fixture timeout (#12751)
By default, fixtures share timeout with the test they are instantiated for.
However, for more heavy fixtures, especially worker-scoped ones, it makes
sense to have a separate timeout.

This introduces `{ timeout: number }` option to the list of fixture options
that opts the fixture into a dedicated timeout rather than sharing it
with the test.
2022-03-17 09:36:03 -07:00
Dmitry Gozman
4a52bc9465
docs: add option fixtures section to release notes (#11794) 2022-02-01 14:34:47 -08:00
Dmitry Gozman
19f739dec8
docs: update fixtures doc (#10426)
- Introduction
  - Built-in fixtures
  - Without fixtures
  - With fixtures
- Creating a fixture
- Using a fixture
- Overriding fixtures
- Worker-scoped fixtures
- Automatic fixtures
- Fixtures-options
2021-11-18 21:35:21 -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
Max Schmitt
3c9d5cdc66
docs: hide language specific docs pages (#7860) 2021-07-27 17:22:08 +02:00