Gaia Integration Tests

Using the Marionette JS Runner

Slides:

agenda (for quick access)

agenda (for quick access)

agenda (for quick access)

UNIT VS. INTEGRATION TESTS

  • /apps/communications/contacts/test/unit/navigation_test.js 
  • Author: @gtorodelvalle (git blame on me :-p )
  • This "unit" test:
  • Checks that the Contacts app navigation library works as expected
  • Mocks the UI
  • Dispatches events (animetionend) as the communication means among the involved components

THIS IS NOT A UNIT TEST!!!

WHY INTEGRATION TESTS?

WHAT IS MARIONETTE? (I)

  • Marionette is an automation driver
  • Marionette runs as a server
  • Marionette makes it possible to send commands to a program built on the Gecko platform (Firefox, Firefox OS):
    • Simulating UI interactions
    • Running JavaScript code

WHAT IS MARIONETTE? (II)

RUNNING OUR FIRST INTEGRATION TEST

  • Pre-requisites: Node.js >= 0.10
git clone https://github.com/mozilla-b2g/gaia.git

make test-integration [VERBOSE=1] [APP=<app-name> | TEST_FILES="<path-to-test-1> <path-to-test-2> ..."]

export VERBOSE=1
export APP=communications
export TEST_FILES="<path-to-test-1> <path-to-test-2> ..."
$GAIA/bin/gaia-marionette
$GAIA/bin/gaia-marionette-parallel

# To avoid the b2g-desktop windows from showing for every test.
xvfb-run make test-integration

# To avoid hearing sounds.
PULSE_SERVER=":" make test-integration

PULSE_SERVER=":" xvfb-run make test-integration

# To avoid the b2g-desktop windows from showing for every test and to avoid hearing sounds.
PROFILE_FOLDER=profile-test make # generate profile directory in first time
make test-integration-test

BASIC INTEGRATION TEST STRUCTURE

INSTANTIATING THE MARIONETTE CLIENT

CLIENT: CONFIGURATION

CLIENT: SETTING THE CONTEXT

CLIENT: GETTING INFORMATION

CLIENT: NAVIGATING

CLIENT: FINDING ELEMENTS

Gaia Integration Tests using Marionette JS Runner

By Germán Toro del Valle

Gaia Integration Tests using Marionette JS Runner

  • 4,780