Meego Wiki
Views

Quality/QA-tools/TDriver

From MeeGo wiki
< Quality | QA-tools(Difference between revisions)
Jump to: navigation, search
(Installation on MeeGo Netbook)
 
(9 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].
-
Builds require Qt 4.7. So these rpms will not work on base Fedora installations.
+
==Overview==
-
=== N900 Support ===
+
TDriver consists of the following modules:
-
Build 1.0.90.4.20100928.1 is tested to work.
+
* [[#Agent|Agent]]
 +
* [[#Driver|Driver]]
 +
* [[#Visualizer|Visualizer]]
-
== Overview ==
+
===Agent===
-
TDriver contains few modules:
+
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
+
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.
-
* driver
+
-
* visualizer
+
-
=== Agent ===
+
MeeGo touch applications will automatically load the testability plugin. If your application is a standard Qt application, use the "-testability" argument:
-
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>
-
 
+
myapp -testability
-
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.
+
</pre>
-
 
+
-
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 37: 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==
-
== Adding Packages Directly Into image ==
+
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.
-
Currently packages are only in devel:quality. Ass the repository into the ks. file:
+
===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
<pre>
<pre>
-
repo --name=devel-quality-testing  --baseurl=http://download.meego.com/live/devel:/quality/testing/
+
sudo zypper install qttas-server
</pre>
</pre>
-
And add relevant packages:
+
 
 +
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:
<pre>
<pre>
-
qttas-server-libs
+
qttasserver &
-
qttas-server
+
-
qttas-server-plugins
+
-
rubygem-testability-driver
+
-
rubygem-testability-driver-qt-sut-plugin
+
-
rubygem-cucumber
+
</pre>
</pre>
-
=== Installation From Repos ===
 
-
Note! Repo locations will change as soon as the official location is decided.
+
''' Note - qttasserver should always be run with the same user as the applications, e.g. meego '''
-
First you will need to disable core repo and enable Trunk:Testing as they have some conflicting versions
+
===Adding Everything On The Image===
-
sudo zypper rr core
+
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:
-
  sudo zypper ar http://download.meego.com/live/Trunk:/Testing/standard/Trunk:Testing.repo
+
<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>
-
Then you need to enable devel:quality repo as not all components are yet in Trunk:Testing
+
Package rubygem-cucumber is also available if you have [http://cukes.info Cucumber] tests.
-
sudo zypper ar http://download.meego.com/live/devel:/quality/testing/devel:quality.repo
+
===Installation on MeeGo Netbook===
-
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
+
You need to enable devel:quality repo as not all components in Trunk:Testing
-
 
+
<pre>
-
sudo zypper rr devel_quality
+
sudo zypper ar http://download.meego.com/live/devel:/quality/testing/ devel:quality.repo
-
 
+
sudo zypper update
-
=== Installing Agent To The Target SUT ===
+
</pre>
-
 
+
-
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:
+
 +
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 111: 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 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)
+
 +
<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 rubygem-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 ==

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