Skip to content

Commit 21aa614

Browse files
[auto-generated] Update plugin files
Check out the commits that caused these changes: moodlehq/moodleapp@54c9b54...b722a8a
1 parent 1c28511 commit 21aa614

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

tests/behat/behat_app.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,42 @@ public function i_set_the_following_fields_to_these_values_in_the_app(TableNode
736736
}
737737
}
738738

739+
/**
740+
* Checks a field matches a certain value in the app.
741+
*
742+
* Currently this only works for input fields which must be identified using a partial or
743+
* exact match on the placeholder text.
744+
*
745+
* @Given /^the field "((?:[^"]|\\")+)" matches value "((?:[^"]|\\")*)" in the app$/
746+
* @param string $field Text identifying field
747+
* @param string $value Value for field
748+
* @throws DriverException If the field isn't found
749+
* @throws ExpectationException If the field value is different to the expected value
750+
*/
751+
public function the_field_matches_value_in_the_app(string $field, string $value) {
752+
$field = addslashes_js($field);
753+
$value = addslashes_js($value);
754+
755+
$this->spin(function() use ($field, $value) {
756+
$result = $this->runtime_js("fieldMatches('$field', '$value')");
757+
758+
if ($result !== 'OK') {
759+
if (str_contains($result, 'No element matches')) {
760+
throw new DriverException('Error field matches value - ' . $result);
761+
} else {
762+
throw new ExpectationException(
763+
'Error field matches value - ' . $result,
764+
$this->getSession()->getDriver()
765+
);
766+
}
767+
}
768+
769+
return true;
770+
});
771+
772+
$this->wait_for_pending_js();
773+
}
774+
739775
/**
740776
* Checks that the current header stripe in the app contains the expected text.
741777
*
@@ -912,4 +948,17 @@ public function i_switch_network_connection(string $mode) {
912948
}
913949
}
914950

951+
/**
952+
* Open a browser tab with a certain URL.
953+
*
954+
* @Then /^I open a browser tab with url "(?P<pattern>[^"]+)"$/
955+
* @param string $url URL
956+
*/
957+
public function i_open_a_browser_tab_with_url(string $url) {
958+
$this->execute_script("window.open('$url', '_system');");
959+
960+
$windowNames = $this->getSession()->getWindowNames();
961+
$this->getSession()->switchToWindow($windowNames[1]);
962+
}
963+
915964
}

version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
defined('MOODLE_INTERNAL') || die;
88

9-
$plugin->version = 2022091500;
9+
$plugin->version = 2022092000;
1010
$plugin->requires = 2016052300;
1111
$plugin->maturity = MATURITY_STABLE;
1212
$plugin->release = '4.1.0-dev';

0 commit comments

Comments
 (0)