From c06752a1b80c2ab3189a79f8f27257bbd8060083 Mon Sep 17 00:00:00 2001 From: Fadi George Date: Tue, 20 Oct 2026 18:08:31 -0700 Subject: [PATCH] fix(appium): read input text via getText on native Android Co-Authored-By: Claude Opus 5.5 --- appium/tests/helpers/app.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/appium/tests/helpers/app.ts b/appium/tests/helpers/app.ts index c4d4ae7..bbe4fe3 100644 --- a/appium/tests/helpers/app.ts +++ b/appium/tests/helpers/app.ts @@ -266,10 +266,13 @@ export async function logoutUser() { export async function fillInput(testId: string, value: string) { const input = await byTestId(testId); await input.waitForDisplayed({ timeout: 5_000 }); + // UiAutomator2 has no `value` attribute; native Android exposes input text via getText. + const readsText = getPlatform() === 'android' && !isWebViewSDK; await driver.waitUntil( async () => { await input.setValue(value); - return (await input.getValue()) === value; + const typed = readsText ? await input.getText() : await input.getValue(); + return typed === value; }, { timeout: 10_000, interval: 500, timeoutMsg: `Input "${testId}" did not keep "${value}"` }, );