Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion playwright/_impl/_assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def to_expected_text_values(
ignoreCase: Optional[bool] = None,
) -> Sequence[ExpectedTextValue]:
out: List[ExpectedTextValue] = []
assert isinstance(items, list)
assert isinstance(items, (list, tuple))
for item in items:
if isinstance(item, str):
o = ExpectedTextValue(
Expand Down
4 changes: 4 additions & 0 deletions tests/async/test_assertions.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ async def test_assertions_locator_to_have_text(page: Page, server: Server) -> No
await expect(page.locator("div")).to_have_text(
["Text 1", re.compile(r"Text \d+a")]
)
# Should work with a tuple
await expect(page.locator("div")).to_have_text(
("Text 1", re.compile(r"Text \d+a"))
)


@pytest.mark.parametrize(
Expand Down
Loading