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

(-)a/t/lib/Selenium.pm (-4 / +33 lines)
Lines 201-212 sub wait_for_element_visible { Link Here
201
sub wait_for_element_hidden {
201
sub wait_for_element_hidden {
202
    my ( $self, $xpath_selector ) = @_;
202
    my ( $self, $xpath_selector ) = @_;
203
203
204
    my ($hidden, $elt);
204
    my ( $hidden, $elt );
205
    $self->remove_error_handler;
205
    $self->remove_error_handler;
206
    my $max_retries = $self->max_retries;
206
    my $max_retries = $self->max_retries;
207
    my $i;
207
    my $i;
208
    while ( not $hidden ) {
208
    while ( not $hidden ) {
209
        $elt = eval {$self->driver->find_element($xpath_selector) };
209
        $elt    = eval { $self->driver->find_element($xpath_selector) };
210
        $hidden = $elt || !$elt->is_displayed;
210
        $hidden = $elt || !$elt->is_displayed;
211
        $self->driver->pause(1000) unless $hidden;
211
        $self->driver->pause(1000) unless $hidden;
212
212
Lines 351-363 when we use automation test using Selenium Link Here
351
351
352
=head2 click
352
=head2 click
353
353
354
    $s->click
354
    $s->click($xpath_selector);
355
355
356
    This is a bit dirty for now but will evolve depending on the needs
356
    This is a bit dirty for now but will evolve depending on the needs
357
    3 parameters possible but only the following 2 forms are used:
357
    3 parameters possible but only the following 2 forms are used:
358
    $s->click({ href => '/module/script.pl?foo=bar', main => 'doc3' }); # Sometimes we have doc or doc3. To make sure we are not going to hit a link in the header
358
    $s->click({ href => '/module/script.pl?foo=bar', main => 'doc3' }); # Sometimes we have doc or doc3. To make sure we are not going to hit a link in the header
359
    $s->click({ id => 'element_id });
359
    $s->click({ id => 'element_id });
360
360
361
=head2 wait_for_element_visible
362
363
    $s->wait_for_element_visible($xpath_selector)
364
365
    Wait 10s for an element to be visible
366
367
=head2 wait_for_element_hidden
368
369
    $s->wait_for_element_hidden($xpath_selector)
370
371
    Wait 10s for an element to be hidden
372
373
=head2 wait_for_ajax
374
375
    $s->wait_for_ajax;
376
377
    Wait 10s for all the current AJAX requests to be received.
378
379
=head2 get_next_alert_text
380
381
    $s->get_next_alert_text;
382
383
    Retrieve the next alert text.
384
385
=head2 show_all_entries
386
387
    $s->show_all_entries($xpath_selector);
388
389
    Select the "All" entries of the DataTables present in the selector.
390
361
=head2 click_when_visible
391
=head2 click_when_visible
362
392
363
    $c->click_when_visible
393
    $c->click_when_visible
364
- 

Return to bug 35329