MDL-69138 behat: Add "I visit :localurl" step

This commit is contained in:
Andrew Nicols
2020-07-22 16:43:08 +08:00
committed by Adrian Greeve
parent 11eb85e494
commit d61fa24239
+12
View File
@@ -1937,4 +1937,16 @@ EOF;
$value = [\WebDriver\Key::ENTER];
$this->getSession()->getDriver()->getWebDriverSession()->activeElement()->postValue(['value' => $value]);
}
/**
* Visit a local URL relative to the behat root.
*
* @When I visit :localurl
*
* @param string|moodle_url $localurl The URL relative to the behat_wwwroot to visit.
*/
public function i_visit($localurl): void {
$localurl = new moodle_url($localurl);
$this->getSession()->visit($this->locate_path($localurl->out_as_local_url(false)));
}
}