Revision history for Test-WWW-Selenium-Catalyst
-0.04 4 Marh 2009
- Un-fark the dist so that the thing installs
+0.05 - 2009/03/07
+ - Use IPC::Cmd::can_run in tests to not have so many spurious failues due to
+ no smoke rigs having java installed
-0.03 4 March 2009
- Allow a bit more configurability in selenium invocation and app
- location
+0.04 - 2009/03/05
+ - Un-fark the dist so that the thing installs
-0.02 6 March 2008
- Don't call $sel->start; this breaks stuff
+0.03 - 2009/03/04
+ - Allow a bit more configurability in selenium invocation and app
+ location
-0.01 27 May 2007
- Mostly the same... released for wider testing.
+0.02 - 2008/03/06
+ - Don't call $sel->start; this breaks stuff
-0.00_01 19 September 2006
- First version, released on an unsuspecting world.
+0.01 - 2007/05/27
+ - Mostly the same... released for wider testing.
+
+0.00_01 - 2006/09/19
+ - First version, released on an unsuspecting world.
# 01-live.t
# Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>
-use Test::More tests => 79;
+use Test::More tests => 80;
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::WWW::Selenium::Catalyst 'TestApp',
- -selenium_args => '-singleWindow';
-
-diag("You need to have firefox-bin in your path for this to work!");
-
-my $sel = Test::WWW::Selenium::Catalyst->start({browser => '*firefox'});
-
-$sel->open_ok('/');
-$sel->text_is("link=Click here", "Click here");
-$sel->click_ok("link=Click here");
-$sel->wait_for_page_to_load_ok("30000", 'wait');
-for my $i (1..10){
- $sel->open_ok("/words/$i");
- $sel->is_text_present_ok(
- qq{Here you'll find all things "words" printed $i time(s)!});
-
- for my $j (1..$i){
- $sel->is_text_present_ok("$j: foo bar baz bat qux quux");
+
+use IPC::Cmd qw/can_run/;
+
+my $have_apps =
+ can_run('java') &&
+ ( can_run('firefox') || can_run('firefox-bin') );
+
+SKIP: {
+ unless ($have_apps) {
+ # Missing Java or firefox, just do a use_ok test
+ use_ok('Test::WWW::Selenium::Catalyst', 'TestApp',
+ -no_selenium_server => 1);
+ skip "java and firefox requires for further testing", 79;
+ } else {
+ diag("You need to have firefox(-bin) in your path for this to work!");
+
+ my $port = int(20000+rand()*20000);
+ # Try to cope with case when selenium is already running or something is on port 4444
+ my $sel = eval {
+
+ use_ok('Test::WWW::Selenium::Catalyst', 'TestApp',
+ -selenium_args => "-singleWindow -port $port");
+
+ Test::WWW::Selenium::Catalyst->start( {
+ browser => '*firefox',
+ selenium_port => $port
+ } );
+ };
+
+ skip $@, 80 if $@;
+
+ $sel->open_ok('/');
+ $sel->text_is("link=Click here", "Click here");
+ $sel->click_ok("link=Click here");
+ $sel->wait_for_page_to_load_ok("30000", 'wait');
+ for my $i (1..10){
+ $sel->open_ok("/words/$i");
+ $sel->is_text_present_ok(
+ qq{Here you'll find all things "words" printed $i time(s)!});
+
+ for my $j (1..$i){
+ $sel->is_text_present_ok("$j: foo bar baz bat qux quux");
+ }
}
+ }
}