mirror of
https://github.com/moodle/moodle.git
synced 2025-01-16 13:09:21 +01:00
MDL-78934 behat: Replace all the rest of goutte by browserkit
Basically all them are comments. Only remaining occurrence remaining is in composer.lock file, because friends-of-behat/mink-extension still has the old goutte as dev requirement, but that doesn't affect us at all (no goutte is installed anymore, see the vendor directory and/or the lock file).
This commit is contained in:
parent
7d37b29248
commit
731f64226d
@ -743,7 +743,7 @@ abstract class base {
|
||||
/**
|
||||
* Return the old non-ajax activity action url.
|
||||
*
|
||||
* Goutte behats tests cannot trigger javascript events,
|
||||
* BrowserKit behats tests cannot trigger javascript events,
|
||||
* so we must translate to an old non-ajax url while non-ajax
|
||||
* course editing is still supported.
|
||||
*
|
||||
|
@ -28,7 +28,7 @@ $setmode = optional_param('setmode', false, PARAM_BOOL);
|
||||
$contextid = required_param('context', PARAM_INT);
|
||||
$pageurl = required_param('pageurl', PARAM_LOCALURL);
|
||||
|
||||
// Behat requires JS to get the session. To allow goutte
|
||||
// Behat requires JS to get the session. To allow browserkit
|
||||
// to enable edit mode sesskey validation is skipped for behat scripts.
|
||||
if (!defined('BEHAT_SITE_RUNNING')) {
|
||||
require_sesskey();
|
||||
|
@ -228,7 +228,7 @@ class MoodleScreenshotFormatter implements Formatter {
|
||||
* @param Context $context
|
||||
*/
|
||||
protected function take_screenshot(AfterStepTested $event, $context) {
|
||||
// Goutte can't save screenshots.
|
||||
// BrowserKit can't save screenshots.
|
||||
if ($context->getMink()->isSessionStarted($context->getMink()->getDefaultSessionName())) {
|
||||
if (get_class($context->getMink()->getSession()->getDriver()) === 'Behat\Mink\Driver\BrowserKitDriver') {
|
||||
return false;
|
||||
|
@ -83,7 +83,7 @@ class behat_form_radio extends behat_form_checkbox {
|
||||
$this->trigger_on_change();
|
||||
}
|
||||
} else {
|
||||
// Goutte does not accept a check nor a click in an input[type=radio].
|
||||
// BrowserKit does not accept a check nor a click in an input[type=radio].
|
||||
$this->field->setValue($this->field->getAttribute('value'));
|
||||
}
|
||||
}
|
||||
|
@ -1455,7 +1455,7 @@ EOF;
|
||||
|
||||
// Check if value exists in specific row/column.
|
||||
// Get row xpath.
|
||||
// GoutteDriver uses DomCrawler\Crawler and it is making XPath relative to the current context, so use descendant.
|
||||
// Some drivers make XPath relative to the current context, so use descendant.
|
||||
$rowxpath = $tablexpath . "/tbody/tr[descendant::*[@class='rowtitle'][normalize-space(.)=" . $rowliteral . "] | " . "
|
||||
descendant::th[normalize-space(.)=" . $rowliteral . "] | descendant::td[normalize-space(.)=" . $rowliteral . "]]";
|
||||
|
||||
@ -1802,7 +1802,7 @@ EOF;
|
||||
|
||||
/**
|
||||
* Presses a given button in the browser.
|
||||
* NOTE: Phantomjs and goutte driver reloads page while navigating back and forward.
|
||||
* NOTE: Phantomjs and browserkit driver reloads page while navigating back and forward.
|
||||
*
|
||||
* @Then /^I press the "(back|forward|reload)" button in the browser$/
|
||||
* @param string $button the button to press.
|
||||
|
@ -702,7 +702,7 @@ EOF;
|
||||
* @param AfterStepScope $scope scope passed by event after step.
|
||||
*/
|
||||
protected function take_screenshot(AfterStepScope $scope) {
|
||||
// Goutte can't save screenshots.
|
||||
// BrowserKit can't save screenshots.
|
||||
if (!$this->running_javascript()) {
|
||||
return false;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
}
|
||||
}}
|
||||
<div class="btn-group{{#manageurl}} course-manage{{/manageurl}}{{#courserequesturl}} course-request{{/courserequesturl}}">
|
||||
<!-- Set as a link to appease Goutte behat. -->
|
||||
<!-- Set as a link to appease BrowserKit behat. -->
|
||||
<a href="#" class="btn btn-link btn-icon icon-size-3 rounded-circle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{#str}}coursemanagementoptions, my{{/str}}">
|
||||
<i class="fa fa-ellipsis-v text-dark py-2" aria-hidden="true"></i>
|
||||
</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user