Meego Wiki
Views

Quality/QA-tools/TDriver

From MeeGo wiki
< Quality | QA-tools(Difference between revisions)
Jump to: navigation, search
(Installation on MeeGo Netbook)
 
(19 intermediate revisions not shown)
Line 1: Line 1:
-
== Testability Driver (TDriver) ==
+
=Testability Driver (TDriver)=
 +
 
 +
New to TDriver? [https://projects.forum.nokia.com/Testabilitydriver/wiki/introduction_to_tdriver Look for an introduction to TDriver] from Forum Nokia web site.
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.
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 ==
+
For a sample test run, see [http://www.youtube.com/watch?v=UL0XmcPKAp8 TDriver in action]. The cucumber tests in the example can be found from [http://gitorious.org/tdriver/tests/trees/master/examples/MeeGo/N900/cucumber/features here].
-
=== ImageMagick is available but does not work ===
+
==Overview==
-
Need to investigate why rmagick does not work with ImageMagick 6.6
+
TDriver consists of the following modules:
-
=== Cucumber not yet published in devel:quality ===
+
* [[#Agent|Agent]]
 +
* [[#Driver|Driver]]
 +
* [[#Visualizer|Visualizer]]
-
Already building in home repo. Will copy over to devel:quality soon
+
===Agent===
-
== Overview ==
+
TDriver has one agent for Qt based systems where Qt applications on any supported OS can be tested. The Qt agent is called qttasserver.
-
TDriver contains few modules:
+
Agent (qttas-server) is the only component that needs to be installed to the SUT (system under test). It will handle communication with the testing framework and applications. When Qt application starts it will load a testability plugin into the application 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.
-
* agent
+
MeeGo touch applications will automatically load the testability plugin. If your application is a standard Qt application, use the "-testability" argument:
-
* driver
+
-
* visualizer
+
-
=== Agent ===
+
<pre>
-
 
+
myapp -testability
-
TDriver has one agent for Qt based systems where Qt applications on any supported OS can be tested. The Qt agent is called qttasserver.
+
</pre>
-
 
+
-
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.
That will cause the testability plugin to be loaded automatically.
-
=== Driver ===
+
===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.
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.
Line 39: Line 35:
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.
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===
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.
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 ==
+
==Installation==
-
=== Repos ===
+
On a typical test automation setup, tests are executed on the host. See the [[Quality/QA-tools/TDriver/Getting Started|Getting Started Guide]] for host based installation. If you are going to install TDriver on MeeGo netbook, see the [[#Installation on MeeGo Netbook|Installation on MeeGo Netbook]] section.
-
Note! Repo locations will change as soon as the official location is decided.
+
===Adding Agent On The Target Device===
-
First you will need to disable core repo and enable Trunk:Testing as they have some conflicting versions
+
On host based testing, the only required package for the image is the qttas-server. Add this package to your ks. file if you want it into your image.
-
sudo zypper rr core
+
On a preexisting image, you can add it by
-
sudo zypper ar http://download.meego.com/live/Trunk:/Testing/standard/Trunk:Testing.repo
+
<pre>
 +
sudo zypper install qttas-server
 +
</pre>
-
Then you need to enable devel:quality repo as not all components are yet in Trunk:Testing
+
This will install the agent. Once you reboot the agent should start automatically.
-
sudo zypper ar http://download.meego.com/live/devel:/quality/testing/devel:quality.repo
+
If you do not reboot the device, you can start the agent manually by:
 +
<pre>
 +
qttasserver &
 +
</pre>
-
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
+
''' Note - qttasserver should always be run with the same user as the applications, e.g. meego '''
-
sudo zypper rr devel_quality
+
===Adding Everything On The Image===
-
=== Installing agent to the target SUT ===
+
You can also run the entire testability driver on the device. Currently packages are only in devel:quality. Add the devel:quality repository into the ks. file:
 +
<pre>
 +
repo --name=devel-quality-testing  --baseurl=http://download.meego.com/live/devel:/quality/testing/
 +
</pre>
 +
And add the meta package:
 +
<pre>
 +
testability-driver
 +
</pre>
-
sudo zypper install qttas-server
+
Package rubygem-cucumber is also available if you have [http://cukes.info Cucumber] tests.
-
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)
+
===Installation on MeeGo Netbook===
-
You can start the agent manually by typing:
+
You need to enable devel:quality repo as not all components in Trunk:Testing
-
 
+
<pre>
-
qttasserver &
+
sudo zypper ar http://download.meego.com/live/devel:/quality/testing/ devel:quality.repo
-
 
+
sudo zypper update
-
 
+
</pre>
-
=== 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:
+
 +
To install all required packages install the testability-driver and visualizer packages. But lets install the tests package so we can easily test the installation:
<pre>
<pre>
-
export RUBYOPT=rubygems
+
sudo zypper install testability-driver-tests testability-driver-visualizer
</pre>
</pre>
-
This will tell ruby to use gem packages.
 
-
 
-
You can test the installation using irb easily:
+
You can test the installation using irb:
<pre> [matti@matti-desktop tmp]$ irb
<pre> [matti@matti-desktop tmp]$ irb
Line 98: Line 95:
-
You can also install our testapps and tests and try to run those
+
To test the visualizer, make sure qttasserver is running and start testapp:
-
 
+
-
sudo zypper install tdriver-testapp
+
-
sudo zypper testability-driver-tests
+
-
 
+
-
And once installed you can launch the test script:
+
-
 
+
-
ruby /usr/share/testability-driver-unit-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 tdriver-visualizer
+
-
 
+
-
You can test visualizer by first making sure qttasserver is running and starting testapp (tdriver-testapp installed in the previous section)
+
 +
<pre>
  qttasserver &
  qttasserver &
  testapp &
  testapp &
 +
</pre>
-
Now make sure you have RUBYOPT set and sut_qt installed and start visualizer
+
Now make sure you have RUBYOPT set and start visualizer:
-
 
+
<pre>
  export RUBYOPT=rubygems
  export RUBYOPT=rubygems
-
sudo zypper install testability-driver-qt-sut-plugin
 
  tdriver_visualizer &
  tdriver_visualizer &
 +
</pre>
 +
 +
Now you should see the visualizer application. 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.
 +
 +
You can also try to run our unit tests to see that automated tests work:
 +
<pre>
 +
ruby /usr/share/testability-driver-tests/tc_testapp.rb
 +
</pre>
-
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.
+
And the script will use the app 'testapp' to test basic things like launching and closing app, tapping, dragging, flick etc.
-
== Enabling logs on the agent ==
+
== 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:
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:

Latest revision as of 07:16, 8 December 2010

Contents

Testability Driver (TDriver)

New to TDriver? Look for an introduction to TDriver from Forum Nokia web site.

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.

For a sample test run, see TDriver in action. The cucumber tests in the example can be found from here.

Overview

TDriver consists of the following modules:

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 (qttas-server) is the only component that needs to be installed to the SUT (system under test). It will handle communication with the testing framework and applications. When Qt application starts it will load a testability plugin into the application 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.

MeeGo touch applications will automatically load the testability plugin. If your application is a standard Qt application, use the "-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 a typical test automation setup, tests are executed on the host. See the Getting Started Guide for host based installation. If you are going to install TDriver on MeeGo netbook, see the Installation on MeeGo Netbook section.

Adding Agent On The Target Device

On host based testing, the only required package for the image is the qttas-server. Add this package to your ks. file if you want it into your image.

On a preexisting image, you can add it by

sudo zypper install qttas-server

This will install the agent. Once you reboot the agent should start automatically.

If you do not reboot the device, you can start the agent manually by:

qttasserver &

Note - qttasserver should always be run with the same user as the applications, e.g. meego

Adding Everything On The Image

You can also run the entire testability driver on the device. Currently packages are only in devel:quality. Add the devel:quality repository into the ks. file:

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

And add the meta package:

testability-driver

Package rubygem-cucumber is also available if you have Cucumber tests.

Installation on MeeGo Netbook

You need to enable devel:quality repo as not all components in Trunk:Testing

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

To install all required packages install the testability-driver and visualizer packages. But lets install the tests package so we can easily test the installation:

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

You can test the installation using irb:

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


To test the visualizer, make sure qttasserver is running and start testapp:

 qttasserver &
 testapp &

Now make sure you have RUBYOPT set and start visualizer:

 export RUBYOPT=rubygems
 tdriver_visualizer &

Now you should see the visualizer application. 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.

You can also try to run our unit tests to see that automated tests work:

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

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

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