Skip to content

test: match the expect timeout call log from Playwright 1.63 - #325

Open
Ben Atkinson (BenA-SA) wants to merge 1 commit into
microsoft:mainfrom
BenA-SA:fix/expect-timeout-call-log-1.63
Open

Ben Atkinson (BenA-SA) wants to merge 1 commit into
microsoft:mainfrom
BenA-SA:fix/expect-timeout-call-log-1.63

Conversation

@BenA-SA

Copy link
Copy Markdown

test_is_able_to_set_expect_timeout_via_conftest fails on every OS and Python version with Playwright 1.63.0, in both tests/test_sync.py and tests/test_asyncio.py. CI installs the latest Playwright (playwright>=1.60), so this will affect any PR that runs now.

What we think changed

Playwright 1.63 adds the locator to the expect call log line. On 1.62.0 the line read:

- Expect "to_be_visible" with timeout 1111ms

On 1.63.0 it reads:

- Expect "to_be_visible" locator("#A") with timeout 1111ms

The test matches *Expect "to_be_visible" with timeout 1111ms*, which no longer fits the new line.

The fix

Allow anything between the action and the timeout: *Expect "to_be_visible"*with timeout 1111ms*. The test still checks what it is there for, that expect.set_options(timeout=1111) in a conftest is applied, and it passes on both formats.

Checked locally on Python 3.12:

  • Playwright 1.63.0: the unchanged tests fail (2 failed), and pass with this change (2 passed).
  • Playwright 1.62.0: the tests pass with this change (2 passed).

Context

This came up on #324 (allowing python-slugify 9), where these two tests are the only failures. The last green PR, #322, ran on Playwright 1.62.0, and #324's run installed 1.63.0. Once this is merged, #324 should go green on a re-run.

Playwright 1.63 adds the locator to the expect call log line, which now reads
Expect "to_be_visible" locator("#A") with timeout 1111ms. Allow anything
between the action and the timeout, so the test checks the configured
timeout on both the old and new formats.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant