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

(-)a/t/db_dependent/selenium/regressions.t (-2 / +27 lines)
Lines 19-27 use Modern::Perl; Link Here
19
19
20
use C4::Context;
20
use C4::Context;
21
21
22
use Test::More tests => 1;
22
use Test::More tests => 2;
23
23
24
use t::lib::Selenium;
24
use t::lib::Selenium;
25
use t::lib::TestBuilder;
25
26
26
eval { require Selenium::Remote::Driver; };
27
eval { require Selenium::Remote::Driver; };
27
skip "Selenium::Remote::Driver is needed for selenium tests.", 1 if $@;
28
skip "Selenium::Remote::Driver is needed for selenium tests.", 1 if $@;
Lines 30-40 my $s = t::lib::Selenium->new; Link Here
30
31
31
my $driver = $s->driver;
32
my $driver = $s->driver;
32
my $opac_base_url = $s->opac_base_url;
33
my $opac_base_url = $s->opac_base_url;
34
my $base_url = $s->base_url;
33
35
34
# It seems that we do not have enough records indexed with ES
36
# It seems that we do not have enough records indexed with ES
35
my $SearchEngine_value = C4::Context->preference('SearchEngine');
37
my $SearchEngine_value = C4::Context->preference('SearchEngine');
36
C4::Context->set_preference('SearchEngine', 'Zebra');
38
C4::Context->set_preference('SearchEngine', 'Zebra');
37
39
40
my $AudioAlerts_value = C4::Context->preference('AudioAlerts');
41
C4::Context->set_preference('AudioAlerts', '1');
42
43
my @data_to_cleanup;
38
44
39
subtest 'OPAC - Remove from cart' => sub {
45
subtest 'OPAC - Remove from cart' => sub {
40
    plan tests => 4;
46
    plan tests => 4;
Lines 69-74 subtest 'OPAC - Remove from cart' => sub { Link Here
69
        2, '1 element should have been removed from the cart' );
75
        2, '1 element should have been removed from the cart' );
70
};
76
};
71
77
78
subtest 'Play sound on the circulation page' => sub {
79
    plan tests => 1;
80
81
    my $builder  = t::lib::TestBuilder->new;
82
    my $patron = $builder->build_object({ class => 'Koha::Patrons', value => { flags => 0 }});
83
84
    my $mainpage = $s->base_url . q|mainpage.pl|;
85
    $driver->get($mainpage);
86
    like( $driver->get_title(), qr(Log in to Koha), );
87
    $s->auth;
88
89
    $driver->get( $base_url . "/circ/circulation.pl?borrowernumber=" . $patron->borrowernumber );
90
91
    my $audio_node = $driver->find_element('//span[@id="audio-alert"]/audio[@src="/intranet-tmpl/prog/sound/beep.ogg"]');
92
93
    push @data_to_cleanup, $patron, $patron->category, $patron->library;
94
};
95
72
END {
96
END {
73
    C4::Context->preference('SearchEngine', $SearchEngine_value);
97
    C4::Context->preference('SearchEngine', $SearchEngine_value);
98
    C4::Context->preference('AudioAlerts', $AudioAlerts_value);
99
    $_->delete for @data_to_cleanup;
74
};
100
};
75
- 

Return to bug 21775