Skip to content

Commit d8f7044

Browse files
authored
Merge branch 'main' into dependabot/pip/auditwheel-6.3.0
2 parents 9102ad7 + 2ca8764 commit d8f7044

40 files changed

+1112
-162
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jobs:
169169
- name: Get conda
170170
uses: conda-incubator/setup-miniconda@v3
171171
with:
172-
python-version: 3.12
172+
python-version: 3.9
173173
channels: conda-forge
174174
miniconda-version: latest
175175
- name: Prepare

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Get conda
3232
uses: conda-incubator/setup-miniconda@v3
3333
with:
34-
python-version: 3.12
34+
python-version: 3.9
3535
channels: conda-forge
3636
miniconda-version: latest
3737
- name: Prepare

.github/workflows/test_docker.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,16 @@ on:
1919
jobs:
2020
build:
2121
timeout-minutes: 120
22-
runs-on: ubuntu-24.04
22+
runs-on: ${{ matrix.runs-on }}
2323
strategy:
2424
fail-fast: false
2525
matrix:
2626
docker-image-variant:
2727
- jammy
2828
- noble
29+
runs-on:
30+
- ubuntu-24.04
31+
- ubuntu-24.04-arm
2932
steps:
3033
- uses: actions/checkout@v4
3134
- name: Set up Python
@@ -39,10 +42,12 @@ jobs:
3942
pip install -r requirements.txt
4043
pip install -e .
4144
- name: Build Docker image
42-
run: bash utils/docker/build.sh --amd64 ${{ matrix.docker-image-variant }} playwright-python:localbuild-${{ matrix.docker-image-variant }}
45+
run: |
46+
ARCH="${{ matrix.runs-on == 'ubuntu-24.04-arm' && 'arm64' || 'amd64' }}"
47+
bash utils/docker/build.sh --$ARCH ${{ matrix.docker-image-variant }} playwright-python:localbuild-${{ matrix.docker-image-variant }}
4348
- name: Test
4449
run: |
45-
CONTAINER_ID="$(docker run --rm -v $(pwd):/root/playwright --name playwright-docker-test --workdir /root/playwright/ -d -t playwright-python:localbuild-${{ matrix.docker-image-variant }} /bin/bash)"
50+
CONTAINER_ID="$(docker run --rm -e CI -v $(pwd):/root/playwright --name playwright-docker-test --workdir /root/playwright/ -d -t playwright-python:localbuild-${{ matrix.docker-image-variant }} /bin/bash)"
4651
# Fix permissions for Git inside the container
4752
docker exec "${CONTAINER_ID}" chown -R root:root /root/playwright
4853
docker exec "${CONTAINER_ID}" pip install -r local-requirements.txt

.github/workflows/trigger_internal_tests.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Playwright is a Python library to automate [Chromium](https://www.chromium.org/H
44

55
| | Linux | macOS | Windows |
66
| :--- | :---: | :---: | :---: |
7-
| Chromium <!-- GEN:chromium-version -->134.0.6998.35<!-- GEN:stop --> ||||
7+
| Chromium <!-- GEN:chromium-version -->136.0.7103.25<!-- GEN:stop --> ||||
88
| WebKit <!-- GEN:webkit-version -->18.4<!-- GEN:stop --> ||||
9-
| Firefox <!-- GEN:firefox-version -->135.0<!-- GEN:stop --> ||||
9+
| Firefox <!-- GEN:firefox-version -->137.0<!-- GEN:stop --> ||||
1010

1111
## Documentation
1212

local-requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
autobahn==23.1.2
22
black==25.1.0
33
build==1.2.2.post1
4-
flake8==7.1.2
4+
flake8==7.2.0
55
mypy==1.15.0
66
objgraph==3.6.2
7-
Pillow==11.1.0
7+
Pillow==11.2.1
88
pixelmatch==0.3.0
99
pre-commit==3.5.0
1010
pyOpenSSL==25.0.0
1111
pytest==8.3.5
1212
pytest-asyncio==0.26.0
13-
pytest-cov==6.0.0
14-
pytest-repeat==0.9.3
13+
pytest-cov==6.1.1
14+
pytest-repeat==0.9.4
1515
pytest-rerunfailures==15.0
1616
pytest-timeout==2.3.1
1717
pytest-xdist==3.6.1
1818
requests==2.32.3
1919
service_identity==24.2.0
2020
twisted==24.11.0
2121
types-pyOpenSSL==24.1.0.20240722
22-
types-requests==2.32.0.20250306
22+
types-requests==2.32.0.20250328

meta.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ source:
66
path: .
77

88
build:
9-
noarch: python
109
number: 0
1110
script: "{{ PYTHON }} -m pip install . --no-deps -vv"
1211
binary_relocation: False
@@ -32,6 +31,9 @@ requirements:
3231
- pyee>=13,<14
3332

3433
test: # [build_platform == target_platform]
34+
files:
35+
- scripts/example_sync.py
36+
- scripts/example_async.py
3537
requires:
3638
- pip
3739
imports:
@@ -40,6 +42,9 @@ test: # [build_platform == target_platform]
4042
- playwright.async_api
4143
commands:
4244
- playwright --help
45+
- playwright install --with-deps
46+
- python scripts/example_sync.py
47+
- python scripts/example_async.py
4348

4449
about:
4550
home: https://github.com/microsoft/playwright-python

playwright/_impl/_assertions.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,45 @@ async def not_to_have_class(
300300
__tracebackhide__ = True
301301
await self._not.to_have_class(expected, timeout)
302302

303+
async def to_contain_class(
304+
self,
305+
expected: Union[
306+
Sequence[str],
307+
str,
308+
],
309+
timeout: float = None,
310+
) -> None:
311+
__tracebackhide__ = True
312+
if isinstance(expected, collections.abc.Sequence) and not isinstance(
313+
expected, str
314+
):
315+
expected_text = to_expected_text_values(expected)
316+
await self._expect_impl(
317+
"to.contain.class.array",
318+
FrameExpectOptions(expectedText=expected_text, timeout=timeout),
319+
expected,
320+
"Locator expected to contain class names",
321+
)
322+
else:
323+
expected_text = to_expected_text_values([expected])
324+
await self._expect_impl(
325+
"to.contain.class",
326+
FrameExpectOptions(expectedText=expected_text, timeout=timeout),
327+
expected,
328+
"Locator expected to contain class",
329+
)
330+
331+
async def not_to_contain_class(
332+
self,
333+
expected: Union[
334+
Sequence[str],
335+
str,
336+
],
337+
timeout: float = None,
338+
) -> None:
339+
__tracebackhide__ = True
340+
await self._not.to_contain_class(expected, timeout)
341+
303342
async def to_have_count(
304343
self,
305344
count: int,

playwright/_impl/_browser_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _user_data_dir(self, userDataDir: Optional[Union[str, Path]]) -> str:
171171
# Can be dropped once we drop Python 3.9 support (10/2025):
172172
# https://github.com/python/cpython/issues/82852
173173
if sys.platform == "win32" and sys.version_info[:2] < (3, 10):
174-
return pathlib.Path.cwd() / userDataDir
174+
return str(pathlib.Path.cwd() / userDataDir)
175175
return str(Path(userDataDir).resolve())
176176
return str(Path(userDataDir))
177177

playwright/_impl/_connection.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,7 @@ def _send_message_to_server(
362362
"params": self._replace_channels_with_guids(params),
363363
"metadata": metadata,
364364
}
365-
if (
366-
self._tracing_count > 0
367-
and frames
368-
and frames
369-
and object._guid != "localUtils"
370-
):
365+
if self._tracing_count > 0 and frames and object._guid != "localUtils":
371366
self.local_utils.add_stack_to_tracing_no_reply(id, frames)
372367

373368
self._transport.send(message)
@@ -519,7 +514,10 @@ async def wrap_api_call(
519514
if self._api_zone.get():
520515
return await cb()
521516
task = asyncio.current_task(self._loop)
522-
st: List[inspect.FrameInfo] = getattr(task, "__pw_stack__", inspect.stack())
517+
st: List[inspect.FrameInfo] = getattr(
518+
task, "__pw_stack__", None
519+
) or inspect.stack(0)
520+
523521
parsed_st = _extract_stack_trace_information_from_stack(st, is_internal)
524522
self._api_zone.set(parsed_st)
525523
try:
@@ -535,7 +533,9 @@ def wrap_api_call_sync(
535533
if self._api_zone.get():
536534
return cb()
537535
task = asyncio.current_task(self._loop)
538-
st: List[inspect.FrameInfo] = getattr(task, "__pw_stack__", inspect.stack())
536+
st: List[inspect.FrameInfo] = getattr(
537+
task, "__pw_stack__", None
538+
) or inspect.stack(0)
539539
parsed_st = _extract_stack_trace_information_from_stack(st, is_internal)
540540
self._api_zone.set(parsed_st)
541541
try:
@@ -619,4 +619,4 @@ def format_call_log(log: Optional[List[str]]) -> str:
619619
return ""
620620
if len(list(filter(lambda x: x.strip(), log))) == 0:
621621
return ""
622-
return "\nCall log:\n" + "\n - ".join(log) + "\n"
622+
return "\nCall log:\n" + "\n".join(log) + "\n"

0 commit comments

Comments
 (0)