5 |
|
|
6 |
use Test::More tests => 6; |
use Test::More tests => 6; |
7 |
use Test::WWW::Mechanize; |
use Test::WWW::Mechanize; |
8 |
|
use XML::Simple; |
9 |
|
use Data::Dump qw(dump); |
10 |
|
|
11 |
our ( $user, $passwd ); |
my $url = $ENV{INTRANET} || 'http://ffzg.koha-dev.rot13.org:8080'; |
12 |
require 'config.pl'; |
my $koha_conf = $ENV{KOHA_CONF} || '/etc/koha/sites/ffzg/koha-conf.xml'; |
13 |
|
|
14 |
my $url = 'https://localhost:8443'; # Koha intranet |
my $xml = XMLin( $koha_conf ); |
15 |
|
diag 'Koha config = ',dump $xml->{config}; |
16 |
|
|
17 |
|
our $config; |
18 |
|
require 't/config.pl'; |
19 |
|
diag 'test config = ',dump $config; |
20 |
|
|
21 |
my $mech = Test::WWW::Mechanize->new; |
my $mech = Test::WWW::Mechanize->new; |
22 |
|
|
24 |
|
|
25 |
$mech->submit_form_ok({ |
$mech->submit_form_ok({ |
26 |
fields => { |
fields => { |
27 |
userid => $user, |
userid => $xml->{config}->{user}, |
28 |
password => $passwd, |
password => $xml->{config}->{pass}, |
29 |
}, |
}, |
30 |
}, 'login'); |
}, "login $xml->{config}->{user}"); |
31 |
|
|
32 |
$mech->submit_form_ok({ |
$mech->submit_form_ok({ |
33 |
form_number => 2, |
form_number => 2, |