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

(-)a/t/db_dependent/selenium/regressions.t (-5 / +25 lines)
Lines 19-25 use Modern::Perl; Link Here
19
19
20
use C4::Context;
20
use C4::Context;
21
21
22
use Test::More tests => 2;
22
use Test::More tests => 3;
23
23
24
use C4::Context;
24
use C4::Context;
25
use Koha::AuthUtils;
25
use Koha::AuthUtils;
Lines 33-44 my $s = t::lib::Selenium->new; Link Here
33
33
34
my $driver = $s->driver;
34
my $driver = $s->driver;
35
my $opac_base_url = $s->opac_base_url;
35
my $opac_base_url = $s->opac_base_url;
36
my $base_url = $s->base_url;
36
my $builder = t::lib::TestBuilder->new;
37
my $builder = t::lib::TestBuilder->new;
37
38
38
# It seems that we do not have enough records indexed with ES
39
# It seems that we do not have enough records indexed with ES
39
my $SearchEngine_value = C4::Context->preference('SearchEngine');
40
my $SearchEngine_value = C4::Context->preference('SearchEngine');
40
C4::Context->set_preference('SearchEngine', 'Zebra');
41
C4::Context->set_preference('SearchEngine', 'Zebra');
41
42
43
my $AudioAlerts_value = C4::Context->preference('AudioAlerts');
44
C4::Context->set_preference('AudioAlerts', '1');
45
42
our @cleanup;
46
our @cleanup;
43
subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub {
47
subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub {
44
    plan tests => 2;
48
    plan tests => 2;
Lines 55-63 subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { Link Here
55
    is( $elt->get_attribute('data-borrowernumber'), $patron->borrowernumber,
59
    is( $elt->get_attribute('data-borrowernumber'), $patron->borrowernumber,
56
"Since bug 20921 span.loggedinusername should contain data-borrowernumber"
60
"Since bug 20921 span.loggedinusername should contain data-borrowernumber"
57
    );
61
    );
58
    push @cleanup, $patron;
62
    push @cleanup, $patron, $patron->category, $patron->library;
59
    push @cleanup, $patron->category;
60
    push @cleanup, $patron->library;
61
};
63
};
62
64
63
subtest 'OPAC - Remove from cart' => sub {
65
subtest 'OPAC - Remove from cart' => sub {
Lines 93-99 subtest 'OPAC - Remove from cart' => sub { Link Here
93
        2, '1 element should have been removed from the cart' );
95
        2, '1 element should have been removed from the cart' );
94
};
96
};
95
97
98
subtest 'Play sound on the circulation page' => sub {
99
    plan tests => 1;
100
101
    my $builder  = t::lib::TestBuilder->new;
102
    my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 0 }});
103
104
    my $mainpage = $s->base_url . q|mainpage.pl|;
105
    $driver->get($mainpage);
106
    like( $driver->get_title(), qr(Log in to Koha), );
107
    $s->auth;
108
109
    $driver->get( $base_url . "/circ/circulation.pl?borrowernumber=" . $patron->borrowernumber );
110
111
    my $audio_node = $driver->find_element('//span[@id="audio-alert"]/audio[@src="/intranet-tmpl/prog/sound/beep.ogg"]');
112
113
    push @cleanup, $patron, $patron->category, $patron->library;
114
};
115
96
END {
116
END {
97
    C4::Context->preference('SearchEngine', $SearchEngine_value);
117
    C4::Context->preference('SearchEngine', $SearchEngine_value);
118
    C4::Context->preference('AudioAlerts', $AudioAlerts_value);
98
    $_->delete for @cleanup;
119
    $_->delete for @cleanup;
99
};
120
};
100
- 

Return to bug 21775