To change navigational timeouts, one way you could accomplish this is to overwrite the default page fixture used in your Playwright tests. For example, you could add the following code to the top of your Playwright test file:
@pytest.fixture
def page(context: BrowserContext) -> Generator[Page, None, None]:
page = context.new_page()
page.set_default_navigation_timeout(6000) # the timeout is in milliseconds
yield page
For expect based timeouts, you can modify the default timeout in your conftest.py file (see documentation here). To set the timeout to 6 seconds, include the following code:
from playwright.sync_api import expect
expect.set_options(timeout=6000) # the timeout is in milliseconds