--- /dev/null
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::More tests => 6;
+use Test::WWW::Mechanize;
+
+our ( $user, $passwd );
+require 'config.pl';
+
+my $url = 'https://localhost:8443'; # Koha intranet
+
+my $mech = Test::WWW::Mechanize->new;
+
+$mech->get_ok( $url, 'intranet' );
+
+$mech->submit_form_ok({
+ fields => {
+ userid => $user,
+ password => $passwd,
+ },
+}, 'login');
+
+$mech->submit_form_ok({
+ form_number => 2,
+ fields => {
+ member => 'kohatest@ffzg.hr',
+ },
+}, 'find patron' );
+
+#diag $mech->content;
+
+$mech->follow_link_ok({ url_regex => qr/moremember/ }, 'details' );
+
+my $html = $mech->content();
+
+if ( $html =~ m{(/cgi-bin/koha/members/deletemem\.pl\?member=\d+)}s ) {
+ ok( $1, 'found deletemem' );
+ $mech->get_ok( $url . $1 );
+}
--- /dev/null
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::More tests => 3;
+use Test::WWW::Mechanize;
+use File::Slurp;
+
+our $config;
+require 't/config.pl';
+
+use WWW::Mechanize;
+
+my $mech = Test::WWW::Mechanize->new;
+
+my $save_count = 1;
+sub save { write_file "/tmp/login-$save_count.html", @_; $save_count++; }
+
+
+$mech->get_ok( 'https://localhost', 'opac' );
+save $mech->content;
+
+$mech->follow_link_ok({ text_regex => qr/Log in to Your Account/i }, 'login form' );
+save $mech->content;
+
+$mech->submit_form_ok({
+ form_number => 2,
+ fields => {
+ userid => $config->{bind_as},
+ password => $config->{password},
+ },
+}, 'login');
+save $mech->content;
+