Skip to main content

Mobile App

The Test Evolve Mobile App driver is available if you have configured test_types in config.yml to include mobile_app or selected the test_type mobile_app in Test Evolve Studio.

TestEvolve.mobile_app

In Spark Ruby TestEvolve.mobile_app is an instance of a Selenium::WebDriver::Driver.

Elements

Locating Elements

Spark uses native selenium commands to locate elements as shown below:

test_evolve.mobile_app.find_element(id: 'unique-identifier')

Click

action.click(element).perform

Send Keys

element.type 'value'

Get Text

element.text

Scroll to Element

Documentation to be added

Screen Object

The Mobile App Screen Object model is used as an equivalent to the page object model in the browser. It reduces code duplication and improves test maintenance.

In Spark page object files are generally kept in features/support/screens.

The following is a basic screen object template:

module Screens
def main_screen
@main_screen ||= MainScreen.new
end

class MainScreen < TestEvolve::Core::MobileAppScreenObject
element(:standard_button) { { accessibility_id: 'standard-button' } }

def click_standard_button
standard_button.click
end
end

An instance of the MobileAppScreenObject class can be referenced from any Step Definition file using main_page.

For example:

main_screen.click_standard_button

Visual testing

Read the guide of visual testing here.

TestEvolve.mobile_app.visual_check('label')