[ Index ]

PHP Cross Reference of moodle-2.8

title

Body

[close]

/course/tests/behat/ -> create_delete_course.feature (source)

   1  @core @core_course
   2  Feature: Test we can both create and delete a course.
   3    As a Moodle admin
   4    I need to test I can create a course
   5    I need to test I can delete a course
   6  
   7    Scenario: Create a course
   8      Given the following "categories" exist:
   9        | name | category 0| idnumber |
  10        | Cat 1 | 0 | CAT1 |
  11  
  12      And I log in as "admin"
  13      And I go to the courses management page
  14      And I should see the "Course categories and courses" management page
  15      And I click on category "Cat 1" in the management interface
  16      # Redirect
  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"
  27      # Redirect
  28      And I go to the courses management page
  29      And I should see the "Course categories and courses" management page
  30      And I click on category "Cat 1" in the management interface
  31      # Redirect
  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"
  35  
  36    Scenario: Delete a course via its management listing
  37      Given the following "categories" exist:
  38        | name | category 0| idnumber |
  39        | Cat 1 | 0 | CAT1 |
  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 |
  44  
  45      And I log in as "admin"
  46      And I go to the courses management page
  47      And I should see the "Course categories and courses" management page
  48      And I click on category "Cat 1" in the management interface
  49      # Redirect
  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
  55      # Redirect
  56      And I should see "Delete TCCAC"
  57      And I should see "Test course: create a course (TCCAC)"
  58      And I press "Continue"
  59      # Redirect
  60      And I should see "Deleting TCCAC"
  61      And I should see "TCCAC has been completely deleted"
  62      And I press "Continue"
  63      # Redirect
  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"
  67  
  68    Scenario: Delete a course via its management details page
  69      Given the following "categories" exist:
  70        | name | category 0| idnumber |
  71        | Cat 1 | 0 | CAT1 |
  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 |
  76  
  77      And I log in as "admin"
  78      And I go to the courses management page
  79      And I should see the "Course categories and courses" management page
  80      And I click on category "Cat 1" in the management interface
  81      # Redirect
  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
  87      # Redirect
  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"
  94      # Redirect
  95      And I should see "Delete TCCAC"
  96      And I should see "Test course: create a course (TCCAC)"
  97      And I press "Continue"
  98      # Redirect
  99      And I should see "Deleting TCCAC"
 100      And I should see "TCCAC has been completely deleted"
 101      And I press "Continue"
 102      # Redirect
 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"


Generated: Fri Nov 28 20:29:05 2014 Cross-referenced by PHPXref 0.7.1