How Timeout Values Are Applied
Global Timeout in Config: The
timeout
value inplaywright.config.ts
sets a default timeout for allexpect
assertions if no specific timeout is provided in the test script.Local Timeout in Tests: If a specific timeout is provided in a test script, it overrides the global timeout for that particular step or assertion.
Determining the Actual Timeout
- Global Timeout Only: If you only set the global timeout in the
playwright.config.ts
file, the timeout for eachexpect
assertion will be the global timeout value (e.g., 5000 milliseconds in the example). - Local Timeout Only: If you set a timeout for a specific step in your test script, that value will be used for that particular step (e.g., 10000 milliseconds in the example).
- Both Global and Local Timeout: When both global and local timeouts are set, the local timeout takes precedence for the specific step or assertion. The global timeout will apply to other steps or assertions without a specific timeout.
Comments
Post a Comment