microsoft / microsoft/playwright
[Feature]: Declare a lock for the enclosing suite with `test.describe.configure({ lock })`
- Dominant language
- TypeScript
- Stars
- 96.3k
- Forks
- 6.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 180
Description
### 🚀 Feature Request
Locks (1.63) can be declared in the details of `test()` and of a titled `test.describe()`. There is no way to declare one imperatively for the suite that is currently loading.
`test.describe.configure()` already configures the enclosing suite at collection time with `mode`, `retries` and `timeout`. Accepting `lock` there would cover this with no new API surface.
It composes with a describe-scoped `test.use`, so the lock covers only that group. This is not a request for shared or exclusive modes (#42594) or typed names (#42593).
### Example
```ts
test.describe.configure({ lock: 'stripe' });
```
### Motivation
Our tests select a seed with `test.use({ seed })`. Some seeds attach a shared live third-party account, and those tests must not run concurrently. The seed is the single fact; the lock follows from it. We wrap `test.use` so that a seed needing the shared account also takes the lock. Today the only way to do that is to reach into `currentlyLoadingFileSuite()._locks`.
Contributor guide
Research direction
Start at test.describe.configure(), which already handles mode, retries, and timeout, and compare its collection-time path with lock handling in test() and titled test.describe(). Add coverage for test.describe.configure({ lock: 'stripe' }) so the enclosing suite receives the lock and the lock remains scoped to the configured group.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100