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

(-)a/t/db_dependent/selenium/regressions.t (-2 / +38 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(
69
        "INSERT INTO user_permissions (borrowernumber, module_bit, code) VALUES ( ?, 23,'self_checkin_module')");
70
    $sth->execute( $patron->borrowernumber );
71
72
    my $sci_mo = C4::Context->preference('SelfCheckInModule');
73
    my $sci_js = C4::Context->preference('SelfCheckInUserJS');
74
    C4::Context->set_preference(
75
        'SelfCheckInUserJS',
76
        '</script><img src="' . $s->opac_base_url . '/silk/famfamfam.png"/><script>'
77
    );
78
    C4::Context->set_preference( 'SelfCheckInModule', '1' );
79
80
    my $sci_module = $s->opac_base_url . qq|sci/sci-main.pl|;
81
    $driver->get($sci_module);
82
    $s->fill_form( { userid => $patron->userid, password => $password } );
83
    $s->driver->find_element('//form[@id="auth"]//input[@type="submit"]')->click;
84
    $s->fill_form( { barcode_input => "DONTMATTER" } );
85
    $s->driver->find_element('//form[@id="scan_form"]//button[@id="sci_append_button"]')->click;
86
    $s->driver->find_element('//form[@id="scan_form"]//button[@id="sci_checkin_button"]')->click;
87
    like( $driver->get_title(), qr(Self check-in), );
88
89
    C4::Context->set_preference( 'SelfCheckInUserJS', $sci_js );
90
    C4::Context->set_preference( 'SelfCheckInModule', $sci_mo );
91
    push @cleanup, $patron, $patron->category, $patron->library;
92
};
93
57
subtest 'OPAC - borrowernumber, branchcode and categorycode as html attributes' => sub {
94
subtest 'OPAC - borrowernumber, branchcode and categorycode as html attributes' => sub {
58
    plan tests => 3;
95
    plan tests => 3;
59
96
60
- 

Return to bug 23102