You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
defaultTimeout is a reserved argument name for JavaScript extension keywords #5321
Describe the change #5318 lets JavaScript extension functions request defaultTimeout, the library timeout in milliseconds. The keyword that Browser generates for the function fills it in at each call with the current library timeout, so a function can give a context it created itself the library timeout with context.setDefaultTimeout(defaultTimeout).
This makes defaultTimeout a reserved argument name, like page, context, browser, logger, playwright and adoptContext.
Release notes
This is a behaviour change for JavaScript extensions. If an exported function has a parameter named defaultTimeout:
defaultTimeout is no longer an argument of the generated keyword. Calling the keyword with defaultTimeout=... fails with an unexpected keyword argument error.
The function always receives the library timeout in milliseconds, and a JavaScript default value such as defaultTimeout = 5000 is not used.
Rename the parameter to keep it as a keyword argument.
Someone could say that this could be backwards incompatible change, but the risk is low and this is how we grown the reserved names in the past, so marking this as feature only.
#5354 extends this to call_js_keyword, the way a Python library or plugin calls a JavaScript extension function by name. Add this to the release notes:
call_js_keyword now fills in defaultTimeout with the library timeout in milliseconds when the caller leaves it out. Before, the function got undefined (or its JavaScript default value).
A defaultTimeout the caller passes still wins, so a library that keeps a timeout of its own, such as one that adopts a context it created, can pass its own value. It is the only injected argument a caller can override; page, context, browser, logger, playwright and adoptContext are always filled in by the library.
The keyword that Browser generates for a function is unchanged: defaultTimeout is not one of its arguments, and the function always gets the library timeout, which a test changes with Set Browser Timeout.
The first argument of Browser.call_js_keyword, keyword_name, is now positional-only, so a JavaScript function can have an argument named keyword_name. Calling call_js_keyword(keyword_name="...") by name now fails.
Activity
aaltat commentedon Oct 11, 2026
Someone could say that this could be backwards incompatible change, but the risk is low and this is how we grown the reserved names in the past, so marking this as feature only.
aaltat commentedon Oct 11, 2026
#5318 is merged, closing the issue.
aaltat commentedon Oct 17, 2026
#5354 extends this to
call_js_keyword, the way a Python library or plugin calls a JavaScript extension function by name. Add this to the release notes:call_js_keywordnow fills indefaultTimeoutwith the library timeout in milliseconds when the caller leaves it out. Before, the function gotundefined(or its JavaScript default value).defaultTimeoutthe caller passes still wins, so a library that keeps a timeout of its own, such as one that adopts a context it created, can pass its own value. It is the only injected argument a caller can override;page,context,browser,logger,playwrightandadoptContextare always filled in by the library.defaultTimeoutis not one of its arguments, and the function always gets the library timeout, which a test changes withSet Browser Timeout.Browser.call_js_keyword,keyword_name, is now positional-only, so a JavaScript function can have an argument namedkeyword_name. Callingcall_js_keyword(keyword_name="...")by name now fails.