Test::WWW::Selenium::Catalyst - Test your Catalyst application with Selenium
This is still a test release. It's working for me in production, but it depends on a Java application (SeleniumRC), which can be unreliable. On my Debian system, I had to put firefox-bin in my path, and add /usr/lib/firefox to LD_LIBRARY_PATH. Every distro and OS is different, so I'd like some feedback on how this works on your system. I would like to find a clean solution that lets this module "Just Work" for everyone, but I have a feeling that it's going to look more like if(gentoo){ ... } elsif (debian) { ... } and so on. I can live with that, but I need your help to get to that stage!
firefox-bin
/usr/lib/firefox
LD_LIBRARY_PATH
if(gentoo){ ... } elsif (debian) { ... }
Please report any problems to RT, the Catalyst mailing list, or the #catalyst IRC channel on irc.perl.org. Thanks!
use Test::WWW::Selenium::Catalyst 'MyApp'; use Test::More tests => 2; my $sel = Test::WWW::Selenium::Catalyst->start; $sel->open_ok('/'); $sel->is_text_present_ok('Welcome to MyApp');
This module starts the SeleniumRC server and your Catalyst app so that you can test it with SeleniumRC. Once you've called Test::WWW::Selenium::Catalyst->start, everything is just like Test::WWW::Selenium.
Test::WWW::Selenium::Catalyst->start
Starts the Selenium and Catalyst servers, and returns a pre-initialized, ready-to-use Test::WWW::Selenium object.
[NOTE] The selenium server is actually started when you use this module, and it's killed when your test exits.
use
Returns the process ID of the Selenium Server.
Returns the process ID of the Catalyst server.
Debugging messages are shown if CATALYST_DEBUG or MYAPP_DEBUG are set. MYAPP is the name of your application, uppercased. (This is the same syntax as Catalyst itself.)
CATALYST_DEBUG
MYAPP_DEBUG
MYAPP
You need to pass your Catalyst app's name as the argument to the use statement:
use Test::WWW::Selenium::Catalyst 'MyApp'
MyApp is the name of your Catalyst app.
MyApp
Selenium website: http://www.openqa.org/
Description of what you can do with the $sel object: Test::WWW::Selenium
$sel
If you don't need a real web browser: Test::WWW::Mechanize::Catalyst
Jonathan Rockway, <jrockway at cpan.org>
<jrockway at cpan.org>
Please report any bugs or feature requests to bug-test-www-selenium-catalyst at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-WWW-Selenium-Catalyst. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-test-www-selenium-catalyst at rt.cpan.org
Send me unified diffs against the git HEAD at:
git://git.jrock.us/Test-WWW-Selenium-Catalyst
You can view the repository online at
http://git.jrock.us/?p=Test-WWW-Selenium-Catalyst.git;a=summary
Thanks in advance for your contributions!
Thanks for mst for getting on my case to actually write this thing :)
Copyright 2006 Jonathan Rockway, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Test::WWW::Selenium::Catalyst, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::WWW::Selenium::Catalyst
CPAN shell
perl -MCPAN -e shell install Test::WWW::Selenium::Catalyst
For more information on module installation, please visit the detailed CPAN module installation guide.