Skip to content

Example UI tests for AURDroid mobile app for Android using Appium + Kotlin

License

Notifications You must be signed in to change notification settings

bgroJr/AURDroidTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📱 ✅ AURDroidTest

Example UI tests for the AURDroid mobile application for Android.

Automated UI tests are written in Kotlin (script), with Appium for mobile app interaction.

Purpose

Proof of concept for writing automated test scripts with the experimental scripting mode of the Kotlin runtime. Attempting to show the viability of a lighter weight workflow, and avoid Java 😝

Setup

# on Mac OS, use HomeBrew and NPM to install system dependencies
# ... and let's just assume you have the Android SDK installed already
$ brew install kotlin
$ brew install node
$ npm install -g appium@latest

Run

$ kotlinc -script TestRunner.main.kts

Tests

The tests are defined in AURDroid.kts. The tests interact with the AURDroid mobile application.

Each screen of the mobile application is represented by a class which implements methods of interacting with and retrieving information from the screen: Home.kts, Results.kts, Package.kts These classes are the mobile version of the Page Object Model design pattern.

TestRunner.main.kts contains a minimal test runner using JUnitCore.

.main.kts

When you give a Kotlin file the .main.kts extension, Kotlin's experimental scripting extension will trigger for script execution. The experimental extension enables special annotations like @file:DependsOn to specify external project dependencies, and @file:Import to specify internal dependencies.

Putting these annotations at the top of a script file saves you some work and complexity that you're normally stuck with when you work with a JVM-based language. And I'm getting pretty tired of editing Gradle build scripts 🐘 😩

Releases

No releases published

Packages

No packages published

Languages