make all selenium tests work with chromium and htmlunit

selenium tests are now working with: firefox, chrome, htmlunit, phantomjs
agranig/1_0_subfix
Gerhard Jungwirth 12 years ago
parent 0b72c2dc42
commit 1f2d8b7542

@ -3,8 +3,12 @@ use lib 't/lib';
use Test::More import => [qw(done_testing is)];
use Test::WebDriver::Sipwise qw();
my $d = Test::WebDriver::Sipwise->new;
$d->get($ENV{CATALYST_SERVER});
my $browsername = $ENV{BROWSER_NAME} || ""; #possible values: htmlunit, chrome
my $d = Test::WebDriver::Sipwise->new (browser_name => $browsername,
'proxy' => {'proxyType' => 'system'});
my $uri = $ENV{CATALYST_SERVER} || 'http://localhost:3000';
$d->get_ok("$uri/logout"); #make sure we are logged out
$d->get_ok("$uri/login");
$d->find(link_text => 'Admin')->click;
@ -12,6 +16,6 @@ $d->find(name => 'username')->send_keys('administrator');
$d->find(name => 'password')->send_keys('administrator');
$d->find(name => 'submit')->click;
is($d->get_text('//title'), 'Dashboard');
$d->title_is('Dashboard');
done_testing;

@ -3,7 +3,10 @@ use lib 't/lib';
use Test::More import => [qw(done_testing is ok)];
use Test::WebDriver::Sipwise qw();
my $d = Test::WebDriver::Sipwise->new;
my $browsername = $ENV{BROWSER_NAME} || ""; #possible values: htmlunit, chrome
my $d = Test::WebDriver::Sipwise->new (browser_name => $browsername,
'proxy' => {'proxyType' => 'system'});
$d->set_window_size(800,1280) if ($browsername ne "htmlunit");
my $uri = $ENV{CATALYST_SERVER} || 'http://localhost:3000';
$d->get_ok("$uri/logout"); #make sure we are logged out
$d->get_ok("$uri/login");

@ -5,7 +5,10 @@ use Test::WebDriver::Sipwise qw();
#my $sel = Test::WWW::Selenium::Catalyst->start({default_names => 1});
my $d = Test::WebDriver::Sipwise->new;
my $browsername = $ENV{BROWSER_NAME} || ""; #possible values: htmlunit, chrome
my $d = Test::WebDriver::Sipwise->new (browser_name => $browsername,
'proxy' => {'proxyType' => 'system'});
$d->set_window_size(800,1280) if ($browsername ne "htmlunit");
my $uri = $ENV{CATALYST_SERVER} || 'http://localhost:3000';
$d->get_ok("$uri/logout"); #make sure we are logged out
$d->get_ok("$uri/login");
@ -37,7 +40,7 @@ is($elem->get_text,'No matching records found');
$searchfield->clear();
$searchfield->send_keys('1');
$d->find_ok(css => '#Reseller_table tr.sw_action_row');
is($d->find(css => '#Reseller_table tr:nth-of-type(1) > td:nth-of-type(1)')->get_text,'1');
is($d->find(xpath => '//table[@id="Reseller_table"]//tr[1]/td[1]')->get_text,'1');
$d->findclick_ok(link_text => 'Create Reseller');
$d->findclick_ok(id => 'save');

Loading…
Cancel
Save