Merge branch 'MDL-78934' of https://github.com/stronk7/moodle
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
This files describes API changes in the tool_behat code.
|
||||
|
||||
=== 4.3 ===
|
||||
* The goutte behat mink driver has been replaced by the browserkit one because the former has been abandoned. The change should
|
||||
be completely transparent for (near) everybody. Only if you are using some custom-generated behat.yml file or other configuration
|
||||
alternatives different from the Moodle default one, then, any "goutte" browser occurrence needs to be changed to "browserkit_http"
|
||||
when configuring the behat mink extension. See MDL-78934 for more details and changes applied.
|
||||
|
||||
=== 4.2 ===
|
||||
* Behat is initialised with Axe accessibility tests enabled by default, if you want to disable them please use the --no-axe option.
|
||||
|
||||
=== 3.7 ===
|
||||
* Behat will now look for behat step definitions in the current
|
||||
theme and any parents the theme may have.
|
||||
|
||||
=== 2.7 ===
|
||||
* Constants behat_base::cap_allow, behat_base::cap_prevent and
|
||||
behat_base::cap_prohibit have been removed in favour of the
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ default:
|
||||
extensions:
|
||||
Behat\MinkExtension:
|
||||
base_url: 'http://localhost:8000'
|
||||
goutte: null
|
||||
browserkit_http: null
|
||||
webdriver: null
|
||||
Moodle\BehatExtension:
|
||||
moodledirroot: /Should/Change/To/Moodle/www/dir
|
||||
|
||||
+3
-1
@@ -9,8 +9,10 @@
|
||||
"mikey179/vfsstream": "1.6.*",
|
||||
"behat/mink": "^1.10.0",
|
||||
"friends-of-behat/mink-extension": "^2.7.2",
|
||||
"behat/mink-goutte-driver": "^2.0",
|
||||
"behat/mink-browserkit-driver": "^2.1.0",
|
||||
"symfony/process": "^4.4 || ^5.0 || ^6.0",
|
||||
"symfony/http-client": "^4.4 || ^5.0 || ^6.0",
|
||||
"symfony/mime": "^4.4 || ^5.0 || ^6.0",
|
||||
"behat/behat": "3.13.*",
|
||||
"oleg-andreyev/mink-phpwebdriver": "1.2.*"
|
||||
},
|
||||
|
||||
Generated
+7
-124
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "b3dfd36fbddf431cd0cc54c3c4f6b4fd",
|
||||
"content-hash": "3a0d2ff60a75e1c5c42b16fd989bbe24",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
@@ -286,66 +286,6 @@
|
||||
},
|
||||
"time": "2022-03-28T14:33:51+00:00"
|
||||
},
|
||||
{
|
||||
"name": "behat/mink-goutte-driver",
|
||||
"version": "v2.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/minkphp/MinkGoutteDriver.git",
|
||||
"reference": "a60fba46520c17d39b839151831cbc0710764b56"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/a60fba46520c17d39b839151831cbc0710764b56",
|
||||
"reference": "a60fba46520c17d39b839151831cbc0710764b56",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"behat/mink-browserkit-driver": "^2.0@dev",
|
||||
"fabpot/goutte": "^4.0",
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"mink/driver-testsuite": "dev-master",
|
||||
"symfony/error-handler": "^4.4 || ^5.0"
|
||||
},
|
||||
"type": "mink-driver",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Behat\\Mink\\Driver\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Konstantin Kudryashov",
|
||||
"email": "[email protected]",
|
||||
"homepage": "http://everzet.com"
|
||||
}
|
||||
],
|
||||
"description": "Goutte driver for Mink framework",
|
||||
"homepage": "https://mink.behat.org/",
|
||||
"keywords": [
|
||||
"browser",
|
||||
"goutte",
|
||||
"headless",
|
||||
"testing"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/minkphp/MinkGoutteDriver/issues",
|
||||
"source": "https://github.com/minkphp/MinkGoutteDriver/tree/v2.0.0"
|
||||
},
|
||||
"abandoned": "behat/mink-browserkit-driver",
|
||||
"time": "2021-12-29T10:56:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "behat/transliterator",
|
||||
"version": "v1.5.0",
|
||||
@@ -465,63 +405,6 @@
|
||||
],
|
||||
"time": "2022-12-30T00:15:36+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fabpot/goutte",
|
||||
"version": "v4.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/FriendsOfPHP/Goutte.git",
|
||||
"reference": "e3f28671c87a48a0f13ada1baea0d95acc2138c3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/e3f28671c87a48a0f13ada1baea0d95acc2138c3",
|
||||
"reference": "e3f28671c87a48a0f13ada1baea0d95acc2138c3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.3",
|
||||
"symfony/browser-kit": "^4.4|^5.0|^6.0",
|
||||
"symfony/css-selector": "^4.4|^5.0|^6.0",
|
||||
"symfony/deprecation-contracts": "^2.1|^3",
|
||||
"symfony/dom-crawler": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-client": "^4.4|^5.0|^6.0",
|
||||
"symfony/mime": "^4.4|^5.0|^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "^6.0"
|
||||
},
|
||||
"type": "application",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Goutte\\": "Goutte"
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"Goutte/Tests"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "[email protected]"
|
||||
}
|
||||
],
|
||||
"description": "A simple PHP Web Scraper",
|
||||
"homepage": "https://github.com/FriendsOfPHP/Goutte",
|
||||
"keywords": [
|
||||
"scraper"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/FriendsOfPHP/Goutte/issues",
|
||||
"source": "https://github.com/FriendsOfPHP/Goutte/tree/v4.0.3"
|
||||
},
|
||||
"abandoned": "symfony/browser-kit",
|
||||
"time": "2023-04-01T09:05:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "friends-of-behat/mink-extension",
|
||||
"version": "v2.7.2",
|
||||
@@ -2075,16 +1958,16 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/global-state",
|
||||
"version": "5.0.5",
|
||||
"version": "5.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/global-state.git",
|
||||
"reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2"
|
||||
"reference": "bde739e7565280bda77be70044ac1047bc007e34"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2",
|
||||
"reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34",
|
||||
"reference": "bde739e7565280bda77be70044ac1047bc007e34",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2127,7 +2010,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/global-state/issues",
|
||||
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5"
|
||||
"source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2135,7 +2018,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2022-02-14T08:28:10+00:00"
|
||||
"time": "2023-08-02T09:26:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/lines-of-code",
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
@@ -552,7 +552,7 @@ class behat_config_util {
|
||||
'extensions' => array(
|
||||
'Behat\MinkExtension' => array(
|
||||
'base_url' => $CFG->behat_wwwroot,
|
||||
'goutte' => null,
|
||||
'browserkit_http' => null,
|
||||
'webdriver' => $webdriverwdhost
|
||||
),
|
||||
'Moodle\BehatExtension' => array(
|
||||
|
||||
@@ -528,7 +528,7 @@ trait behat_session_trait {
|
||||
* @return boolean
|
||||
*/
|
||||
protected static function running_javascript_in_session(Session $session): bool {
|
||||
return get_class($session->getDriver()) !== 'Behat\Mink\Driver\GoutteDriver';
|
||||
return get_class($session->getDriver()) !== 'Behat\Mink\Driver\BrowserKitDriver';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -228,9 +228,9 @@ 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\GoutteDriver') {
|
||||
if (get_class($context->getMink()->getSession()->getDriver()) === 'Behat\Mink\Driver\BrowserKitDriver') {
|
||||
return false;
|
||||
}
|
||||
list ($dir, $filename) = $this->get_faildump_filename($event, 'png');
|
||||
|
||||
@@ -203,7 +203,7 @@ class behat_form_field implements behat_session_interface {
|
||||
* @return bool
|
||||
*/
|
||||
protected function running_javascript() {
|
||||
return get_class($this->session->getDriver()) !== 'Behat\Mink\Driver\GoutteDriver';
|
||||
return get_class($this->session->getDriver()) !== 'Behat\Mink\Driver\BrowserKitDriver';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -310,7 +310,7 @@ EOF;
|
||||
* @BeforeScenario @~javascript
|
||||
* @param BeforeScenarioScope $scope scope passed by event fired before scenario.
|
||||
*/
|
||||
public function before_goutte_scenarios(BeforeScenarioScope $scope) {
|
||||
public function before_browserkit_scenarios(BeforeScenarioScope $scope) {
|
||||
if ($this->running_javascript()) {
|
||||
// A bug in the BeforeScenario filtering prevents the @~javascript filter on this hook from working
|
||||
// properly.
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user