diff --git a/t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm b/t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm index c565212b64..3156f72c9b 100644 --- a/t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm +++ b/t/lib/Selenium/Remote/Driver/FirefoxExtensions.pm @@ -110,7 +110,7 @@ sub wait_for_text { } sub move_and_click { - my ($self, $path, $type, $timeout) = @_; + my ($self, $path, $type, $fallback, $timeout) = @_; return unless $path && $type; $timeout = 5 unless $timeout; # seconds. Default timeout value if none is specified. my $started = time(); @@ -118,6 +118,9 @@ sub move_and_click { while ($elapsed - $started <= $timeout){ $elapsed = time(); try{ + if($fallback) { + $self->move_action(element => $self->find_element($fallback, $type)); + } $self->move_action(element => $self->find_element($path, $type)); $self->find_element($path, $type)->click(); return 1; diff --git a/t/selenium/controller_customer.t b/t/selenium/controller_customer.t index 6e7f0c6dfd..830ab60139 100644 --- a/t/selenium/controller_customer.t +++ b/t/selenium/controller_customer.t @@ -81,7 +81,7 @@ ok($d->find_element_by_xpath('//*[@id="collapse_contact"]//table//tr//td[contain diag("Edit Fraud Limits"); $d->find_element('//*[@id="customer_details"]//div//a[contains(text(),"Fraud Limits")]')->click(); $d->scroll_to_element($d->find_element('//*[@id="customer_details"]//div//a[contains(text(),"Fraud Limits")]')); -$d->move_and_click('//*[@id="collapse_fraud"]//table//tr//td[text()[contains(.,"Monthly Settings")]]/../td//a[text()[contains(.,"Edit")]]', 'xpath'); +$d->move_and_click('//*[@id="collapse_fraud"]//table//tr//td[text()[contains(.,"Monthly Settings")]]/../td//a[text()[contains(.,"Edit")]]', 'xpath', '//*[@id="customer_details"]//div//a[contains(text(),"Fraud Limits")]'); $d->fill_element('#fraud_interval_limit', 'css', "100"); $d->fill_element('#fraud_interval_notify', 'css', 'mymail@example.org'); $d->find_element('#save', 'css')->click();