sebaslogen / CleanGUITestArchitecture

Sample project of Android GUI test automation using Espresso, Cucumber and the Page Object Pattern
MIT License
137 stars 31 forks source link

Running feature seems to fail. #19

Closed jonathong closed 7 years ago

jonathong commented 7 years ago

Is there a different way I should be running the tests? Right-clicking a feature and clicking run ends up failing with the errors:

" Undefined step: Given I see the login page

Undefined step: When I login with user name "Sebas" and password "passion" . . . . .

"

I tried with my own project and yours.

sebaslogen commented 7 years ago

Yes, it's not possible to run tests from the UI in the way you described, you have to use the gradle task either from the Gradle list in Android Studio's UI (vertical tab on the right) or from the command line.

See the instructions about the gradle task: https://github.com/sebaslogen/CleanGUITestArchitecture#user-content-execute-the-project

For more info about how tests are executed and recognized by Cucumber, you can look here: https://github.com/sebaslogen/CleanGUITestArchitecture/issues/17

jonathong commented 7 years ago

Is there a way to run these tests on a Built APK? I am looking at cloud-testing providers and need to know If I will be able to use this framework with something like Xamarin or Firebase.

Thanks.

sebaslogen commented 7 years ago

Yes, these tests work exactly as any other Instrumentation test (like Espresso). When you run or build the Gradle test task (gradlew assembleAndroidTest), the instrumentation apk with tests will be produced automatically in app/build/outputs/apk directory.