source: moodle/trunk/fuentes/admin/tool/uploadcourse/tests/behat/create.feature @ 136

Last change on this file since 136 was 136, checked in by mabarracus, 4 years ago

Ported code to xenial

File size: 1.8 KB
Line 
1@tool @tool_uploadcourse @_file_upload
2Feature: An admin can create courses using a CSV file
3  In order to create courses using a CSV file
4  As an admin
5  I need to be able to upload a CSV file and navigate through the import process
6
7  Background:
8    Given the following "courses" exist:
9      | fullname | shortname | category |
10      | First course | C1 | 0 |
11    And I log in as "admin"
12    And I navigate to "Upload courses" node in "Site administration > Courses"
13
14  @javascript
15  Scenario: Creation of unexisting courses
16    Given I upload "admin/tool/uploadcourse/tests/fixtures/courses.csv" file to "File" filemanager
17    And I click on "Preview" "button"
18    When I click on "Upload courses" "button"
19    Then I should see "The course exists and update is not allowed"
20    And I should see "Course created"
21    And I should see "Courses total: 3"
22    And I should see "Courses created: 2"
23    And I should see "Courses errors: 1"
24    And I follow "Home"
25    And I should see "Course 2"
26    And I should see "Course 3"
27
28  @javascript
29  Scenario: Creation of existing courses
30    Given I upload "admin/tool/uploadcourse/tests/fixtures/courses.csv" file to "File" filemanager
31    And I set the field "Upload mode" to "Create all, increment shortname if needed"
32    And I click on "Preview" "button"
33    When I click on "Upload courses" "button"
34    Then I should see "Course created"
35    And I should see "Course shortname incremented C1 -> C2"
36    And I should see "Course shortname incremented C2 -> C3"
37    And I should see "Course shortname incremented C3 -> C4"
38    And I should see "Courses total: 3"
39    And I should see "Courses created: 3"
40    And I should see "Courses errors: 0"
41    And I follow "Home"
42    And I should see "Course 1"
43    And I should see "Course 2"
44    And I should see "Course 3"
Note: See TracBrowser for help on using the repository browser.