/[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 106 - (hide annotations)
Thu Jul 14 20:23:45 2011 UTC (12 years, 9 months ago) by dpavlin
File MIME type: application/x-troff
File size: 823 byte(s)
configure OPAC_URL
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 dpavlin 106 my $opac_url = $ENV{OPAC_URL} || 'http://ffzg.koha-dev.rot13.org';
25    
26     $mech->get_ok( $opac_url, "opac $opac_url" );
27 dpavlin 78 save $mech->content;
28    
29 dpavlin 101 $mech->follow_link_ok({ url_regex => qr/opac-user/i }, 'login form' );
30 dpavlin 78 save $mech->content;
31    
32     $mech->submit_form_ok({
33     form_number => 2,
34     fields => {
35     userid => $config->{bind_as},
36     password => $config->{password},
37     },
38     }, 'login');
39     save $mech->content;
40    
41 dpavlin 80 $mech->follow_link_ok({ url_regex => qr/logout/ }, 'logout' );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26