Skip to content

Commit

Permalink
Use block eval for loading test module.
Browse files Browse the repository at this point in the history
The string eval form was generating
"more than one test plan" messages.
  • Loading branch information
mateu committed Sep 27, 2009
1 parent e589208 commit 0e6903f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions t/selenium.t
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#!/usr/bin/perl -w
use Test::More;

# This test requires that the selenium server be running.
# The selenium server is a java application that can be started like:
# This test requires that a Selenium server be running. A Selenium server
# is included in Alien::SeleniumRC which is a dependency of
# Test::WWW::Selenium::Catalyst so having it installed should be
# sufficient to run this test.
#
# The selenium server is a java application that can also be started like:
# java -jar selenium-server.jar
# See http://seleniumhq.org/ for the download of selenium server, remote control
# See http://seleniumhq.org/ for the download of Selenium Remote Control (RC)
# which includes a selenium server.

$ENV{MOJOMOJO_CONFIG} = 't/app/mojomojo.yml';
eval "use Test::WWW::Selenium::Catalyst 'MojoMojo'";
plan skip_all => 'need Test::WWW::Selenium::Catalyst' if $@;
eval { use Test::WWW::Selenium::Catalyst 'MojoMojo'; };
plan skip_all => 'Need: Test::WWW::Selenium::Catalyst' if $@;
plan tests => 22;

my $sel = Test::WWW::Selenium::Catalyst->start;
Expand All @@ -28,9 +33,11 @@ $sel->type_ok( "pass", "admin" );
$sel->click_ok("//input[\@value='Login']");
$sel->wait_for_page_to_load_ok("15000");
$sel->is_text_present_ok("admin");

# Check that .recent was not cached.
$sel->open_ok(".recent");
$sel->is_text_present_ok("Log out");

# Check that profile was no cached.
$sel->open_ok("admin.profile");
$sel->is_text_present_ok("Log out");
Expand Down

0 comments on commit 0e6903f

Please sign in to comment.