diff --git a/lib/behat/behat_files.php b/lib/behat/behat_files.php index d3b435100ac..ddfdab14706 100644 --- a/lib/behat/behat_files.php +++ b/lib/behat/behat_files.php @@ -88,7 +88,7 @@ class behat_files extends behat_base { // Finds the button inside the DOM, is a modal window, so should be unique. $classname = 'fp-file-' . $action; - $button = $this->find('css', 'button.' . $classname, $exception); + $button = $this->find('css', '.yui3-panel-focused button.' . $classname, $exception); $button->click(); } diff --git a/repository/tests/behat/cancel_add_file.feature b/repository/tests/behat/cancel_add_file.feature index 0ff6a442e6b..c0b37d2671f 100644 --- a/repository/tests/behat/cancel_add_file.feature +++ b/repository/tests/behat/cancel_add_file.feature @@ -25,9 +25,8 @@ Feature: A selected file can be cancelled And I click on "#fitem_id_files .fp-btn-add a" "css_element" And I click on "Recent files" "link" in the ".fp-repo-area" "css_element" And I click on "//a[contains(concat(' ', @class, ' '), ' fp-file ')][contains(., 'empty.txt')]" "xpath_element" - And I wait "2" seconds - And I click on ".fp-select .fp-select-cancel" "css_element" - And I click on ".file-picker button.yui3-button-close" "css_element" + And I click on ".yui3-panel-focused .fp-select .fp-select-cancel" "css_element" + And I click on ".yui3-panel-focused .file-picker button.yui3-button-close" "css_element" And I press "Save and display" Then I should see "upload_users.csv" And I should not see "empty.txt"