Meego Wiki
Views

Quality/QA-tools/TDriver

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
Line 5: Line 5:
== Known Issues ==
== Known Issues ==
-
=== ImageMagick version ===
+
Builds require Qt 4.7. So these rpms will not work on base Fedora installations.
-
 
+
-
Imagemagick version in trunk won't work. You need a newer version from Trunk:Testing.
+
=== N900 Support ===  
=== N900 Support ===  
-
Current builds in devel:quality might not be compatible with the weekly builds due to Qt version changes. This issue should fix itself automatically during the following days/weeks.
+
Build 1.0.90.4.20100928.1 is tested to work.  
-
 
+
-
=== Complaints about log directory ===
+
-
 
+
-
The current version in devel has a but and it tries to create a directory to /etc/tdriver/logfiles. You need to create this directory.
+
-
 
+
== Overview ==
== Overview ==
Line 50: Line 43:
== Installation on MeeGo ==
== Installation on MeeGo ==
-
=== Repos ===
+
== Adding Packages Directly Into image ==
 +
 
 +
Currently packages are only in devel:quality. Ass the repository into the ks. file:
 +
<pre>
 +
repo --proxy=http://nokes.nokia.com:8080 --name=devel-quality-testing  --baseurl=http://download.meego.com/live/devel:/quality/testing/
 +
</pre>
 +
And add relevant packages:
 +
<pre>
 +
qttas-server-libs
 +
qttas-server
 +
qttas-server-plugins
 +
rubygem-testability-driver
 +
rubygem-testability-driver-qt-sut-plugin
 +
rubygem-cucumber
 +
</pre>
 +
=== Installation From Repos ===
Note! Repo locations will change as soon as the official location is decided.
Note! Repo locations will change as soon as the official location is decided.

Revision as of 11:50, 30 September 2010

Contents

Testability Driver (TDriver)

TDriver is a test automation driver enabling acceptance testing through the UI or using business logic directly. It is written in Ruby language and enables using any test framework written for Ruby.

Known Issues

Builds require Qt 4.7. So these rpms will not work on base Fedora installations.

N900 Support

Build 1.0.90.4.20100928.1 is tested to work.

Overview

TDriver contains few modules:

  • agent
  • driver
  • visualizer

Agent

TDriver has one agent for Qt based systems where Qt applications on any supported OS can be tested. The Qt agent is called qttasserver.

Agent is the only component that needs to be installed to the SUT. It will handle communication with the testing framework and applications. When Qt application starts it will load a testability plugin into the process. The plugin will register the application into qttasserver. Once the application is registered to qttasserver it can be controlled and queried from the testing framework.

If the application does not explicitly load the testability plugin, it can be started with -testability argument:

myapp -testability

That will cause the testability plugin to be loaded automatically.

Driver

Driver is the component that will provide the glue between test harness and SUT. You can install driver inside SUT or you can also use another host for driver that will connect to sut over tcp/ip.

TDriver is a ruby class libary which is packaged as a Ruby gem. Package 'rubygem-testability-driver' provides the core functionality and 'rubygem-testability-driver-qt-sut-plugin' provides the qt specific support.

Visualizer

Visualizer is a helper tool that provides access to UI components of the application. It will help testers to know what objects are contained and what is possible to do with them. You will see a SUT screenshot and an object tree containing all visible object. For Qt applications the objects are fetched from the object tree of the application registered to qttasserver. Visualizer also contains documentation and a small editor to help in scripting and debugging.

Installation on MeeGo

Adding Packages Directly Into image

Currently packages are only in devel:quality. Ass the repository into the ks. file:

repo --proxy=http://nokes.nokia.com:8080 --name=devel-quality-testing  --baseurl=http://download.meego.com/live/devel:/quality/testing/ 

And add relevant packages:

qttas-server-libs
qttas-server
qttas-server-plugins
rubygem-testability-driver
rubygem-testability-driver-qt-sut-plugin
rubygem-cucumber

Installation From Repos

Note! Repo locations will change as soon as the official location is decided.

First you will need to disable core repo and enable Trunk:Testing as they have some conflicting versions

sudo zypper rr core
sudo zypper ar http://download.meego.com/live/Trunk:/Testing/standard/Trunk:Testing.repo

Then you need to enable devel:quality repo as not all components are yet in Trunk:Testing

sudo zypper ar http://download.meego.com/live/devel:/quality/testing/devel:quality.repo

Note! The repo above contains development versions of quality tools. In the future this repo should not be used but while proper end locations are decided it is ok to use this repo. If you experience any problems with this repo please remove it with rr command

sudo zypper rr devel_quality

Installing agent to the target SUT

sudo zypper install qttas-server

This will install the agent. Once you reboot the first time the agent should start automatically. (TODO: This will be changed to lazy load later)

You can start the agent manually by typing:

qttasserver &


Installing driver

sudo zypper install rubygem-testability-driver-qt-sut-plugin

This will install the ruby gem for handling qt SUTs and all the dependencies like for example ruby interpreter it self.


Testing the installation

TDriver requires rubygems. Make sure you have rubygems defined in rubyopt:

 export RUBYOPT=rubygems

This will tell ruby to use gem packages.


You can test the installation using irb easily:

 [matti@matti-desktop tmp]$ irb
irb(main):001:0> require 'tdriver'
=> true
irb(main):002:0> 


You can also install our testapps and tests and try to run those

sudo zypper install testability-driver-tests
sudo zypper testability-driver-tests

And once installed you can launch the test script:

ruby /usr/share/testability-driver-tests/tc_testapp.rb

And the script will use app 'testapp' and test basic things like launching and closing app, tapping, dragging, flick etc.

Installing visualizer

You can install visualizer with a command

sudo zypper install testability-driver-visualizer

You can test visualizer by first making sure qttasserver is running and starting testapp (tdriver-testapp installed in the previous section)

qttasserver &
testapp &

Now make sure you have RUBYOPT set and sut_qt installed and start visualizer

export RUBYOPT=rubygems
sudo zypper install rubygem-testability-driver-qt-sut-plugin 
tdriver_visualizer &

Now you should see the visualizer app loading. Select sut_qt from device menu and select file -> refresh. You should now see screenshot of testapp and object tree which contains all visible objects from the application.

Enabling logs on the agent

In order to debug you can enable logs on the device. Just create a folder and give appropriate write access so that qttasserver and applications can write in there:

mkdir -p /logs/testability
sudo chmod a+w /logs/testability

Now if you restart qttasserver you will see a log file qttasserver.log being created. For each application loading testability plugin there will be also a file <application_name>.log

Personal tools