-
Bug
-
Resolution: Fixed
-
Minor
-
3.11, 4.0
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE
-
MDL-71874-master -
When running the step without javascript, behat_course::i_add_to_section() fails. This was tested with selenium chrome.
We first encountered the problem in this feature with the CI failing for example here https://github.com/learnweb/moodle-mod_moodleoverflow/runs/2774655894#step:12:141 .
This minimal example fails as well.
@mod @mod_test
|
Feature: Add test activity
|
|
Scenario: Add a activity
|
Given the following "users" exist:
|
| username | firstname | lastname | email |
|
| teacher1 | Teacher | 1 | teacher1@example.com |
|
And the following "courses" exist:
|
| fullname | shortname | category |
|
| Course 1 | C1 | 0 |
|
And the following "course enrolments" exist:
|
| user | course | role |
|
| teacher1 | C1 | editingteacher |
|
When I log in as "teacher1"
|
And I am on "Course 1" course homepage
|
And I turn editing mode on
|
Then I add a "File" to section "1"
|
Behat\Mink\Exception\ElementNotFoundException: Xpath matching locator "//li[@id='section-1']/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' section_add_menus ')]/descendant::select[option[normalize-space(.)='File']]" not found. in /var/www/public/moodle311/lib/behat/classes/behat_session_trait.php:133
|
Stack trace:
|
#0 /var/www/public/moodle311/lib/behat/classes/behat_session_trait.php(91): behat_base->find_all()
|
#1 /var/www/public/moodle311/course/tests/behat/behat_course.php(266): behat_base->find()
|
When running these steps with javascript, they pass as expected. This seems to be a bug, as course/tests/behat/behat_course::i_add_to_section() has a special distinction for when javascript is deactivated. (Line 259)