Repository navigation
fix(android): send the gsmVoice and powerAc execute method names - #1320
Open
theluckystrike wants to merge 1 commit into
Open
theluckystrike wants to merge 1 commit into
theluckystrike wants to merge 1 commit into
Conversation
set_gsm_voice sent `mobile: gmsVoice` (letters transposed) and
set_power_ac sent `mobile: powerAC`. appium-android-driver registers
`mobile: gsmVoice` and `mobile: powerAc` in its executeMethodMap, which
UiAutomator2 and Espresso inherit, and BaseDriver.executeMethod looks the
name up exactly. Both calls failed with UnknownMethodException and the
emulator state didn't change.
I fixed both names in appium/webdriver/extensions/android/gsm.py and
power.py (plus the powerAc docstring), asserted the script name in
test_set_gsm_voice and corrected the expected name in test_set_power_ac.
Tests I ran
$ uv run python -m pytest test/unit/webdriver/device/gsm_test.py test/unit/webdriver/device/power_test.py (extensions from master 4a4c46b)
E AssertionError: assert 'mobile: gmsVoice' == 'mobile: gsmVoice'
E AssertionError: assert 'mobile: powerAC' == 'mobile: powerAc'
2 failed, 3 passed
$ uv run python -m pytest test/unit (this branch)
202 passed
$ uv run ruff check . All checks passed
$ uv run ruff format (check mode) 394 files already formatted
$ uv run mypy appium Success, no issues found in 320 source files
End to end, the client against AndroidDriver.execute() from
appium-android-driver 14.2.3 behind a local HTTP shim (adb stubbed, no
emulator)
master set_power_ac UnknownMethodException Unsupported execute method 'mobile: powerAC', did you mean 'mobile: powerAc'?
set_gsm_voice UnknownMethodException Unsupported execute method 'mobile: gmsVoice', did you mean 'mobile: gsmVoice'?
branch set_power_ac OK, driver calls adb.powerAC(off)
set_gsm_voice OK, driver calls adb.gsmVoice(roaming)
Not run against a real emulator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
set_gsm_voiceandset_power_acnever reach the driver.set_gsm_voicesendsmobile: gmsVoice(letters transposed).set_power_acsendsmobile: powerAC.appium-android-driver registers
mobile: gsmVoiceandmobile: powerAcin itsexecuteMethodMap(UiAutomator2 and Espresso inherit it), andBaseDriver.executeMethodlooks the name up exactly. Both calls fail withUnknownMethodExceptionand the emulator state doesn't change.This PR fixes both names in
appium/webdriver/extensions/android/gsm.pyandpower.py, asserts the script name intest_set_gsm_voiceand corrects the expected name intest_set_power_ac.Test runs
End to end, the client against
AndroidDriver.execute()from appium-android-driver 14.2.3 behind a local HTTP shim (adb stubbed, no emulator)I compared every
mobile:name inappium/with the execute method maps of appium-android-driver, appium-uiautomator2-driver and appium-xcuitest-driver. These two were the only mismatches. The uiautomator2 README still documentsmobile: powerAC, while the driver itself only acceptspowerAc.