Skip to content

Espresso Test fails in WorkspaceSetter.kt #653

@bryanwussow

Description

@bryanwussow

Describe the bug
The Espresso Test for happypath/voicestudio
is failing on my Pixel 2 API 28 emulator at

java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.test.uiautomator.UiObject2.click()' on a null object reference
at org.sil.storyproducer.androidtest.happypath.WorkspaceSetter$Companion.selectStoryProducerWorkspace(WorkspaceSetter.kt:220)

It appears it is in the midst of selecting the workspace folder.
It drops the 3-bar 'showRoots' menu
It successfully finds the internal storage item, which on this emulator is
AOSP on IA Emulator
At WorkspaceSetter.kt:212 it attempts to click it, but I'm not seeing the folder picker respond.
Why not?
(if I manually click AOSP on IA Emulator it responds correctly and shows the directory)

Even if the directory is showing, the test code returns a null at line 220 when attempting to
device.findObject(By.text(Constants.workspaceDirectory))
which is looking for an object with the workspaceDirectory text: SPWorkspace

The SPWorkspace folder does exist. (but it is lower in the list. Normally you would have to scroll down to see it.)
Why can't the test find the object SPWorkspace folder (so it can click it...) ?

Note: I did just make changes to give the Welcome screen a 'NEXT' button and the Select SP Templates Folder help dialog a NEXT button. I edited WorkspaceSetter.kt and the test appears to use those buttons just fine.

To Reproduce
Steps to reproduce the behavior:

  1. Set up for Espresso tests per the Wiki
  2. Set up Android Studio to use the Pixel 2 API 28 emulator.
  3. in the project tree under "org.sil.stryporducer.androidtest" go down to happypath/voicestudio
  4. right click to run or debug tests

Expected behavior
tests should pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions