[ Index ]

PHP Cross Reference of Unnamed Project

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 and return"
  27      # Redirect
  28      And I should see the "Course categories and courses" management page
  29      And I click on category "Cat 1" in the management interface
  30      # Redirect
  31      And I should see the "Course categories and courses" management page
  32      And I should see "Cat 1" in the "#category-listing" "css_element"
  33      And I should see "Test course: create a course" in the "#course-listing" "css_element"
  34  
  35    Scenario: Delete a course via its management listing
  36      Given the following "categories" exist:
  37        | name | category 0| idnumber |
  38        | Cat 1 | 0 | CAT1 |
  39      And the following "courses" exist:
  40        | category | fullname | shortname | idnumber |
  41        | CAT1 | Test course: create a course | TCCAC | TC3401 |
  42        | CAT1 | Test course 2: create another course | TC2CAC | TC3402 |
  43  
  44      And I log in as "admin"
  45      And I go to the courses management page
  46      And I should see the "Course categories and courses" management page
  47      And I click on category "Cat 1" in the management interface
  48      # Redirect
  49      And I should see the "Course categories and courses" management page
  50      And I should see "Cat 1" in the "#category-listing" "css_element"
  51      And I should see "Test course: create a course" in the "#course-listing" "css_element"
  52      And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
  53      And I click on "delete" action for "Test course: create a course" in management course listing
  54      # Redirect
  55      And I should see "Delete TCCAC"
  56      And I should see "Test course: create a course (TCCAC)"
  57      And I press "Delete"
  58      # Redirect
  59      And I should see "Deleting TCCAC"
  60      And I should see "TCCAC has been completely deleted"
  61      And I press "Continue"
  62      # Redirect
  63      And I should see the "Course categories and courses" management page
  64      And I should see "Cat 1" in the "#category-listing" "css_element"
  65      And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
  66  
  67    Scenario: Delete a course via its management details page
  68      Given the following "categories" exist:
  69        | name | category 0| idnumber |
  70        | Cat 1 | 0 | CAT1 |
  71      And the following "courses" exist:
  72        | category | fullname | shortname | idnumber |
  73        | CAT1 | Test course: create a course | TCCAC | TC3401 |
  74        | CAT1 | Test course 2: create another course | TC2CAC | TC3402 |
  75  
  76      And I log in as "admin"
  77      And I go to the courses management page
  78      And I should see the "Course categories and courses" management page
  79      And I click on category "Cat 1" in the management interface
  80      # Redirect
  81      And I should see the "Course categories and courses" management page
  82      And I should see "Cat 1" in the "#category-listing" "css_element"
  83      And I should see "Test course: create a course" in the "#course-listing" "css_element"
  84      And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
  85      And I click on course "Test course: create a course" in the management interface
  86      # Redirect
  87      And I should see the "Course categories and courses" management page with a course selected
  88      And I should see "Cat 1" in the "#category-listing" "css_element"
  89      And I should see "Test course: create a course" in the "#course-listing" "css_element"
  90      And I should see "Test course 2: create another course" in the "#course-listing" "css_element"
  91      And I should see "Test course: create a course" in the "#course-detail" "css_element"
  92      And I click on "Delete" "link" in the ".course-detail-listing-actions" "css_element"
  93      # Redirect
  94      And I should see "Delete TCCAC"
  95      And I should see "Test course: create a course (TCCAC)"
  96      And I press "Delete"
  97      # Redirect
  98      And I should see "Deleting TCCAC"
  99      And I should see "TCCAC has been completely deleted"
 100      And I press "Continue"
 101      # Redirect
 102      And I should see the "Course categories and courses" management page
 103      And I should see "Cat 1" in the "#category-listing" "css_element"
 104      And I should see "Test course 2: create another course" in the "#course-listing" "css_element"


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1