DEV Community

wave1008
wave1008

Posted on • Edited on

Introducing Shirates, a Mobile Testing Automation Tool

This article is an introduction of Shirates, a mobile testing automation tool.

Automating tests for mobile apps

Recently, automating of software test is more and more important than ever. Of course, mobile apps too. There are many paid/free tools to automate. Appium is one of products that has received a lot of attention in open source products. I tried introducing and making use of Appium, and found that it's very functional and awesome but very difficult for the average test engineers. We need long time to master and utilize it. Since even engineers with development skills have a hard time, we think it's hard to widely spread this technology to the average test engineer unless it is easier to introduce and use.

What is Shirates

Shirates is an OSS tool that make it easy a bit, available on GitHub.

https://github.com/ldi-github/shirates-core

Shirates has the following features.

  1. Almost cross-platform useful APIs to write test code, currently supports Android and iOS platform.
  2. Powerful logging and reporting
  3. Flexible configuration framework to set up test environment

Setup

Shirates is available on macOS or Windows.

See Quickstart to setup.

Getting Sample Project

  • Get sample project from GitHub.
git clone https://github.com/wave1008/shirates-samples-practice1.git
Enter fullscreen mode Exit fullscreen mode
  • Open Practice1 directory in Finder(or Exporer).
  • Right-click build.gradle.kts and open with IntelliJ IDEA. Open with IntelliJ IDEA Practice1 Project
  • Open CalculatorTest1. CalculatorTest1

Test Code

Test Code

Running test

  • Launch Android 12 emulator and stand by. Set language in English. Install Calculator app from Google Play Store if it is not installed.
  • Right-click on test1() and select Debug to start executing test.

Start test

  • After the test session finished, click link file://... to open in Finder(or Explorer).

Output

  • Double-click _Report(simple).html to open in browser.

_Report(simple).html

  • Double-click CalculatorTest1@a.xlsx to open the test result in spreadsheet application.

CalculatorTest1.xlsx

Explanation of test code

Test Code

  • 8: Inherit from UITest class.
  • 10: Apply Test annotation to test1 function to be recognized as JUnit 5 test method.
  • 13: Call scenario function.
  • 14: Call case function. The argument is test case number.
  • 15: Call condition function. Precondition is implemented here.
  • 18-26: Call action function. Tapping keys of Calculator is implemented here.
  • 27-29: Call expectation function. Confirmation is implemented here.



In Shirates, you can write test code in simple description like this.

For more information see shirates-core in GitHub.

Top comments (1)

Collapse
 
wave1008 profile image
wave1008

Demonstration Sample Project "Practice1" (Movie)
dev.to/wave1008/demonstration-samp...