Skip to content

[Docs]: incorrect defaults and broken code samples in several guides #42543

Description

[Docs]: incorrect defaults and broken code samples in several guides

Page(s)

Description

Several guides show incorrect defaults or broken samples:

  1. Browser launch timeout default is wrong. Docs say timeout "Defaults to 30000 (30 seconds)". The actual default is 180000 (3 minutes) — see DEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUT in packages/isomorphic/time.ts.
  2. dialogs.md, Python async sample: misplaced parenthesis — page.get_by_role("button".click()) should be page.get_by_role("button").click().
  3. dialogs.md, beforeunload Python samples: the handler is passed as a zero-argument lambda — page.on('dialog', lambda: handle_dialog) registers a lambda that returns the handler instead of calling it; should be page.on('dialog', handle_dialog).
  4. handles.md, Java/C# samples: the evaluate callback runs in the page, but uses List.add (arg.myArray.add(arg.newElement)); should be Array.push (arg.myArray.push(arg.newElement)).
  5. input.md, C# time input sample: invalid value "13-15"; the correct time format is "13:15".
  6. service-workers (JS/Python): the text says "set serviceWorkers to 'block'" but the sample config uses 'allow'.
  7. test-parallel: says worker index "starts with 1", but workerHost.ts initializes lastWorkerIndex = 0 and assigns workerIndex = lastWorkerIndex++ — worker index starts with 0.
  8. test-reporters, Blob reporter: documented default file name is report-<project>-<hash>-<shard_number>.zip; the actual default is report-<hash>-<shard_number>.zip with no project segment (see _defaultReportName in packages/playwright/src/reporters/blob.ts).
  9. test-configuration, testMatch: default shown as regex .*(test|spec).(js|ts|mjs); the actual default glob is **/*.@(spec|test).?(c|m)[jt]s?(x) (see packages/playwright/src/common/config.ts).

I'd like to work on this myself.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions