Difference between revisions of "KWWidgets/GUI Testing/Squish"

From KitwarePublic
Jump to navigationJump to search
Line 50: Line 50:
In this section, we will exercise KWWidgets' KWCallbacksExample example.
In this section, we will exercise KWWidgets' KWCallbacksExample example.


* If you are new to Squish you may want to read: [http://www.froglogic.com/download/book/tgsc-concepts.html Squish Concepts], . The Squish for Tk documentation is located offline in your build directory at <tt>squish-3.4.1-eval-tk-src/doc/book/index.html</tt>, or online at [http://www.froglogic.com/download/book/ http://www.froglogic.com/download/book/].  
* If you are new to Squish you may want to read: [http://www.froglogic.com/download/book/tgsc-concepts.html Squish Concepts], [http://www.froglogic.com/download/book/tgs-firsttest-tk.html Creating the First Test]. The Squish for Tk documentation is located offline in your build directory at <tt>squish-3.4.1-eval-tk-src/doc/book/index.html</tt>, or online at [http://www.froglogic.com/download/book/ http://www.froglogic.com/download/book/].  
* Build KWWidgets examples (make sure KWWidgets_BUILD_EXAMPLES is set to ON), make sure the  <tt>./bin/KWCallbacksExample</tt> example has been built and is working properly.
* Build KWWidgets examples (make sure KWWidgets_BUILD_EXAMPLES is set to ON), make sure the  <tt>./bin/KWCallbacksExample</tt> example has been built and is working properly.
* Start the Squish IDE
* Start the Squish IDE
Line 57: Line 57:
</pre>
</pre>
* Create a new Test Suite
* Create a new Test Suite
** Select "Create New Test Suite" at the Welcome page.
** Select "[http://www.froglogic.com/download/book/tgs-firsttest-tk.html Create New Test Suite]" at the Welcome page.
** Enter a Suite Name (say <tt>kwcallbacksexample</tt>). Select where the test suite and its files shall be saved (say <tt>~/tmp/kww_test/</tt>). Hit "Next".
** Enter a Suite Name (say <tt>kwcallbacksexample</tt>). Select where the test suite and its files shall be saved (say <tt>~/tmp/kww_test/</tt>). Hit "Next".
** Specify here which toolkit the application is using. KWWidgets uses Tcl/Tk under the hood, therefore select the Tk radiobutton. Hit "Next". NOTE: this page will *only* show up if Squish was built to support *several* toolkits; if only one toolkit is available (hopefully, Tk), this page will not be displayed and this single toolkit will be picked automatically.
** Select Tcl as the scripting language (if it isn't available, Squish was not able to find or use your Tcl/Tk distribution at build time). Hit "Next".
** Select Tcl as the scripting language (if it isn't available, Squish was not able to find or use your Tcl/Tk distribution at build time). Hit "Next".
** Select the Application Under Test (AUT): pick the the <tt>./bin/KWCallbacksExample</tt> application found in your KWWidgets build tree. Hit "Finish".
** Select the Application Under Test (AUT): pick the the <tt>./bin/KWCallbacksExample</tt> application found in your KWWidgets build tree. Again, even though we are using Squish for Tk, we are actually exercising a KWWidgets *binary application*, not a Tcl/Tk *script*. Hit "Finish".
[[Image:KWWSquishTkCreateNewTestSuite.png|200px|center|New Test Suite]]
* Create a new Test Case
** Select "Create New Test Case" or right click on <tt>suite_kwcallbacksexample</tt> in the left tree and select "New Test Case...". Name it, say, <tt>Test1</tt>. This should create the <tt>test.tcl</tt> file in your test suite directory, where the testing script itself for this specific case will be saved.
{| class="wikitable" style="margin: 1em auto 1em auto"
|-
| [[Image:KWWSquishTkCreateNewTestSuite.png|thumb|left|200px|New Test Suite]] || [[Image:KWWSquishTkCreateNewTestCase.png|thumb|left|200px|New Test Case]]
|}


==Issues==
==Issues==

Revision as of 18:34, 6 November 2008

Squish

  • Squish Home
  • Squish for Tk, only for Unix
  • about €2500
  • Win32/Qt/Java/Web/Tk, scripting in Tcl/Python/JavaScript/Perl, recorder, window inspector, breakpoints/verification

Prerequisites

  • Qt3. Squish for Tk will not work with Qt4. Make sure you install all Qt3 development packages. On a Ubuntu OS, this (most likely) involve: libqt3-headers, libqt3-mt, libqt3-mt-dev, qt3-apps-dev, qt3-assistant, qt3-designer, qt3-dev-tools, qt3-linguist, qt3-qtconfig, etc.
  • Tcl/Tk 8.4 or 8.5

Download

-rwxr--r-- 1 barre barre 6587889 2008-09-04 13:08 squish-3.4.1-eval-tk-src.tar.gz*
-rwxr--r-- 1 barre barre      19 2008-09-04 13:08 squish-3-license*

Installation

barre@tetsuo:~/build$ tar -xzf /home/barre/tmp/squish/squish-3.4.1-eval-tk-src.tar.gz 
  • Configure Squish
barre@tetsuo:~/build$ cd squish-3.4.1-eval-tk-src
barre@tetsuo:~/build/squish-3.4.1-eval-tk-src$ ./configure "--with-qtdir=/usr/share/qt3" "--with-tclconfig=/opt/tcltk8.5.2/lib/tclConfig.sh" "--with-tkconfig=/opt/tcltk8.5.2/lib/tkConfig.sh" 

Note that the configure script may not find your Qt3 distribution correctly: use --with-qtdir to point to the appropriate directory. Use --with-tclconfig and --with-tkconfig to point to your own Tcl/Tk distribution, if any (here /opt/tcltk8.5.2)

  • Enter your license key (found in squish-3-license)
Configuring Squish. For license information please read the LICENSE file.
By configuring and building Squish you are accepting the terms of this license.
Enter license key: ***-*****-*****-***
Checking for C++ compiler ......... g++
Checking for g++'s version ......... 4
[...]
Done with configuring. Full log in config.log. Now type './build'.
* Build
<pre>
barre@tetsuo:~/build/squish-3.4.1-eval-tk-src$ ./build

Testing

In this section, we will exercise KWWidgets' KWCallbacksExample example.

  • If you are new to Squish you may want to read: Squish Concepts, Creating the First Test. The Squish for Tk documentation is located offline in your build directory at squish-3.4.1-eval-tk-src/doc/book/index.html, or online at http://www.froglogic.com/download/book/.
  • Build KWWidgets examples (make sure KWWidgets_BUILD_EXAMPLES is set to ON), make sure the ./bin/KWCallbacksExample example has been built and is working properly.
  • Start the Squish IDE
barre@tetsuo:~/build/squish-3.4.1-eval-tk-src$ ./bin/squish
  • Create a new Test Suite
    • Select "Create New Test Suite" at the Welcome page.
    • Enter a Suite Name (say kwcallbacksexample). Select where the test suite and its files shall be saved (say ~/tmp/kww_test/). Hit "Next".
    • Specify here which toolkit the application is using. KWWidgets uses Tcl/Tk under the hood, therefore select the Tk radiobutton. Hit "Next". NOTE: this page will *only* show up if Squish was built to support *several* toolkits; if only one toolkit is available (hopefully, Tk), this page will not be displayed and this single toolkit will be picked automatically.
    • Select Tcl as the scripting language (if it isn't available, Squish was not able to find or use your Tcl/Tk distribution at build time). Hit "Next".
    • Select the Application Under Test (AUT): pick the the ./bin/KWCallbacksExample application found in your KWWidgets build tree. Again, even though we are using Squish for Tk, we are actually exercising a KWWidgets *binary application*, not a Tcl/Tk *script*. Hit "Finish".
  • Create a new Test Case
    • Select "Create New Test Case" or right click on suite_kwcallbacksexample in the left tree and select "New Test Case...". Name it, say, Test1. This should create the test.tcl file in your test suite directory, where the testing script itself for this specific case will be saved.
New Test Suite
New Test Case

Issues

  • Can't find Qt
Checking Qt version ......... 
Can't find Qt includes in /usr/include and /usr/src

=> Make sure you installed Qt3

  • New Test Suite: Scripting Language, No Tcl

If the Tcl option is not available in the Scripting Language page when creating a new Test Suite, then Squish was not build with proper Tcl support. Make sure you specified the path to your Tcl/Tk distribution and re-build.

Template:KWWidgets/Template/Footer