MDL-69454 core_search: consistent course management search
[moodle.git] / course / tests / behat / course_search.feature
CommitLineData
06b5e81b
DP
1@core @core_course
2Feature: Courses can be searched for and moved in bulk.
3 In order to manage a large number of courses
4 As a Moodle Administrator
5 I need to be able to search courses in bulk and move them around
6
7 Background:
57bee542 8 Given the following "categories" exist:
06b5e81b
DP
9 | name | category | idnumber |
10 | Science | 0 | SCI |
11 | English | 0 | ENG |
12 | Miscellaneous | 0 | MISC |
06b5e81b
DP
13 And the following "courses" exist:
14 | fullname | shortname | category |
15 | Biology Y1 | BIO1 | MISC |
16 | Biology Y2 | BIO2 | MISC |
17 | English Y1 | ENG1 | ENG |
18 | English Y2 | ENG2 | MISC |
19
20 Scenario: Search courses finds correct results
21 Given I log in as "admin"
22 And I go to the courses management page
d5593b18
BB
23 When I set the field "Search" to "Biology"
24 And I press "Search"
06b5e81b
DP
25 Then I should see "Biology Y1"
26 And I should see "Biology Y2"
27 And I should not see "English Y1"
28 And I should not see "English Y2"
29
30 @javascript
31 Scenario: Search courses and move results in bulk
32 Given I log in as "admin"
33 And I go to the courses management page
d5593b18
BB
34 And I set the field "Search" to "Biology"
35 And I press "Search"
06b5e81b
DP
36 When I select course "Biology Y1" in the management interface
37 And I select course "Biology Y2" in the management interface
38 And I set the field "menumovecoursesto" to "Science"
39 And I press "Move"
40 Then I should see "Successfully moved 2 courses into Science"
41 And I wait to be redirected
42 And I click on category "Science" in the management interface
43 And I should see "Biology Y1"
44 And I should see "Biology Y2"