mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
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).
This commit is contained in:
parent
448a2aa60c
commit
43a7584e37
1 changed files with 1 additions and 7 deletions
|
@ -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'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue