Meego Wiki
Views

Quality/QA-tools/QmlUITestlib

From MeeGo wiki
< Quality | QA-tools
Revision as of 13:56, 31 May 2011 by Shaofeng (Talk | contribs)
Jump to: navigation, search

Contents

MeeGo QML UI Testlib

Overview

MeeGo QML UI Testlib is an open tool for testing against MeeGo QML GUI application automatically. The test framework is based on "TDriver", and provide a set of pre-defined cucumber steps for designer to prepare test cases with natural language. Also BAT and L10N test cases of MeeGo QML UI applications are involved in Testlib.

Architecture

Testlib architecture.png

BAT and L10N Test cases and a pre-defined library, in which many Cucumber steps are involved for covering all actions on MeeGo QML UI applications, are included in this Testlib.

Installation

This tool is based on cucumber and TDriver. Make sure if TDriver and cucumber already work well on your machine.

Verifying if TDriver works well:

$> tdriver_visualizer &

Check if visualizer could connect to device via sut_qt.

Verifying if Cucumber works well

$> cucumber --help

For TDriver installation, please refer to Quality/QA-tools/TDriver#Installation. For cucumber, please refer to Cucumber Home site

For downloading this tools, just run "git clone ssh://..."(The git project is still under preparing)

Usage

Run existing test cases

Some BAT test cases are also provided for MeeGo applications. For running them, follow below steps:

$> cd <Testlib_HOME>

$> cucumber

Prepare your own scenarios (test cases)

Besides running the existed test cases, you can also define your own scenario (test cases) using the predefined cucumber steps.

For instance, you can define a new test cases for verifying if MeeGo browser can access a new web site (for instance, Amazon).

 Scenario: Check if browser works for Amazon
   Given I launch meego browser
   And I sleep "5" second
   And I input "www.amazon.com" into "urlTextInput"
   And I sleep "5" second
   Then In meego browser, I should see "Amazon"
   And In meego browser, I should see "Sign in"

Test Result

Beside the result of cucumber scripts, snapshot will be captured automatically to help QA and developer to investigate what happen when the verification failed. And the snapshot is named as

xxxx_xxxxx.png

First part is the name of the testing application, such as email, im, browser Second part is a short description of the failed verification.

For instance, when the device isn't connected with internet, the test case "setting up email account" will fail. Then below snapshot will be captured automatically to help investigating this failure.

Email email account error result.png

Dependency

Because the cucumber steps of testlib are designed based on the attribute "QML_ID" of QML widget, the patch "[Add public method to allow users to retrieve id string from object in a given context]" should be applied in the package "libqtdeclarative4" and "libqt-devel". We recommend you merge this patch and re-build the qt-related package for yourself. Only if there are some problems to apply this patch, a temporary repository is available as a reference. Follow below steps to update the qt-related packages

$> cd /etc/zypp/repo.d/

$> wget http://download.meego.com/live/home:/cathysh/Trunk_Testing_standard/home:cathysh.repo

$> sudo zypper up

$> sudo zypper in libqt-devel

How to check if the patch is installed in your device.

$> vi /usr/include/qt4/QtDeclarative/qdeclarativecontext.h

In 91 lines, below method should be announced.

     QString getStringId(const QObject *) const;

For enabling the "QML_ID" patch on TDriver side, the package agent_qt should also be re-compiled.

$> git clone git://gitorious.org/tdriver/agent_qt.git

$> sudo zypper in libqtwebkit-devel libXtst-devel libX11-devel libXext-devel libXi-devel

$> qmake -r CONFIG+=no_mobility CONFIG+=qml_id

$> make

$> sudo make install


Below is the updated package list:

libqt-devel-4.7.2-8.18.i586.rpm

libqtcore4-4.7.2-8.18.i586.rpm

libqtdbus4-4.7.2-8.18.i586.rpm

libqtdeclarative4-4.7.2-8.18.i586.rpm

libqtdeclarative4-folderlistmodel-4.7.2-8.18.i586.rpm

libqtdeclarative4-gestures-4.7.2-8.18.i586.rpm

libqtdeclarative4-particles-4.7.2-8.18.i586.rpm

libqtdesigner4-4.7.2-8.18.i586.rpm

libqtgui4-4.7.2-8.18.i586.rpm

libqthelp4-4.7.2-8.18.i586.rpm

libqtnetwork4-4.7.2-8.18.i586.rpm

libqtopengl-devel-4.7.2-8.18.i586.rpm

libqtopengl4-4.7.2-8.18.i586.rpm

libqtscript4-4.7.2-8.18.i586.rpm

libqtscripttools4-4.7.2-8.18.i586.rpm

libqtsql4-4.7.2-8.18.i586.rpm

libqtsql4-sqlite-4.7.2-8.18.i586.rpm

libqtsvg4-4.7.2-8.18.i586.rpm

libqttest4-4.7.2-8.18.i586.rpm

libqtxml4-4.7.2-8.18.i586.rpm

libqtxmlpatterns4-4.7.2-8.18.i586.rpm

qt-debuginfo-4.7.2-8.18.i586.rpm

qt-demos-4.7.2-8.18.i586.rpm

qt-designer-4.7.2-8.18.i586.rpm

qt-devel-tools-4.7.2-8.18.i586.rpm

qt-qmake-4.7.2-8.18.i586.rpm

qt-qmlviewer-4.7.2-8.18.i586.rpm

Personal tools