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

(-)a/koha-tmpl/intranet-tmpl/prog/css/login.css (-1 / +1 lines)
Lines 121-127 label { Link Here
121
	width : 99%;
121
	width : 99%;
122
}
122
}
123
123
124
#login #submit, #login .button {
124
#login #submit-button, #login .button {
125
	font-size: 1.4em;
125
	font-size: 1.4em;
126
	padding : .3em .6em;
126
	padding : .3em .6em;
127
}
127
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (-1 / +1 lines)
Lines 112-118 Link Here
112
112
113
<!-- <p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label></p> -->
113
<!-- <p><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="3" />Remember me</label></p> -->
114
114
115
<p class="submit"><input id="submit" type="submit" value="Login" tabindex="4" /></p>
115
<p class="submit"><input id="submit-button" type="submit" value="Login" tabindex="4" /></p>
116
</form>
116
</form>
117
[% IF ( casAuthentication ) %]
117
[% IF ( casAuthentication ) %]
118
<h4>Cas login</h4>
118
<h4>Cas login</h4>
(-)a/t/db_dependent/selenium/basic_workflow.t (-4 / +3 lines)
Lines 177-186 SKIP: { Link Here
177
        $driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber");
177
        $driver->get($base_url."/cataloguing/additem.pl?biblionumber=$biblionumber");
178
        like( $driver->get_title(), qr(test biblio \d+ by test author), );
178
        like( $driver->get_title(), qr(test biblio \d+ by test author), );
179
        my $form = $driver->find_element('//form[@name="f"]');
179
        my $form = $driver->find_element('//form[@name="f"]');
180
        my $inputs = $driver->find_child_elements($form, '//input[@type="text"]');
180
        # select the text inputs that don't have display:none
181
        my $inputs = $driver->find_child_elements($form, '/.//*[not(self::node()[contains(@style,"display:none")])]/*[@type="text"]');
181
        for my $input ( @$inputs ) {
182
        for my $input ( @$inputs ) {
182
            next if $input->is_hidden();
183
184
            my $id = $input->get_attribute('id');
183
            my $id = $input->get_attribute('id');
185
            next unless $id =~ m|^tag_952_subfield|;
184
            next unless $id =~ m|^tag_952_subfield|;
186
185
Lines 206-212 SKIP: { Link Here
206
            elsif (
205
            elsif (
207
                $id =~ m|^tag_952_subfield_d| # dateaccessioned
206
                $id =~ m|^tag_952_subfield_d| # dateaccessioned
208
            ) {
207
            ) {
209
                $v = ""; # The input has been prefilled with %Y-%m-%d already
208
                next; # The input has been prefilled with %Y-%m-%d already
210
            }
209
            }
211
            elsif (
210
            elsif (
212
                $id =~ m|^tag_952_subfield_3| # materials
211
                $id =~ m|^tag_952_subfield_3| # materials
(-)a/t/db_dependent/selenium/patrons_search.t (+2 lines)
Lines 134-139 subtest 'Search patrons' => sub { Link Here
134
    push @cleanup, $library;
134
    push @cleanup, $library;
135
    push @cleanup, $patron_category;
135
    push @cleanup, $patron_category;
136
    C4::Context->set_preference('DefaultPatronSearchFields',$default_patron_search_fields);
136
    C4::Context->set_preference('DefaultPatronSearchFields',$default_patron_search_fields);
137
138
    $driver->quit();
137
};
139
};
138
140
139
END {
141
END {
(-)a/t/db_dependent/selenium/regressions.t (-4 / +8 lines)
Lines 59-68 subtest 'OPAC - borrowernumber and branchcode as html attributes' => sub { Link Here
59
    $patron->set_password({ password => $password });
59
    $patron->set_password({ password => $password });
60
    $s->opac_auth( $patron->userid, $password );
60
    $s->opac_auth( $patron->userid, $password );
61
    my $elt = $driver->find_element('//span[@class="loggedinusername"]');
61
    my $elt = $driver->find_element('//span[@class="loggedinusername"]');
62
    is( $elt->get_attribute('data-branchcode'), $patron->library->branchcode,
62
    is( $elt->get_attribute('data-branchcode', 1), $patron->library->branchcode,
63
        "Since bug 20921 span.loggedinusername should contain data-branchcode"
63
        "Since bug 20921 span.loggedinusername should contain data-branchcode"
64
        # No idea why we need the second param of get_attribute(). As
65
        # data-branchcode is still there after page finished loading.
64
    );
66
    );
65
    is( $elt->get_attribute('data-borrowernumber'), $patron->borrowernumber,
67
    is( $elt->get_attribute('data-borrowernumber', 1), $patron->borrowernumber,
66
"Since bug 20921 span.loggedinusername should contain data-borrowernumber"
68
"Since bug 20921 span.loggedinusername should contain data-borrowernumber"
67
    );
69
    );
68
    push @cleanup, $patron, $patron->category, $patron->library;
70
    push @cleanup, $patron, $patron->category, $patron->library;
Lines 168-178 subtest 'Display circulation table correctly' => sub { Link Here
168
170
169
    my @thead_th = $driver->find_elements('//table[@id="issues-table"]/thead/tr/th');
171
    my @thead_th = $driver->find_elements('//table[@id="issues-table"]/thead/tr/th');
170
    my $thead_length = 0;
172
    my $thead_length = 0;
171
    $thead_length += $_->get_attribute('colspan') || 0 for @thead_th;
173
    $thead_length += $_->get_attribute('colspan', 1) || 0 for @thead_th;
172
174
173
    my @tfoot_td = $driver->find_elements('//table[@id="issues-table"]/tfoot/tr/td');
175
    my @tfoot_td = $driver->find_elements('//table[@id="issues-table"]/tfoot/tr/td');
174
    my $tfoot_length = 0;
176
    my $tfoot_length = 0;
175
    $tfoot_length += $_->get_attribute('colspan') || 0 for @tfoot_td;
177
    $tfoot_length += $_->get_attribute('colspan', 1) || 0 for @tfoot_td;
176
178
177
    my @tbody_td = $driver->find_elements('//table[@id="issues-table"]/tbody/tr[2]/td');
179
    my @tbody_td = $driver->find_elements('//table[@id="issues-table"]/tbody/tr[2]/td');
178
    my $tbody_length = 0;
180
    my $tbody_length = 0;
Lines 231-236 subtest 'XSS vulnerabilities in pagination' => sub { Link Here
231
    like( $second_page->get_attribute('href'), qr{category=2%22%3E%3Cscript%3Ealert%28%27booh%21%27%29%3C%2Fscript%3E}, 'The second page should display the variables and attributes correctly URI escaped' );
233
    like( $second_page->get_attribute('href'), qr{category=2%22%3E%3Cscript%3Ealert%28%27booh%21%27%29%3C%2Fscript%3E}, 'The second page should display the variables and attributes correctly URI escaped' );
232
234
233
    push @cleanup, $patron, $patron->category, $patron->library;
235
    push @cleanup, $patron, $patron->category, $patron->library;
236
237
    $driver->quit();
234
};
238
};
235
239
236
END {
240
END {
(-)a/t/db_dependent/selenium/update_child_to_adult.t (-1 / +4 lines)
Lines 134-140 subtest 'Update child to patron' => sub { Link Here
134
        $driver->find_element('//div[@id="toolbar"]/div[@class="btn-group"][last()]')->click; # More button group
134
        $driver->find_element('//div[@id="toolbar"]/div[@class="btn-group"][last()]')->click; # More button group
135
135
136
        my $update_link = $driver->find_element('//a[@id="updatechild"]');
136
        my $update_link = $driver->find_element('//a[@id="updatechild"]');
137
        is($update_link->get_attribute('data-toggle'), 'tooltip', q|The update link should have a data-toggle attribute => it's a tooltip, not clickable|);
137
        is($update_link->get_attribute('data-toggle', 1), 'tooltip', q|The update link should have a data-toggle attribute => it's a tooltip, not clickable|);
138
        $update_link->click;
138
        $update_link->click;
139
        like( $driver->get_current_url, qr{/members/moremember\.pl\?borrowernumber=$adult_borrowernumber$}, 'After clicking the link, nothing happens, no # in the URL');
139
        like( $driver->get_current_url, qr{/members/moremember\.pl\?borrowernumber=$adult_borrowernumber$}, 'After clicking the link, nothing happens, no # in the URL');
140
    };
140
    };
Lines 142-147 subtest 'Update child to patron' => sub { Link Here
142
    my @patrons = ( $adult_1, $adult_2, $child );
142
    my @patrons = ( $adult_1, $adult_2, $child );
143
    push @cleanup, $_, $_->library, for @patrons;
143
    push @cleanup, $_, $_->library, for @patrons;
144
    push @cleanup, $patron_category_A, $patron_category_C;
144
    push @cleanup, $patron_category_A, $patron_category_C;
145
146
147
    $driver->quit();
145
};
148
};
146
149
147
END {
150
END {
(-)a/t/lib/Selenium.pm (-6 / +6 lines)
Lines 58-63 sub new { Link Here
58
    );
58
    );
59
    bless $self, $class;
59
    bless $self, $class;
60
    $self->add_error_handler;
60
    $self->add_error_handler;
61
    $self->driver->set_implicit_wait_timeout(5000);
61
    return $self;
62
    return $self;
62
}
63
}
63
64
Lines 73-78 sub add_error_handler { Link Here
73
            }
74
            }
74
            print STDERR "\n";
75
            print STDERR "\n";
75
            $self->capture( $driver );
76
            $self->capture( $driver );
77
            $driver->quit();
76
            croak $selenium_error;
78
            croak $selenium_error;
77
        }
79
        }
78
    );
80
    );
Lines 103-110 sub auth { Link Here
103
105
104
    $self->driver->get($mainpage);
106
    $self->driver->get($mainpage);
105
    $self->fill_form( { userid => $login, password => $password } );
107
    $self->fill_form( { userid => $login, password => $password } );
106
    my $login_button = $self->driver->find_element('//input[@id="submit"]');
108
    my $login_button = $self->driver->find_element('//input[@id="submit-button"]');
107
    $login_button->submit();
109
    $login_button->click();
108
}
110
}
109
111
110
sub opac_auth {
112
sub opac_auth {
Lines 137-143 sub submit_form { Link Here
137
    my ( $self ) = @_;
139
    my ( $self ) = @_;
138
140
139
    my $default_submit_selector = '//fieldset[@class="action"]/input[@type="submit"]';
141
    my $default_submit_selector = '//fieldset[@class="action"]/input[@type="submit"]';
140
    $self->click_when_visible( $default_submit_selector );
142
    $self->driver->find_element($default_submit_selector)->click
141
}
143
}
142
144
143
sub click {
145
sub click {
Lines 169-181 sub click { Link Here
169
    if ( exists $params->{id} ) {
171
    if ( exists $params->{id} ) {
170
        $xpath_selector .= '//*[@id="'.$params->{id}.'"]';
172
        $xpath_selector .= '//*[@id="'.$params->{id}.'"]';
171
    }
173
    }
172
    $self->click_when_visible( $xpath_selector );
174
    $self->driver->find_element($xpath_selector)->click
173
}
175
}
174
176
175
sub wait_for_element_visible {
177
sub wait_for_element_visible {
176
    my ( $self, $xpath_selector ) = @_;
178
    my ( $self, $xpath_selector ) = @_;
177
179
178
    $self->driver->set_implicit_wait_timeout(20000);
179
    my ($visible, $elt);
180
    my ($visible, $elt);
180
    $self->remove_error_handler;
181
    $self->remove_error_handler;
181
    while ( not $visible ) {
182
    while ( not $visible ) {
182
- 

Return to bug 27055