Bugzilla:QA: Difference between revisions

Line 14: Line 14:


==== Scripts called by a Perl program ====
==== Scripts called by a Perl program ====
The installation and configuration are a bit harder. First download and install [http://search.cpan.org/~mbarbon/Test-WWW-Selenium/ Test::WWW::Selenium] as well as all its required modules:
The installation and configuration are a bit harder. First download and install [http://search.cpan.org/~lukec/Test-WWW-Selenium/ Test::WWW::Selenium]. In case you still use version 0.03, the following modules are required too:


requires:
requires:
Line 29: Line 29:
   Test::More v0.47
   Test::More v0.47


When all these modules are installed, you will also need the SeleniumTest.pm module available in [https://bugzilla.mozilla.org/show_bug.cgi?id=317695 bug 317695] which is a simplified version of the one given with the Test-WWW-Selenium tarball. An example of a test script is also provided (012qa.t), which can e.g. be executed with runtests.pl, a Perl script available in the Bugzilla distribution.
When all these modules are installed, you will also need the SeleniumTest.pm module available in [https://bugzilla.mozilla.org/show_bug.cgi?id=317695 bug 317695] which is a simplified version of the one given with the Test-WWW-Selenium tarball. An example of a test script - 012qa.t - is also provided, which can e.g. be executed with runtests.pl, a Perl script available in the Bugzilla distribution.


As you can see, the syntax is different, but the commands remain mostly the same. Make sure to end all your commands by "_ok" to generate an output on your screen. The format is now $test->command_name_ok('field', 'value', 'description'), where $test is the test object created by SeleniumTest.pm and which will do the interface between your test script and the web installation.
For newer versions of Test::WWW::Selenium, requirements are different and SeleniumTest.pm is no longer required. Note that your old scripts running on 0.03 won't run on newer versions anymore.
 
As you can see, the syntax is different between HTML and Perl scripts, but the commands remain mostly the same. Make sure to end all your commands by "_ok" to generate an output on your screen. The format is now $test->command_name_ok('field', 'value', 'description'), where $test is the test object created by SeleniumTest.pm and which will do the interface between your test script and the web installation.


The description is optional, but gives very useful information. A typical output is of the form:
The description is optional, but gives very useful information. A typical output is of the form:
Confirmed users
683

edits