microsoft / microsoft/playwright

[Feature]: Declare a lock for the enclosing suite with `test.describe.configure({ lock })`

Open Beginner friendly
#42,782 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.