MDL-72655 behat: Use assign generators
Replace steps that manually add assignment instances via the UI and use Behat generators. This improves the speed of Behat test runs.
This commit is contained in:
@@ -14,6 +14,10 @@ Feature: Basic recycle bin functionality
|
||||
| fullname | shortname |
|
||||
| Course 1 | C1 |
|
||||
| Course 2 | C2 |
|
||||
And the following "activities" exist:
|
||||
| activity | course | section | name | intro |
|
||||
| assign | C1 | 1 | Test assign 1 | Test 1 |
|
||||
| assign | C1 | 1 | Test assign 2 | Test 2 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
@@ -43,23 +47,16 @@ Feature: Basic recycle bin functionality
|
||||
|
||||
Scenario: Restore a deleted assignment
|
||||
Given I log in as "teacher1"
|
||||
And the following "activity" exists:
|
||||
| activity | assign |
|
||||
| name | Test assign |
|
||||
| intro | Test |
|
||||
| course | C1 |
|
||||
| idnumber | 0001 |
|
||||
| section | 1 |
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I delete "Test assign" activity
|
||||
And I delete "Test assign 1" activity
|
||||
When I navigate to "Recycle bin" in current page administration
|
||||
Then I should see "Test assign"
|
||||
Then I should see "Test assign 1"
|
||||
And I should see "Contents will be permanently deleted after 7 days"
|
||||
And I click on "Restore" "link" in the "region-main" "region"
|
||||
And I should see "'Test assign' has been restored"
|
||||
And I should see "'Test assign 1' has been restored"
|
||||
And I wait to be redirected
|
||||
And I am on "Course 1" course homepage
|
||||
And I should see "Test assign" in the "Topic 1" "section"
|
||||
And I should see "Test assign 1" in the "Topic 1" "section"
|
||||
|
||||
Scenario: Restore a deleted course
|
||||
Given I log in as "admin"
|
||||
@@ -91,31 +88,22 @@ Feature: Basic recycle bin functionality
|
||||
Scenario: Deleting a single item from the recycle bin
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assign |
|
||||
| Description | Test |
|
||||
And I delete "Test assign" activity
|
||||
And I delete "Test assign 1" activity
|
||||
And I run all adhoc tasks
|
||||
And I navigate to "Recycle bin" in current page administration
|
||||
When I click on "Delete" "link"
|
||||
Then I should see "Are you sure you want to delete the selected item from the recycle bin?"
|
||||
And I click on "Cancel" "button" in the "Confirmation" "dialogue"
|
||||
And I should see "Test assign"
|
||||
And I should see "Test assign 1"
|
||||
And I click on "Delete" "link"
|
||||
And I press "Yes"
|
||||
And I should see "'Test assign' has been deleted"
|
||||
And I should see "'Test assign 1' has been deleted"
|
||||
And I should see "There are no items in the recycle bin."
|
||||
|
||||
@javascript
|
||||
Scenario: Deleting all the items from the recycle bin
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assign 1 |
|
||||
| Description | Test 1 |
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assign 2 |
|
||||
| Description | Test 2 |
|
||||
And I delete "Test assign 1" activity
|
||||
And I delete "Test assign 2" activity
|
||||
And I run all adhoc tasks
|
||||
|
||||
Reference in New Issue
Block a user