View | Details | Raw Unified | Return to bug 23102
Collapse All | Expand All

(-)a/t/db_dependent/selenium/regressions.t (-2 / +35 lines)
Lines 36-42 eval { require Selenium::Remote::Driver; }; Link Here
36
if ( $@ ) {
36
if ( $@ ) {
37
    plan skip_all => "Selenium::Remote::Driver is needed for selenium tests.";
37
    plan skip_all => "Selenium::Remote::Driver is needed for selenium tests.";
38
} else {
38
} else {
39
    plan tests => 8;
39
    plan tests => 9;
40
}
40
}
41
41
42
my $s = t::lib::Selenium->new;
42
my $s = t::lib::Selenium->new;
Lines 54-59 my $AudioAlerts_value = C4::Context->preference('AudioAlerts'); Link Here
54
C4::Context->set_preference('AudioAlerts', '1');
54
C4::Context->set_preference('AudioAlerts', '1');
55
55
56
our @cleanup;
56
our @cleanup;
57
58
subtest 'SCI can load error pages' => sub {
59
    plan tests => 1;
60
61
    my $builder  = t::lib::TestBuilder->new;
62
    my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 0 }});
63
    t::lib::Mocks::mock_preference( 'RequireStrongPassword', 0 );
64
    my $password = Koha::AuthUtils::generate_password($patron->category);
65
    $patron->set_password({ password => $password });
66
67
    my $dbh = C4::Context->dbh();
68
    my $sth = $dbh->prepare("INSERT INTO user_permissions (borrowernumber, module_bit, code) VALUES ( ?, 23,'self_checkin_module')");
69
    $sth->execute($patron->borrowernumber);
70
71
    my $sci_mo = C4::Context->preference('SelfCheckInModule');
72
    my $sci_js = C4::Context->preference('SelfCheckInUserJS');
73
    C4::Context->set_preference('SelfCheckInUserJS','</script><img src="'.$s->opac_base_url.'/silk/famfamfam.png"/><script>');
74
    C4::Context->set_preference('SelfCheckInModule','1');
75
76
    my $sci_module = $s->opac_base_url . qq|sci/sci-main.pl|;
77
    $driver->get($sci_module);
78
    $s->fill_form( { userid => $patron->userid, password => $password } );
79
    $s->driver->find_element('//form[@id="auth"]//input[@type="submit"]')->click;
80
    $s->fill_form( { barcode_input => "DONTMATTER" } );
81
    $s->driver->find_element('//form[@id="scan_form"]//button[@id="sci_append_button"]')->click;
82
    $s->driver->find_element('//form[@id="scan_form"]//button[@id="sci_checkin_button"]')->click;
83
    like( $driver->get_title(), qr(Self check-in), );
84
85
86
    C4::Context->set_preference('SelfCheckInUserJS',$sci_js);
87
    C4::Context->set_preference('SelfCheckInModule',$sci_mo);
88
    push @cleanup, $patron, $patron->category, $patron->library;
89
};
90
57
subtest 'OPAC - borrowernumber, branchcode and categorycode as html attributes' => sub {
91
subtest 'OPAC - borrowernumber, branchcode and categorycode as html attributes' => sub {
58
    plan tests => 3;
92
    plan tests => 3;
59
93
60
- 

Return to bug 23102