Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature]: Accept duration strings (`30s`, `5m`, `1h`) for `--timeout` and `--global-timeout`

Chiusa
#43,541 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
57/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
cli, testing-qa

Direzione di ricerca

Start by reading the CLI definitions and parsing paths for --timeout and --global-timeout, then inspect the validation work proposed in #43533. Add support for ms, s, m, and h while preserving plain integers as milliseconds; unsupported units should remain usage errors. Done when both flags accept the requested forms and their resulting timeout values are covered by tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🚀 Feature Request

Allow the CLI timeout flags to take a unit suffix, in addition to plain milliseconds:

  • --timeout 30s, --timeout 2m
  • --global-timeout 1h, --global-timeout 90m

Plain integers keep meaning milliseconds, so this is fully backward compatible. Suggested units: ms, s, m, h. Anything else stays a usage error, as proposed in #43533.

The same parser could optionally accept strings for timeout and globalTimeout in the config file, but the CLI is where it matters most.

Example
# today
npx playwright test --timeout 120000 --global-timeout 3600000

# proposed, same meaning
npx playwright test --timeout 2m --global-timeout 1h

CI scripts and package.json scripts become readable at a glance. People no longer have to count zeros to tell 3,600,000 ms from 360,000 ms.

Motivation

People already type units. Today --timeout 30s is silently read as 30 ms, and --timeout 1m as 1 ms, which I reported in #43533. Once that bug is fixed, such input fails with a usage error instead. Supporting the units people naturally reach for is the friendly next step, so the error never comes up for the common case.

Many CLI tools in the JS ecosystem accept this format, and Playwright's own docs describe timeouts in seconds and minutes, so it matches how users already think about these values.

Happy to contribute the implementation on top of the #43533 validation fix if this direction is approved.

Lingua principale
TypeScript
Stelle
98k
Fork
6.6k
Merge medio
17h 15m
PR unite (30g)
321

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/playwright

Tutte le issue di microsoft/playwright

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.