We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.49.0
docker run $(docker build -q .)
FROM mcr.microsoft.com/playwright/python:v1.49.0 RUN pip3 install pytest pytest-playwright RUN mkdir /test && \ # create html file echo '<!doctype html>' >> /test/index.html && \ echo '<html>' >> /test/index.html && \ echo ' <body>' >> /test/index.html && \ echo ' <h1 aria-label="@header - label">@header</h1>' >> /test/index.html && \ echo ' </body>' >> /test/index.html && \ echo '</html>' >> /test/index.html && \ # create python file echo 'from playwright.sync_api import Page, expect' >> /test/test_main.py && \ echo 'def test_main(page: Page):' >> /test/test_main.py && \ echo ' page.goto("file:///test/index.html")' >> /test/test_main.py && \ echo ' print(page.locator("body").aria_snapshot())' >> /test/test_main.py && \ echo ' expect(page.locator("body")).to_match_aria_snapshot(' >> /test/test_main.py && \ echo " '- heading \"@header - label\" [level=1]: @header'" >> /test/test_main.py && \ echo ' )' >> /test/test_main.py CMD pytest /test --browser chromium --tracing retain-on-failure --output /output -rP
Valid yaml should be generated:
- heading "@header - label" [level=1]: "@header"
Invalid yaml is generated:
- heading "@header - label" [level=1]: @header
The problem seems to be elements that have text that starts with "@" and have an aria-label attribute:
aria-label
<!doctype html> <html> <body> <h1 aria-label="@header - label">@header</h1> </body> </html>
pytest output:
============================= test session starts ============================== platform linux -- Python 3.12.3, pytest-8.3.3, pluggy-1.5.0 rootdir: /test plugins: playwright-0.6.2, base-url-2.1.0 collected 1 item test/test_main.py F [100%] =================================== FAILURES =================================== _____________________________ test_main[chromium] ______________________________ page = <Page url='file:///test/index.html'> def test_main(page: Page): page.goto("file:///test/index.html") print(page.locator("body").aria_snapshot()) > expect(page.locator("body")).to_match_aria_snapshot( '- heading "@header - label" [level=1]: @header' ) test/test_main.py:5: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ usr/local/lib/python3.12/dist-packages/playwright/_impl/_locator.py:712: in _expect result = await self._frame._channel.send_return_as_dict( usr/local/lib/python3.12/dist-packages/playwright/_impl/_connection.py:67: in send_return_as_dict return await self._connection.wrap_api_call( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <playwright._impl._connection.Connection object at 0x73211b126060> cb = <function Channel.send_return_as_dict.<locals>.<lambda> at 0x73211b133d80> is_internal = False async def wrap_api_call( self, cb: Callable[[], Any], is_internal: bool = False ) -> Any: if self._api_zone.get(): return await cb() task = asyncio.current_task(self._loop) st: List[inspect.FrameInfo] = getattr(task, "__pw_stack__", inspect.stack()) parsed_st = _extract_stack_trace_information_from_stack(st, is_internal) self._api_zone.set(parsed_st) try: return await cb() except Exception as error: > raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None E playwright._impl._errors.Error: LocatorAssertions.to_match_aria_snapshot: Plain value cannot start with reserved character @ at line 1, column 40: E E - heading "@header - label" [level=1]: @header E ^ usr/local/lib/python3.12/dist-packages/playwright/_impl/_connection.py:528: Error ----------------------------- Captured stdout call ----------------------------- - heading "@header - label" [level=1]: @header ============================== 1 failed in 0.94s ===============================
- Operating System: elementary OS 7.1 (based on Ubuntu 22.04.5 LTS) - CPU: x86_64 - Browser: Chromium - Python Version: 3.12
The text was updated successfully, but these errors were encountered:
Skn0tt
Successfully merging a pull request may close this issue.
Version
1.49.0
Steps to reproduce
docker run $(docker build -q .)
Expected behavior
Valid yaml should be generated:
Actual behavior
Invalid yaml is generated:
Additional context
The problem seems to be elements that have text that starts with "@" and have an
aria-label
attribute:pytest output:
Environment
The text was updated successfully, but these errors were encountered: