Design

Differences between revisions 1 and 6 (spanning 5 versions)
Revision 1 as of 2009-03-26 12:05:32
Size: 3271
Editor: 63
Comment:
Revision 6 as of 2009-06-29 09:20:33
Size: 3181
Editor: 63
Comment: The project changed the name
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
The objective of having written a framework for desktop testing automation in Ubuntu is to have a consistent way to write automated tests for all the Ubuntu applications. Furthermore, it makes it easier to write new and reusable tests for applications already available in the framework. ## page was renamed from Testing/Automation/Desktop/Design
The objective of having written a framework for desktop testing automation in Ubuntu is to have a consistent way to write automated tests for all the applications. Furthermore, it makes it easier to write new and reusable tests for applications already available in the framework.
Line 3: Line 4:
=== The gnome.py & gnome_constants.py === === The gnome.py ===
Line 7: Line 8:
=== The ubuntu.py & ubuntu_constants.py === === The ubuntu.py ===
Line 13: Line 14:
The Application class (and all the rest of the applications that inherit from it) have 3 methods, needed for the test suite configuration: setup(), cleanup() and teardown(). The TestSuite class (and all the rest of the applications that inherit from it) has 3 methods, needed for the test suite configuration: setup(), cleanup() and teardown().
Line 24: Line 25:
Under the bin folder, the ubuntu-desktop-test script, runs the test cases and parses the log. Under the bin folder, the mago script, runs the test cases and parses the log.
Line 29: Line 30:
Usage: ubuntu-desktop-test [OPTIONS] Usage: mago [OPTIONS]
Line 46: Line 47:
                        ~/.ubuntu-desktop-test                         ~/.mago
Line 50: Line 51:
For example, to run all the update-manager tests run, from the gnome-desktop-testing root folder: For example, to run all the update-manager tests run, from the mago root folder:
Line 53: Line 54:
./bin/ubuntu-desktop-test -a update-manager ./bin/mago -a update-manager
Line 56: Line 57:
By default, logs go to ~/.ubuntu-desktop-test, but it can be override using the -t option By default, logs go to ~/.mago, but it can be override using the -t option
Line 62: Line 63:
The TestSuite runner parses the XML file and creates an array of test cases to run. Please, read the document on [[./CreateNewTests|how to create new test suites]], to understand the syntax of the XML file. The TestSuite runner parses the XML file and creates an array of test cases to run. Please, read the document on [[../NewTests|how to create new test suites]], to understand the syntax of the XML file.

The objective of having written a framework for desktop testing automation in Ubuntu is to have a consistent way to write automated tests for all the applications. Furthermore, it makes it easier to write new and reusable tests for applications already available in the framework.

The gnome.py

When adding a new application to the framework, a new class is created in gnome.py module, inheriting from Application.

The ubuntu.py

Same as gnome.py, but for Applications only available in the Ubuntu distribution.

Setup, Clean Up & Teardown

The TestSuite class (and all the rest of the applications that inherit from it) has 3 methods, needed for the test suite configuration: setup(), cleanup() and teardown().

  • setup() is called once when the test suite starts running. It includes the operations needed in the application to leave it in a state where the test cases work.
  • cleanup() is called between test cases in the same test suite. It includes the operations needed to leave the application in the same state as when the test suite started.
  • teardown() is called once when the test suite ends. In includes the operations to leave the system in the same state as before running the suite (killing processes, closing applications, etc)

The Test Runner

Under the bin folder, the mago script, runs the test cases and parses the log.

Syntax:

Usage: mago [OPTIONS]

Options:
  -h, --help            show this help message and exit
  -l FILE, --log=FILE   The file to write the log to.
  --log-level=LOG_LEVEL
                        One of debug, info, warning, error or critical.
  -a APPLICATION, --application=APPLICATION
                        Application name to test. Option can be repeated and
                        defaults to all applications
  -s SUITE, --suite=SUITE
                        Suite name to test within applications. Option can be
                        repeated and default to all suites
  -f FILE, --file=FILE  XML file name of the suite to test within
                        applications.
  -t FILE, --target=FILE
                        Target directory for logs and reports. Defaults to:
                        ~/.mago

For example, to run all the update-manager tests run, from the mago root folder:

./bin/mago -a update-manager

By default, logs go to ~/.mago, but it can be override using the -t option

The classes that run the tests are TestSuiteRunner and TestCaseRunner:

testrunner.jpg

The TestSuite runner parses the XML file and creates an array of test cases to run. Please, read the document on how to create new test suites, to understand the syntax of the XML file.

It then runs the setup() method of the BaseClass, and start running each of the test cases.

After each testcase, it runs the suite cleanup() method, to leave the application in its initial state.

After running all the testcases in the suite, it will call the teardown() method, to close the application and leave the system as before.

Testing/Automation/Mago/Design (last edited 2009-06-29 09:20:33 by 63)