MDL-76942 course: Adjust activity chooser Behat tests

* Try to use the button name instead of CSS selectors whenever possible.
This commit is contained in:
Jun Pataleta 2023-01-18 22:32:05 +08:00
parent 544656431a
commit b60cb734b7

View File

@ -25,12 +25,12 @@ Feature: Use the activity chooser to insert activities anywhere in a section
Scenario: The activity chooser icon is hidden by default and be made visible on hover
Given I hover ".navbar-brand" "css_element"
And "[data-action='insert-before-Test Forum'] button" "css_element" should not be visible
When I hover "[data-action='insert-before-Test Forum']" "css_element"
When I hover "Insert an activity or resource before 'Test Forum'" "button"
Then "[data-action='insert-before-Test Forum'] button" "css_element" should be visible
Scenario: The activity chooser can be used to insert modules before existing modules
Given I hover "[data-action='insert-before-Test Forum']" "css_element"
And I click on "[data-action='insert-before-Test Forum'] button" "css_element"
Given I hover "Insert an activity or resource before 'Test Forum'" "button"
And I press "Insert an activity or resource before 'Test Forum'"
And I should see "Add an activity or resource" in the ".modal-title" "css_element"
When I click on "Add a new Assignment" "link" in the "Add an activity or resource" "dialogue"
And I set the following fields to these values: