read additional yaml files from yaml/attribute/value.yaml
[virtual-ldap] / t / koha / 02-create-test-user.t
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 use Test::More tests => 4;
7 use Test::WWW::Mechanize;
8 use File::Slurp;
9
10 our $config;
11 require 't/config.pl';
12
13 use WWW::Mechanize;
14
15 my $mech = Test::WWW::Mechanize->new;
16
17 my $save_count = 1;
18 sub save {
19         my $path = '/tmp/login-' . $save_count++ . '.html';
20         write_file $path, @_;
21         warn "# save $path ", -s $path, " bytes\n";
22 }
23         
24
25 $mech->get_ok( 'https://localhost', 'opac' );
26 save $mech->content;
27
28 $mech->follow_link_ok({ text_regex => qr/Log in to Your Account/i }, 'login form' );
29 save $mech->content;
30
31 $mech->submit_form_ok({
32         form_number => 2,
33         fields => {
34                 userid => $config->{bind_as},
35                 password => $config->{password},
36         },
37 }, 'login');
38 save $mech->content;
39
40 $mech->follow_link_ok({ url_regex => qr/logout/ }, 'logout' );