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.
- Almost cross-platform useful APIs to write test code, currently supports Android and iOS platform.
- Powerful logging and reporting
- 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
- Open
Practice1
directory in Finder(or Exporer). - Right-click
build.gradle.kts
and open with IntelliJ IDEA. - Open
CalculatorTest1
.
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.
- After the test session finished, click link
file://...
to open in Finder(or Explorer).
- Double-click
_Report(simple).html
to open in browser.
- Double-click
CalculatorTest1@a.xlsx
to open the test result in spreadsheet application.
Explanation of 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)
Demonstration Sample Project "Practice1" (Movie)
dev.to/wave1008/demonstration-samp...