The system under test is a simple android app called Notepad. It’s packaged with the test under:
The test will install the Notepad app to the target device, and start running the test. The model to the right depicts the design of the test. The code that implements the test is:
class NotesListTest implements the `interface NotesList’. That interface is automatically generated by GraphWalker,
either by running one of the following commands:
mvn graphwalker:generate-sources mvn graphwalker:test
Worth noting in the code is the line with GraphWalker annotation:
@GraphWalker(value = "random(edge_coverage(100))", start = "v_NotesListView")
It does 2 things:
value = "random(edge_coverage(100))"
It sets the generator and the stop condition of the of the path generation of the test.
random(edge_coverage(100))means the the path generator is the random path generator, and the stop condition is when all edges of the graph has been visited.
start = "v_NotesListView"Tells GraphWalker where to start the execution.
v_NotesListViewwill be the first graph element to be executed.
The above is the equivalent as running the test offline:
java -jar graphwalker-cli-3.4.2.jar offline -m NotesList.graphml "random(edge_coverage(100))"
Steps to execute the project
- Install appium. On Ubuntu:
sudo apt install nodejs-legacy sudo npm install -g appium
- Start android emulator.
The test is only verified running the Android emulator using Nexus 7, 2012 with API 19. From command line on a linux box:
emulator -avd Nexus_5X_API_23
- Start appium
- To run the test:
git clone https://github.com/GraphWalker/graphwalker-example.git cd graphwalker-example/java-appium mvn graphwalker:test