Test suite

From Pitivi wiki
Jump to: navigation, search

We have two sets of tests: the normal unit tests (make check) and the UI tests using Dogtail.

Since version 0.91, our backend test suite is much smaller and simpler; since most of the core functionality is now handled by GES, you need to run GES's test suite instead if you want to test more thoroughly.

Contents

Unit tests

You can then run the unit tests with:

cd tests
make check

If you want to run only one particular unit test you can use for example:

nosetests tests/test_project.py:TestProjectManager.testLoadProjectFailedUnknownFormat -v

Writing unit tests

As mock library we use Mock, as it's now integrated into Python3 which we use as of 0.94.

UI tests with Dogtail

The dogtail tests are located in the tests/dogtail_scripts directory. Dogtail simulates a user interacting with the graphical user interface, which looks like this (accelerated).

Installing Dogtail

  1. Install dogtail (on Fedora: "yum install dogtail", on Ubuntu: install it manually)
  2. As a normal user, run "sniff" to make sure the assistive technologies are enabled (dogtail uses AT-SPI to do its magic)
  3. Logout and re-login

Running the UI tests

Assuming you've got Pitivi git with the environment variables set properly (see Building with GES), you can go to the pitivi directory and run all our UI tests by doing:

python2 -m unittest discover tests/dogtail_scripts/ -v

If you want finer control over what's being tested or a solid alternative to Python's unittest, try nosetests. For example:

nosetests tests/dogtail_scripts/test_effects.py:EffectLibraryTest.test_change_effect_settings

During test execution, do not touch your computer. Go grab a cup of tea or a hot dog and watch the show. It will take a couple of minutes, depending on how fast your computer is.

Writing UI tests

Read first the Dogtail performance tips. Then look around to see how we did it and check the Dogtail API if you need more info.


See also:

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox