2 Feature: Test we can both create and delete a course.
4 I need to test I can create a course
5 I need to test I can delete a course
7 Scenario: Create a course
8 Given the following "categories" exist:
9 | name | category 0| idnumber |
12 And I log in as "admin"
13 And I go to the courses management page
14 And I should see the "Course categories" management page
15 And I click on category "Cat 1" in the management interface
17 And I should see the "Course categories and courses" management page
18 And I should see "Cat 1" in the "#category-listing" "css_element"
19 And I should see "No courses in this category" in the "#course-listing" "css_element"
20 And I click on "Create new course" "link" in the ".course-listing-actions" "css_element"
21 And I set the following fields to these values:
22 | Course full name | Test course: create a course |
23 | Course short name | TCCAC |
24 | Course ID number | TC3401 |
25 | Course summary | This course has been created by automated tests. |
26 And I press "Save changes"
28 And I go to the courses management page
29 And I should see the "Course categories" management page
30 And I click on category "Cat 1" in the management interface
32 And I should see the "Course categories and courses" management page
33 And I should see "Cat 1" in the "#category-listing" "css_element"
34 And I should see "Test course: create a course" in the "#course-listing" "css_element"
36 Scenario: Delete a course via its management listing
37 Given the following "categories" exist:
38 | name | category 0| idnumber |
40 And the following "courses" exist:
41 | category | fullname | shortname | idnumber |
42 | CAT1 | Test course: create a course | TCCAC | TC3401 |
43 | CAT1 | Test course 2: create another course | TC2CAC | TC3402 |
45 And I log in as "admin"
46 And I go to the courses management page
47 And I should see the "Course categories" management page
48 And I click on category "Cat 1" in the management interface
50 And I should see the "Course categories and courses" management page
51 And I should see "Cat 1" in the "#category-listing" "css_element"
52 And I should see "Test course: create a course" in the "#course-listing" "css_element"
53 And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
54 And I click on "delete" action for "Test course: create a course" in management course listing
56 And I should see "Delete TCCAC"
57 And I should see "Test course: create a course (TCCAC)"
58 And I press "Continue"
60 And I should see "Deleting TCCAC"
61 And I should see "TCCAC has been completely deleted"
62 And I press "Continue"
64 And I should see the "Course categories and courses" management page
65 And I should see "Cat 1" in the "#category-listing" "css_element"
66 And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
68 Scenario: Delete a course via its management details page
69 Given the following "categories" exist:
70 | name | category 0| idnumber |
72 And the following "courses" exist:
73 | category | fullname | shortname | idnumber |
74 | CAT1 | Test course: create a course | TCCAC | TC3401 |
75 | CAT1 | Test course 2: create another course | TC2CAC | TC3402 |
77 And I log in as "admin"
78 And I go to the courses management page
79 And I should see the "Course categories" management page
80 And I click on category "Cat 1" in the management interface
82 And I should see the "Course categories and courses" management page
83 And I should see "Cat 1" in the "#category-listing" "css_element"
84 And I should see "Test course: create a course" in the "#course-listing" "css_element"
85 And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
86 And I click on course "Test course: create a course" in the management interface
88 And I should see the "Course categories and courses" management page with a course selected
89 And I should see "Cat 1" in the "#category-listing" "css_element"
90 And I should see "Test course: create a course" in the "#course-listing" "css_element"
91 And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
92 And I should see "Test course: create a course" in the "#course-detail" "css_element"
93 And I click on "Delete" "link" in the ".course-detail-listing-actions" "css_element"
95 And I should see "Delete TCCAC"
96 And I should see "Test course: create a course (TCCAC)"
97 And I press "Continue"
99 And I should see "Deleting TCCAC"
100 And I should see "TCCAC has been completely deleted"
101 And I press "Continue"
103 And I should see the "Course categories and courses" management page
104 And I should see "Cat 1" in the "#category-listing" "css_element"
105 And I should see "Test course 2: create another course" in the "#course-listing" "css_element"