# Mobile Testing Tutorial

# Introduction

Now that you've set up your mobile environment, it's time to run some tests!

# Prerequisites

# Creating the project

  • To create a new Gondola project click the Gondola Studio icon in VSCode, then click the Create New Project icon. Gondola Studio New Project Icon

  • Select your project's location

  • Select the [Gondola-Appium] Blank project template

  • Input your gexpenses as the name then hit Enter

  • Gondola Studio will create a folder for the project

  • Explorer will open for you to begin working on your project


When you create a new project, Gondola Studio calls the command-line tool npm -i to install the Gondola FW and download all of its required dependencies. If you have downloaded them before, don't worry if you see downloading... in the status bar. NPM copies the files from an offline cache if there is nothing that needs to be updated.


If you get an Unsupported engine error while Gondola is attempting to download dependencies, it indicates that your version of Node.js is not compatible. We recommend using Node Version Manager to manage your Node.js version. Follow the steps below to install it:

After installing the latest Node.js LTS version, you can check the Node.js version and install the project's dependencies by running the command below:

node -v
npm i

# Setting up your project

  • Make a copy of gondola.json and rename it to gondola.android.json
  • Open gondola.android.json and set the app field to https://storage.gondolatest.com/public/sample/gexpenses-1.0.2.apk
  • Next, create another folder name src in the project root.
  • Inside the src folder, create a folder named tests


If you're using a device running Android <=8.1 you'll need to add the flag: "appWaitForLaunch": false to the desiredCapabilities section of your gondola.json. This is an issue with Expo.

# Writing your first test

In the field marked description, enter Functionality Test

# Starting TestBuilder

  1. Start your emulator or connect your device.


If you're using a real Android Device, make sure you've enabled USB debugging

  1. Start an Appium server
  1. Click the TestBuilder Icon TestBuilder icon. After starting TestBuilder the Create new session dialog will open Create a new session
    • Select gondola.android.json as the capabilities file.

# Using TestBuilder

After TestBuilder has finished initializing, you'll see the G Expenses app on your Device Live Screen using testbuilder

  1. In the Test Cases section you should see one blank Test Case. Enter check tabs in the description field
  2. On the Device Live Screen, right click on the text in the header that says "Expenses".
  3. When the context menu appears click wait for element. For the number of seconds enter 10. You'll see a new row in the test case with this keyword and the locator information for the text

Did you know?

Gondola uses a smart wait; the number of seconds you specify with wait for element is the maximum number of seconds Gondola will wait. If the element appears sooner, Gondola will stop waiting.

  1. Now right click the header again and search for check text. Enter "Expenses" for text to check for.
  • Now that we've checked for the Expenses tab, let's check that the other tab works.
  1. Right click the dashboard tab icon dashboard icon at the bottom of the screen, and click tap.
  2. Wait for the screen to refresh and then left-click the Dashboard header and click wait for element and enter 10 seconds.
  3. Then check that the header's text says "Dashboard" Your test case should look like this:

# Saving and running your test

There are two ways to run your test, with the execution dialog or via the command line. In this tutorial we'll use the execution dialog.

  1. Press the save button save button. Type expenses_test and press enter.
  2. After saving your test, click the run button to open the test execution dialog. run test button
  3. Select gondola.android.json as the capabilities file.
  4. Press the Run button
    execute test

# Viewing the results

After running your test the results will pop up in your default browser.


By default, Gondola uses Mochawesome as test reporter, however you can use other test reporters with Gondola. Click here for more.

# Adding a Second Test Case

Now that we've checked that the different tabs exist, let's test some functionality. We'll add an expense and check that it's shown.

# Creating a new Test Case block

  1. Click the add new row button in the bottom row to create a new blank row.
  2. Enter "Test Case" in the first cell of the new row.
  3. In the description field write add expense

For our next Test Case we need to go back to the Home Tab, but we don't want to add this to the Test Case.

  • Click the Inspection/Interaction Mode button in the bottom of the Device Live Screen.
  • It should be blue Inspection mode button, click it to enter Interaction Mode
  • In Interaction mode button Interaction Mode, press the GExpenses home icon Home button in GExpenses to navigate back to the Expenses tab
  • Now we want to add actions so switch back to Inspection Mode by pressing the button again. It should turn blue Inspection mode button

# Adding and Checking an Expense

  1. Right click on the Header and use wait for element and enter 10 seconds.
  2. Right-click the + button in the top corner of the Home tab and select the tap action
  3. When the Add Expense screen appears, right-click the Description field and select wait for element, enter 10 seconds.
  4. Then right click the same Description field again and select enter and enter Coffee
  5. Now right-click on the date field and select tap
  6. When the date picker pops up, use tap to select today's date, then use tap on the ok button.
  7. Use the enter action to enter 3.00 in the price field.
  8. Right-click the Add Expense button and select tap.
  9. After the screen refreshes you should see an item list that says Coffee under a section labeled Today with a price that says $3.00.
  10. Right click on the list item, and select wait for element and input 10 as the number of seconds
  11. Right click on the text that says Coffee and select check text. Enter Coffee
  12. Right click on the text that says $3.00 and select check text. Enter $3.00
  13. Save the test and run it.

# Save and Run your test

  1. Press the save button save button
  2. Click the run button to open the test execution dialog. run test button
  3. Select gondola.android.json as the capabilities file.
  4. Press the Run button
    execute test
Last Updated: 12/28/2020, 4:12:58 AM