From: Chris Nehren Date: Fri, 15 Apr 2011 06:54:43 +0000 (-0400) Subject: Many fixes. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f44efefae5c0b872c731eb5d3f1099b6c99048a;p=scpubgit%2FTest-Harness-Selenium.git Many fixes. Remove obsolete tests. Fix app server starting. Fix catapp.t to use the new system. Fix the remaining test corpus files to use relative URLs where appropriate. --- diff --git a/lib/Test/Harness/Selenium.pm b/lib/Test/Harness/Selenium.pm index 4b6cf60..dc4d936 100644 --- a/lib/Test/Harness/Selenium.pm +++ b/lib/Test/Harness/Selenium.pm @@ -80,7 +80,8 @@ sub start_selenium_server { last; } } - die "timed out waiting for selenium server to start" if $tries == 5; + die "timed out waiting for selenium server to start at + http://$self->{selenium_rc}{host}:$self->{selenium_rc}{port}" if $tries == 5; } sub stop_selenium_server { @@ -108,6 +109,9 @@ sub stop_app_server { sub test_directory { my ($self, $dir) = @_; + if(!exists $self->{app_server_proc}) { + $self->start_app_server; + } if($self->{selenium_rc}{start} && !$self->{selenium_rc}{selenium_server_proc}) { $self->start_selenium_server; } diff --git a/t/catapp.t b/t/catapp.t index eaa4425..ee9e631 100644 --- a/t/catapp.t +++ b/t/catapp.t @@ -7,13 +7,16 @@ use Test::Harness::Selenium; use Test::More; my $browser = shift; -my $s = Test::Harness::Selenium->new({ - host => 'localhost', - port => $< + 60_000, - browser_url => 'http://127.0.0.1:3000', - browser => $browser, -}); -$s->start_server; -$s->run_tests_for('t/corpus/thselenium.html'); -$s->stop_server; +my $s = Test::Harness::Selenium->new( + selenium_rc => { + host => '10.0.0.8', + port => $< + 6900, + start => 1, + xvnc_display => 1, + }, + app_base => 'http://10.0.0.5:3000', + app_server_cmd => 'examples/THSelenium-Test/script/thselenium_test_server.pl', + browser => '*firefox', +); +$s->test_directory('t/corpus/'); done_testing; diff --git a/t/corpus/basic.html b/t/corpus/basic.html deleted file mode 100644 index 28e8497..0000000 --- a/t/corpus/basic.html +++ /dev/null @@ -1,31 +0,0 @@ - - - ----- - - - - - - - - - - - - - - - - - - - - -
open/ 
typeqselenium rc
clickAndWaitbtnG 
textLikeSearches related to selenium rc 
- - diff --git a/t/corpus/no_delay.html b/t/corpus/no_delay.html deleted file mode 100644 index 8e74511..0000000 --- a/t/corpus/no_delay.html +++ /dev/null @@ -1,27 +0,0 @@ - - - ----- - - - - - - - - - - - - - - - - -
open/ 
typeqselenium rc
textLikeSearches related to rc 
- - diff --git a/t/corpus/thselenium.html b/t/corpus/thselenium.html index 2eabc2f..e584e0e 100644 --- a/t/corpus/thselenium.html +++ b/t/corpus/thselenium.html @@ -3,7 +3,6 @@ - thselenium @@ -28,7 +27,7 @@ clickAndWait - //a[@href='http://127.0.0.1:3000/echo'] + //a[@href='/echo'] diff --git a/t/corpus/thseleniumpass.html b/t/corpus/thseleniumpass.html index 221bc8d..8249749 100644 --- a/t/corpus/thseleniumpass.html +++ b/t/corpus/thseleniumpass.html @@ -3,7 +3,6 @@ - thseleniumpass