The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::WWW::Selenium::Conversion::IDE

VERSION

0.5

SYNOPSIS

****NOTE THIS IS IN ALPHA****

This module exports two functions to your test file, ide_to_TWS_run_from_suite_file and ide_to_TWS_run_from_test_file.

The objective is to run through Selenium IDE HTML files (Selenese) and run the tests as part of TAP in your perl test suite.

Rather than produce a perl test file which by itself can be run, this sits between a test file and the Selenese tests, converting on the fly, so you can just add more tests in as you get more user stories, and they will automatically run for you.

This uses Test::WWW::Selenium and tries hard to use close to equivalents to the IDE commands. I do not expect it to be perfect, but should perform fairly close to.

****ALPHA - not all IDE commands have yet been converted, expect updates - ALPHA****

DESCRIPTION

How to use

Follow instructions found to download and start the Selenium Server, and you should take into account what the selenium docs say about running this. You may also need a webserver to serve you a dev version of your website (if that is what you are wanting to test).

In your test file:

  use Test::More;
  use Test::WWW::Selenium;
  use Test::WWW::Selenium::Conversion::IDE;
  
  my $sel = Test::WWW::Selenium->new( {creds} ); # See documentation for Test::WWW::Selenium
  
  ide_to_TWS_run_from_suite_file( $sel, $suite_file_name, $location_of_sel_test_root );
  ide_to_TWS_run_from_test_file( $sel, {
    test_file => $test_file_name,
    sel_test_root => $location_of_sel_test_root,
  } );
  
  done_testing();

$location_of_sel_test_root is optional, it defaults to t/selenium_tests

The selenium_server object is left to you to do in your test file, as your credentials, the browser you want to use... may be different. There is no helper method for this.

You can also pass in an optional XML::LibXML parser if you have one built, either as the last arg to ide_to_TWS_run_from_suite_file or 'parser => $oParser' added to the args href to ide_to_TWS_run_from_test_file.

It is worth noting, that whilst there is a difference between verify and assert in the IDE, the Conversion treats them as equivalent. This is currently deliberate, or a feature, and is unlikely to be changed in the future - who wants their test suite to croak rather than report failures? Not me!

SUBROUTINES/METHODS

ide_to_TWS_run_from_suite_file

If you have a suite file in your selenium tests directory (default t/selenium_tests) then using this function will run all test files listed in the suite

  ide_to_TWS_run_from_suite_file( $oTestWWWSelenium, $suite_file_name );
  ide_to_TWS_run_from_suite_file( $oTestWWWSelenium, $suite_file_name, $selenium_test_directory_path);

ide_to_TWS_run_from_test_file

If you just want to run one Selenese HTML IDE test file, then use this method (again, default location is t/selenium_tests)

  ide_to_TWS_run_from_test_file( $oTestWWWSelenium, $test_file_name );
  ide_to_TWS_run_from_test_file( $oTestWWWSelenium, $test_file_name, $selenium_test_directory_path );

DIAGNOSTICS

CONFIGURATION AND ENVIRONMENT

DEPENDENCIES

strict
warnings
Carp
English -no_match_vars

INCOMPATIBILITIES

BUGS AND LIMITATIONS

As with any software, there is likely to be bugs (particularly whilst in alpha). Please feel free to report any you find.

The repository can be found

https://github.com/setitesuk/Test--WWW--Selenium--ide_to_TWS

AUTHOR

Author: Andy Brown (setitesuk@gmail.com)

LICENSE AND COPYRIGHT

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.