From 3e965458f05ec2a912c8b3b0facdad116debdf22 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 26 Nov 2021 18:57:43 +0000 Subject: [PATCH] MDL-72728 behat: switch import course steps to native execute method. The previous iteration using the behat_form_field class directly didn't explicitly require the file that defines this class, and in Goutte runs this led to fatal errors (class not found). --- backup/util/ui/tests/behat/behat_backup.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/backup/util/ui/tests/behat/behat_backup.php b/backup/util/ui/tests/behat/behat_backup.php index fe5f57544be..6f80bc764d2 100644 --- a/backup/util/ui/tests/behat/behat_backup.php +++ b/backup/util/ui/tests/behat/behat_backup.php @@ -144,17 +144,11 @@ class behat_backup extends behat_base { $this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('import')); // Select the course. - $exception = new ExpectationException('"' . $fromcourse . '" course not found in the list of courses to import from', - $this->getSession()); - - // The argument should be converted to an xpath literal. $fromcourse = behat_context_helper::escape($fromcourse); $xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' ics-results ')]" . "/descendant::tr[contains(., $fromcourse)]" . "/descendant::input[@type='radio']"; - $radionode = $this->find('xpath', $xpath, $exception); - $radiofield = new behat_form_field($this->getSession(), $radionode); - $radiofield->set_value(1); + $this->execute('behat_forms::i_set_the_field_with_xpath_to', [$xpath, 1]); $this->execute("behat_forms::press_button", get_string('continue'));