Lines 97-103
SKIP: {
Link Here
|
97 |
$driver->find_element('//a[@id="user-menu"]')->click; |
97 |
$driver->find_element('//a[@id="user-menu"]')->click; |
98 |
$driver->find_element('//a[@id="logout"]')->click; |
98 |
$driver->find_element('//a[@id="logout"]')->click; |
99 |
$driver->get($mainpage); # This should not be needed but we the next find_element fails randomly |
99 |
$driver->get($mainpage); # This should not be needed but we the next find_element fails randomly |
100 |
$driver->find_element('//div[@id="login"]'); # logged out |
100 |
|
|
|
101 |
{ # Temporary debug |
102 |
$driver->error_handler( |
103 |
sub { |
104 |
my ( $driver, $selenium_error ) = @_; |
105 |
print STDERR "\nSTRACE:"; |
106 |
my $i = 1; |
107 |
while ( (my @call_details = (caller($i++))) ){ |
108 |
print STDERR "\t" . $call_details[1]. ":" . $call_details[2] . " in " . $call_details[3]."\n"; |
109 |
} |
110 |
print STDERR "\n"; |
111 |
print STDERR sprintf("Is logged in patron: %s (%s)?\n", $patron->firstname, $patron->surname ); |
112 |
$s->capture( $driver ); |
113 |
croak $selenium_error; |
114 |
} |
115 |
); |
116 |
|
117 |
$driver->find_element('//div[@id="login"]'); # logged out |
118 |
$s->add_error_handler; # Reset to the default error handler |
119 |
} |
101 |
|
120 |
|
102 |
# Using the form on the right |
121 |
# Using the form on the right |
103 |
$s->fill_form( { userid => $patron->userid, password => $password } ); |
122 |
$s->fill_form( { userid => $patron->userid, password => $password } ); |
104 |
- |
|
|