Merge lp://qastaging/~unity-2d-team/unity-2d/testability-integration into lp://qastaging/unity-2d

Proposed by Gerry Boland
Status: Merged
Approved by: Tiago Salem Herrmann
Approved revision: 845
Merged at revision: 831
Proposed branch: lp://qastaging/~unity-2d-team/unity-2d/testability-integration
Merge into: lp://qastaging/unity-2d
Diff against target: 3559 lines (+3248/-6)
30 files modified
CMakeLists.txt (+1/-0)
launcher/Launcher.qml (+2/-2)
launcher/LauncherItem.qml (+7/-0)
launcher/LauncherList.qml (+2/-0)
launcher/tests/CMakeLists.txt (+1/-1)
libunity-2d-private/src/testabilityinterface.h (+37/-0)
libunity-2d-private/src/unity2dapplication.cpp (+42/-0)
libunity-2d-private/src/unity2dapplication.h (+4/-0)
libunity-2d-private/tests/CMakeLists.txt (+2/-2)
panel/tests/CMakeLists.txt (+1/-1)
tests/README (+177/-0)
tests/launcher/autohide_show_tests.rb (+193/-0)
tests/launcher/visual_verification.rb (+86/-0)
tests/manual-tests/launcher.txt (+104/-0)
tests/manual-tests/places.txt (+13/-0)
tests/manual-tests/window-manager.txt (+9/-0)
tests/misc/binary_dir.txt.in (+1/-0)
tests/misc/lib/testhelper.rb (+162/-0)
tests/misc/lib/xdo/README.xdo.rdoc (+52/-0)
tests/misc/lib/xdo/_xdo.rb (+35/-0)
tests/misc/lib/xdo/clipboard.rb (+209/-0)
tests/misc/lib/xdo/keyboard.rb (+387/-0)
tests/misc/lib/xdo/mouse.rb (+254/-0)
tests/misc/lib/xdo/simulatable.rb (+91/-0)
tests/misc/lib/xdo/test/test_clipboard.rb (+49/-0)
tests/misc/lib/xdo/test/test_keyboard.rb (+114/-0)
tests/misc/lib/xdo/test/test_mouse.rb (+29/-0)
tests/misc/lib/xdo/test/test_xwindow.rb (+101/-0)
tests/misc/lib/xdo/xwindow.rb (+1009/-0)
tests/run-tests.rb (+74/-0)
To merge this branch: bzr merge lp://qastaging/~unity-2d-team/unity-2d/testability-integration
Reviewer Review Type Date Requested Status
Tiago Salem Herrmann (community) Approve
Review via email: mp+85417@code.qastaging.launchpad.net

Description of the change

[tests] Add Automated User Experience testing using "Testability"

Add support for Testability, a Qt application automated testing framework, with some boilerplate code to allow easy writing of tests using Ruby's Test::Util library. Also added is a Ruby library called XDo which allows control of the X server and fake mouse, keyboard and window management.

A couple of sample tests for the launcher have been written. This required the addition of some objectName definitions to the launcher.

To post a comment you must log in.
Revision history for this message
Gerry Boland (gerboland) wrote :

A quick guide to setting up your machine to for testing this MR:

$ sudo add-apt-repo ppa:gerboland/testability
$ sudo apt-get update
$ sudo apt-get install rubygems testability-qttas \
  ruby-testability-driver-qt-sut-plugin testability-visualizer \
  librmagick-ruby1.8 xdotool xsel xkill xwininfo

Edit /etc/tdriver/tdriver_parameters.xml to just contain:

<parameters>
   <sut id="sut_qt" template="qt">
       <!-- use default values -->
       <parameter name="qttas_server_ip" value="127.0.0.1" />
   </sut>

   <!-- overload default behaviours parameter (see generic.xml in defaults folder) -->
   <!-- parameter name="tmp_folder" value="C:\tdriver\temp_folder"/ -->
   <parameter name="behaviours" value="behaviours.xml"/>
</parameters>

Run Testability server first
$ qttasserver&

To run tests on this source tree, make sure you run cmake & compile. Otherwise
tests will be run on the installed applications.

You run the entire Unity 2D test suite by executing the run-tests.rb script:
$ cd tests
$ ruby run-tests.rb

Consult tests/README for more details

Revision history for this message
Gerry Boland (gerboland) wrote :

Why Xdo?
- Best Ruby library I can find to control X. Emulates mouse & keyboard inputs, has basic clipboard support, and excellent abilities to control the window manager.
- Makes use of existing X test-applications (xdotool, xsel..)
- Easily extendible to support host & system-under-test separation (using @sut.execute_shell_command). Right now, it is required that we test on the host machine.

Why a copy in the tree?
- Rubygems are developer packages, we cannot depend on their stability
- As above, want to modify the library for our own needs. Good to push any fixes to original project however.

838. By Gerry Boland

Fix required packages and command in README

839. By Gerry Boland

Improve window ID detection. Passing gnome-terminal a (temporary) unique
directory to work from, which sets the window title to contain a known
string we can then reliably search for.

840. By Gerry Boland

Rebase with trunk

841. By Gerry Boland

Launcher is 65 pixels wide, not 66. Update test cases

842. By Gerry Boland

Open gnome-terminal in background for tests.

If no instance of gnome-terminal was running, the system call would block and hang the tests.

843. By Gerry Boland

Ensure binart_dir.txt generated in source directory

844. By Gerry Boland

Use WIDTH value in test comment

845. By Gerry Boland

Additional checks to ensure Launcher ready to be tested

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Just tested in my environment and everything is working fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches