[Docs]: incorrect defaults and broken code samples in several guides
Page(s)
Description
Several guides show incorrect defaults or broken samples:
- 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.
- dialogs.md, Python async sample: misplaced parenthesis —
page.get_by_role("button".click()) should be page.get_by_role("button").click().
- 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).
- 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)).
- input.md, C# time input sample: invalid value
"13-15"; the correct time format is "13:15".
- service-workers (JS/Python): the text says "set
serviceWorkers to 'block'" but the sample config uses 'allow'.
- test-parallel: says worker index "starts with 1", but
workerHost.ts initializes lastWorkerIndex = 0 and assigns workerIndex = lastWorkerIndex++ — worker index starts with 0.
- 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).
- 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.
[Docs]: incorrect defaults and broken code samples in several guides
Page(s)
%%-browser-option-timeout%%)Description
Several guides show incorrect defaults or broken samples:
timeout"Defaults to30000(30 seconds)". The actual default is180000(3 minutes) — seeDEFAULT_PLAYWRIGHT_LAUNCH_TIMEOUTinpackages/isomorphic/time.ts.page.get_by_role("button".click())should bepage.get_by_role("button").click().page.on('dialog', lambda: handle_dialog)registers a lambda that returns the handler instead of calling it; should bepage.on('dialog', handle_dialog).List.add(arg.myArray.add(arg.newElement)); should beArray.push(arg.myArray.push(arg.newElement))."13-15"; the correct time format is"13:15".serviceWorkersto'block'" but the sample config uses'allow'.workerHost.tsinitializeslastWorkerIndex = 0and assignsworkerIndex = lastWorkerIndex++— worker index starts with 0.report-<project>-<hash>-<shard_number>.zip; the actual default isreport-<hash>-<shard_number>.zipwith no project segment (see_defaultReportNameinpackages/playwright/src/reporters/blob.ts).testMatch: default shown as regex.*(test|spec).(js|ts|mjs); the actual default glob is**/*.@(spec|test).?(c|m)[jt]s?(x)(seepackages/playwright/src/common/config.ts).I'd like to work on this myself.