From 2834058d0d1450e9346717da70cbecf2dbf4a96c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 12 Sep 2026 22:34:37 +0000 Subject: [PATCH 1/4] ci: only run the release workflow on the upstream repository The Release workflow triggers on every push to master. On a fork that means semantic-release rewrites the version in pyproject.toml, commits the change to the default branch, tags it and then tries to publish the result to PyPI under the upstream package name. Gate the job on the repository name so forks keep a clean master. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01PjZRpyoEfSCLjTx5ctzQmJ --- .github/workflows/publish.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8df3ca7f..2119bfad 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,6 +11,10 @@ permissions: jobs: release: + # Releases are cut from the upstream repository only. Without this guard the + # workflow also runs on forks, where semantic-release rewrites the version in + # pyproject.toml, commits to the default branch and attempts a PyPI upload. + if: github.repository == 'appium/python-client' runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 From 8a102be63eb8ccd26da3519e541ed1786d8835aa Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 19 Oct 2026 04:42:21 +0000 Subject: [PATCH 2/4] test: add unit tests for WebDriver.orientation property Add unit tests for getter, setter, and invalid value handling of the WebDriver.orientation property in test/unit/webdriver/webdriver_test.py. --- test/unit/webdriver/webdriver_test.py | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/unit/webdriver/webdriver_test.py b/test/unit/webdriver/webdriver_test.py index 73966a24..6d771608 100644 --- a/test/unit/webdriver/webdriver_test.py +++ b/test/unit/webdriver/webdriver_test.py @@ -16,7 +16,9 @@ from unittest.mock import patch import httpretty +import pytest import urllib3 +from selenium.common.exceptions import WebDriverException from appium import webdriver from appium.options.android import UiAutomator2Options @@ -512,6 +514,36 @@ def test_get_client_config_and_connection_custom_appium_connection(self): assert command_executor._client_config != client_config assert client_config is None + @httpretty.activate + def test_orientation(self): + driver = android_w3c_driver() + httpretty.register_uri( + httpretty.GET, + appium_command('/session/1234567890/orientation'), + body=json.dumps({'value': 'PORTRAIT'}), + ) + assert driver.orientation == 'PORTRAIT' + + @httpretty.activate + def test_set_orientation(self): + driver = android_w3c_driver() + httpretty.register_uri( + httpretty.POST, + appium_command('/session/1234567890/orientation'), + body=json.dumps({'value': 'LANDSCAPE'}), + ) + driver.orientation = 'LANDSCAPE' + assert get_httpretty_request_body(httpretty.last_request()) == {'orientation': 'LANDSCAPE'} + + driver.orientation = 'portrait' + assert get_httpretty_request_body(httpretty.last_request()) == {'orientation': 'portrait'} + + @httpretty.activate + def test_set_orientation_invalid(self): + driver = android_w3c_driver() + with pytest.raises(WebDriverException, match="You can only set the orientation to 'LANDSCAPE' and 'PORTRAIT'"): + driver.orientation = 'INVALID' + class SubWebDriver(WebDriver): def __init__(self, command_executor, options=None): From 951744e34fcd124b6cac49bf707ba4dd503e3aea Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 19 Oct 2026 05:16:36 +0000 Subject: [PATCH 3/4] test: add unit tests for WebDriver.orientation property Add unit tests for getter, setter, and invalid value handling of the WebDriver.orientation property in test/unit/webdriver/webdriver_test.py. From 2c3278e0e47cb3ff2d9302252598f84279f221db Mon Sep 17 00:00:00 2001 From: Dor-bl <59066376+Dor-bl@users.noreply.github.com> Date: Mon, 19 Oct 2026 06:22:35 +0000 Subject: [PATCH 4/4] test: add unit tests for WebDriver.orientation property Add unit tests for getter, setter, and invalid value handling of the WebDriver.orientation property in test/unit/webdriver/webdriver_test.py.