Tests: Add test cases for courses management

1.10.x
Yannick Warnier 11 years ago
parent 445916af25
commit 450039cd7b
  1. 2
      main/admin/course_list.php
  2. 42
      tests/features/createCourse.feature

@ -338,7 +338,7 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
}
// Create a search-box
$form = new FormValidator('search_simple', 'get', '', '', array(), FormValidator::LAYOUT_INLINE);
$form->addElement('text', 'keyword', null);
$form->addElement('text', 'keyword', null, array('id' => 'course-search-keyword'));
$form->addButtonSearch(get_lang('SearchCourse'));
$form->addElement('static', 'search_advanced_link', null, '<a href="course_list.php?search=advanced">'.get_lang('AdvancedSearch').'</a>');

@ -0,0 +1,42 @@
@administration
Feature: Courses management as admin
In order to add courses
As an administrator
I need to be able to create new courses from the admin page
Scenario: See the courses list
Given I am a platform administrator
And I am on "/main/admin/course_list.php"
Then I should see "Course list"
And I should not see "not authorized"
Scenario: See the course creation link on the courses list page
Given I am a platform administrator
And I am on "/main/admin/course_list.php"
Then I should see "Create a course"
Scenario: See the course creation link on the admin page
Given I am a platform administrator
And I am on "/main/admin/index.php"
Then I should see "Create a course"
Scenario: Access the course creation page
Given I am a platform administrator
And I am on "/main/admin/course_add.php"
Then I should not see "not authorized"
Scenario: Access the course creation page
Given I am a platform administrator
And I am on "/main/admin/course_add.php"
When I fill in "title" with "TESTCOURSE1"
And I press "submit"
Then I should see "Course list"
Scenario: Search and delete a course
Given I am a platform administrator
And I am on "/main/admin/course_list.php"
And I fill in "course-search-keyword" with "TESTCOURSE1"
And I press "submit"
When I follow "Delete"
Then I should see "Course list"
And I should not see "not be deleted"
Loading…
Cancel
Save