TT#46791 Wait for 'Edit' button in controller_billing.t

The 'Edit' button appears only after mouse-over event,
and we might have race conditions here when we are trying
to click on not-yet available/accessible button causing:
> Can't use string ("element not interactable")...

Let's wait for button and then proceed with 'click()',
it is the behaviour we use everywhere, while it was missing here.

Also improve debug messages here for easier debug next time.

Change-Id: Iae955bb3f937da6b5c10369bc49f6dd75611dc87
(cherry picked from commit 95e1c49208)
changes/48/24748/1
Alexander Lutay 7 years ago
parent ba3e432f09
commit 12f430f559

@ -130,11 +130,17 @@ ok($d->find_element('//*[@id="masthead"]//h2[contains(text(),"times for mytestpr
diag("Edit Wednesday");
$row = $d->find_element('//table//td[contains(text(),"Wednesday")]');
ok($row);
diag("Move mouse over 'Weekdays' row to make 'Edit' button available");
$d->move_action(element => ($d->find_element('//h3[contains(text(),"Weekdays")]')));
sleep 2 if ($d->browser_name_in("htmlunit"));
$d->move_action(element => $row);
$d->find_element('//table//td[contains(text(),"Wednesday")]/..//a[text()[contains(.,"Edit")]]')->click();
diag("Find 'Edit' button for element 'Wednesday'");
my $btn = $d->find_element('//table//td[contains(text(),"Wednesday")]/..//a[text()[contains(.,"Edit")]]');
ok($btn);
diag("Click 'Edit' button for element 'Wednesday'");
$btn->click;
$d->find_text("Edit Wednesday");
diag("Pop-up 'Edit Wednesday' was properly opened");
diag("add/delete a time def to Wednesday");
$d->fill_element('#start', 'css', "03:14:15");

Loading…
Cancel
Save