/[virtual-ldap]/t/koha/02-create-test-user.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /t/koha/02-create-test-user.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 101 - (hide annotations)
Tue Nov 16 18:07:05 2010 UTC (13 years, 5 months ago) by dpavlin
File MIME type: application/x-troff
File size: 757 byte(s)
fix test

removed File::Slurp because it breaks on wide characters and
follow opac-login link instead of localization text

1 dpavlin 78 #!/usr/bin/perl
2    
3     use warnings;
4     use strict;
5    
6 dpavlin 80 use Test::More tests => 4;
7 dpavlin 78 use Test::WWW::Mechanize;
8    
9     our $config;
10     require 't/config.pl';
11    
12     use WWW::Mechanize;
13    
14     my $mech = Test::WWW::Mechanize->new;
15    
16     my $save_count = 1;
17 dpavlin 81 sub save {
18     my $path = '/tmp/login-' . $save_count++ . '.html';
19 dpavlin 101 open(my $fh, '>', $path);
20     print $fh @_;
21 dpavlin 81 warn "# save $path ", -s $path, " bytes\n";
22     }
23 dpavlin 78
24    
25     $mech->get_ok( 'https://localhost', 'opac' );
26     save $mech->content;
27    
28 dpavlin 101 $mech->follow_link_ok({ url_regex => qr/opac-user/i }, 'login form' );
29 dpavlin 78 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 dpavlin 80 $mech->follow_link_ok({ url_regex => qr/logout/ }, 'logout' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26