MDL-70152 behat: Forum behat generators use UI

Replace steps that manually add forum and forum post instances
via the UI and use Behat generators. This improves the speed of
Behat test runs.
This commit is contained in:
Angelia Dela Cruz 2022-01-17 17:47:48 +08:00
parent 505940f91e
commit 640db57c0e
19 changed files with 196 additions and 280 deletions

View file

@ -27,6 +27,12 @@ Feature: edit_availability
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activity" exists:
| activity | forum |
| course | C1 |
| section | 1 |
| name | MyForum |
| intro | x |
Scenario: Confirm the 'enable availability' option is working
Given the following config values are set as admin:
@ -180,7 +186,7 @@ Feature: edit_availability
| enableavailability | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1"
And I am on the "MyForum" "forum activity editing" page
When I expand all fieldsets
Then "Add group/grouping access restriction" "button" should not exist
@ -192,10 +198,7 @@ Feature: edit_availability
| GX1 | C1 | GXI1 |
And I log in as "admin"
And I am on "Course 1" course homepage with editing mode on
And I add a "Forum" to section "1"
And I set the following fields to these values:
| Forum name | MyForum |
| Description | x |
And I am on the "MyForum" "forum activity editing" page
When I expand all fieldsets
Then the "Add group/grouping access restriction" "button" should be disabled