Skip to content

Releases: mozership/probe-android

Release list

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 26 Oct 08:44
8dc93ff
uses: github.com/mozership/probe-android@bd855d4c4c0a62c662f7e059e4ff5b0586c63732 # v0.2.0

Highlights

  • type types any text (#1). input text types printable ASCII alone, so type refused Japanese and other text before the step ran. Such text, and %s, which input text reads as a space, now go through ADBKeyBoard, an input method that types the text adb sends it, when the device has it. ASCII still goes through input text, which needs nothing installed.
- name: type
  selector: id=ssid
  value: 日本語
  • ADBKeyBoard has to be installed on the device: adb install keyboardservice-debug.apk, from its releases. It needs no setting up beyond that. A step that types such text makes it the input method before its first action, enabling it when it is not, and puts the input method back as it was once the step is over, also when the step fails or its timeout runs out.
  • ADBKeyBoard drops text it is sent before it is bound to the focused element, and says nothing. The action reads the screen until the focused element has the text, and sends it again when it does not; the text is committed whole or not at all, so it is not typed twice. When it never shows, the step fails with the element that had the focus:
actions[5] type: the step's timeout ran out: ADBKeyBoard did not type "日本語": EditText id=com.android.settings:id/ssid text="Wi-Fi" [20,230][256,278] focused had the focus

Changed behavior

  • A step whose type has text other than printable ASCII used to be refused before it ran. It now runs on a device with ADBKeyBoard, and fails before its first action on one without, with where to get it:
actions[2] type: input text types printable ASCII alone, so "日本語" needs ADBKeyBoard: ADBKeyBoard is not installed: download keyboardservice-debug.apk from https://github.com/senzhk/ADBKeyBoard/releases and install it with adb install, and the action switches to it to type such text
  • tree marks the element that has the focus with focused.

Known limitation

Reading the screen with uiautomator dump, as each action on an element does, hides the soft keyboard. An element keeps the focus, and type types into it all the same, but an app that acts on the keyboard going cannot be driven past it: the search of Settings closes.

Testing

  • The e2e installs ADBKeyBoard v2.5-dev, checked against the digest GitHub lists for it, types Wi-Fi and then 日本語 into the name of a network to add in Settings on an Android 15 emulator, and checks the input method is put back.
  • When the e2e fails, the CI keeps the screen it was left on, as uiautomator reads it and as a screenshot.

See the README.

Changelog

  • 1fb26f2 Debug: print the tree of the search
  • ca38b94 Keep the screen the e2e failed on
  • 8dc93ff Merge pull request #1 from mozership/feat/adbkeyboard
  • b61457c Point action.yml at v0.1.0
  • a84d496 Revert "Debug: print the tree of the search"
  • f4c38e9 Say which element had the focus when ADBKeyBoard did not type
  • 4c27023 Switch to ADBKeyBoard before the first action of the step
  • cc5e8e4 Type into the name of a network to add in the e2e
  • c5bfc4b Type text input text cannot with ADBKeyBoard

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 26 Oct 07:24
42036ca
uses: github.com/mozership/probe-android@b61457c71c3d04b825d7fa89cf4183679e281fed # v0.1.0

Highlights

  • The first release of the android action. It drives an app on an Android emulator or device: it launches the app, taps and types into it, presses back, waits for elements, reads their text and the screen, and takes screenshots.
  • It works through adb alone. It reads the screen with uiautomator dump and acts on it with input, so there is nothing to build, and nothing to install on the device but the app under test.
  • Its with and its result have the shape of probe-ios's, with selectors on what Android knows of an element: id, text, desc, class and index.

A step

actions:
  android: github.com/mozership/probe-android@b61457c71c3d04b825d7fa89cf4183679e281fed # v0.1.0

jobs:
- name: Settings
  steps:
  - name: Open Network & internet
    uses: android
    with:
      app: com.android.settings
      actions:
      - name: launch
      - name: tap
        selector: text="Network & internet"
      - name: wait
        selector: text="Airplane mode"
      - name: text
        id: airplane
        selector: text="Airplane mode"
    test: res.code == 0 && res.results.airplane == "Airplane mode"

An action on an element reads the screen again until the element is on it, for what is left of the step's timeout, and fails the step with the reason when it does not come:

actions[0] tap: no element matches text="No Such Row" within 5.0s

tree lists the screen an element a line, with what a selector can name:

TextView id=android:id/title text="Network & internet" [200,540][700,600]

Requirements

  • adb, on PATH or in $ANDROID_HOME/platform-tools, and a booted emulator or a device with USB debugging on, with the app installed. The action boots nothing and installs nothing.
  • type types printable ASCII alone, as input text does; other text is refused before the step runs.
  • The e2e runs it through Probe v1.30.0 on an Android 15 (API 35) emulator on Ubuntu, with android-emulator-runner.

See the README.

Changelog

  • 42036ca Drive an Android emulator or device from a Probe workflow, as an action of its own