Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@tool @tool_generator @_file_upload
2
Feature: Create testing scenarios using generators
3
  In order to execute manual tests
4
  As a developer
5
  I need to use a feature file to execute generators into the current instance
6
 
7
  @javascript
8
  Scenario: Create a testing scenario with a course enrolled users and activities
9
    Given I log in as "admin"
10
    And I navigate to "Development > Create testing scenarios" in site administration
11
    When I upload "admin/tool/generator/tests/fixtures/testscenario/scenario.feature" file to "Feature file" filemanager
12
    And I press "Import"
13
    And I should see "Scenario: Create course content"
14
    Then I am on the "C1" "Course" page
15
    And I should see "Activity sample 1" in the "Section 1" "section"
16
    And I should see "Activity sample 2" in the "Section 1" "section"
17
    And I navigate to course participants
18
    And I should see "Teacher Test1"
19
    And I should see "Student Test1"
20
    And I should see "Student Test2"
21
    And I should see "Student Test3"
22
    And I should see "Student Test4"
23
    And I should see "Student Test5"
1441 ariadna 24
    And I set the field "Participants tertiary navigation" to "Enrolment methods"
25
    And I click on "Edit" "link" in the "Manual enrolments" "table_row"
26
    And the field "Send course welcome message" matches value "No"
27
    And I navigate to "Plugins > Enrolments > Manual enrolments" in site administration
28
    And the field "Send course welcome message" matches value "No"
1 efrain 29
 
30
  @javascript
31
  Scenario: Prevent creating a testing scenario with no steps to execute
32
    Given I log in as "admin"
33
    And I navigate to "Development > Create testing scenarios" in site administration
34
    When I upload "admin/tool/generator/tests/fixtures/testscenario/scenario_wrongempty.feature" file to "Feature file" filemanager
35
    And I press "Import"
36
    Then I should see "There are no steps to execute in the file."
37
 
38
  @javascript
39
  Scenario: Prevent creating a testing scenario with only background steps to execute
40
    Given I log in as "admin"
41
    And I navigate to "Development > Create testing scenarios" in site administration
42
    When I upload "admin/tool/generator/tests/fixtures/testscenario/scenario_wrongonlybackground.feature" file to "Feature file" filemanager
43
    And I press "Import"
44
    Then I should see "There are no steps to execute in the file."
45
 
46
  @javascript
47
  Scenario: Prevent creating a testing scenario with a wrong file format
48
    Given I log in as "admin"
49
    And I navigate to "Development > Create testing scenarios" in site administration
50
    When I upload "admin/tool/generator/tests/fixtures/testscenario/scenario_wrongformat.feature" file to "Feature file" filemanager
51
    And I press "Import"
52
    Then I should see "Error parsing feature file"
53
 
54
  @javascript
55
  Scenario: Prevent creating a testing scenario with non generator steps
56
    Given I log in as "admin"
57
    And I navigate to "Development > Create testing scenarios" in site administration
58
    When I upload "admin/tool/generator/tests/fixtures/testscenario/scenario_wrongstep.feature" file to "Feature file" filemanager
59
    And I press "Import"
60
    Then I should see "The file format is not valid or contains invalid steps"
61
 
62
  @javascript
1441 ariadna 63
  Scenario: Create a testing scenario from a scenario outline
1 efrain 64
    Given I log in as "admin"
65
    And I navigate to "Development > Create testing scenarios" in site administration
1441 ariadna 66
    When I upload "admin/tool/generator/tests/fixtures/testscenario/scenario_outline.feature" file to "Feature file" filemanager
1 efrain 67
    And I press "Import"
1441 ariadna 68
    And I should see "Example: creating test scenarios using an outline (1)"
69
    And I should see "Example: creating test scenarios using an outline (2)"
70
    And I should see "Example: creating test scenarios using an outline (3)"
71
    Then I am on the "C1" "Course" page
72
    And I should see "Course 1" in the "page-header" "region"
73
    And I am on the "C2" "Course" page
74
    And I should see "Course 2" in the "page-header" "region"
75
    And I am on the "C3" "Course" page
76
    And I should see "Course 3" in the "page-header" "region"
77
 
78
  @javascript
79
  Scenario: Run cleanup steps after creating a testing scenario
80
    Given I log in as "admin"
81
    And I navigate to "Development > Create testing scenarios" in site administration
82
    And I upload "admin/tool/generator/tests/fixtures/testscenario/scenario_cleanup.feature" file to "Feature file" filemanager
83
    And I press "Import"
84
    And I should see "Scenario: Create course content to cleanup later"
85
    And I navigate to "Courses > Manage courses and categories" in site administration
86
    And I should see "Course cleanup" in the "course-listing" "region"
87
    And I navigate to "Users > Accounts > Browse list of users" in site administration
88
    And I should see "Teacher Test1"
89
    And I navigate to "Development > Create testing scenarios" in site administration
90
    When I upload "admin/tool/generator/tests/fixtures/testscenario/scenario_cleanup.feature" file to "Feature file" filemanager
91
    And I set the field "Execute" to "Cleanup scenarios"
92
    And I press "Import"
93
    And I should see "the course \"Course cleanup\" is deleted"
94
    And I should see "the user \"cleanteacher\" is deleted"
95
    Then I navigate to "Courses > Manage courses and categories" in site administration
96
    And I should not see "Course cleanup" in the "course-listing" "region"
97
    And I navigate to "Users > Accounts > Browse list of users" in site administration
98
    And I should not see "Teacher Test1"
99
 
100
  Scenario: All available steps are listed in the tool to create testing scenarios
101
    Given I log in as "admin"
102
    When I navigate to "Development > Create testing scenarios" in site administration
103
    Then I should see "This is the list of steps that can be used in the test scenario feature file"
104
    And I should see "And the following \"activities\" exist"
105
    And I should see "And \"5\" \"course enrolments\" exist with the following data"
106
    And I should see "And the following \"course\" exists"
107
    And I should see "And the following config values are set as admin"
108
    And I should see "I enable \"subsection\" \"mod\" plugin"
109
    And I should see "I disable \"page\" \"mod\" plugin"
110
    And I should see "And the course \"Course test\" is deleted"
111
    And I should see "And the user student1 is deleted"