Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@format @format_singleactivity
2
Feature: Activity navigation in a single activity course
3
  In order to quickly switch to another activity in a single activity course with multiple (hidden) activities
4
  As a teacher
5
  I need to use the activity navigation controls in activities
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username  | firstname  | lastname  | email                 |
10
      | teacher1  | Teacher    | 1         | teacher1@example.com  |
11
      | student1  | Student    | 1         | student1@example.com  |
12
      | student2  | Student    | 2         | student2@example.com  |
13
    And the following "courses" exist:
14
      | fullname | shortname | format         | activitytype |
15
      | Course 1 | C1        | singleactivity | forum        |
16
    And the following "course enrolments" exist:
17
      | user      | course  | role            |
18
      | student1  | C1      | student         |
19
      | teacher1  | C1      | editingteacher  |
20
    And the following "activities" exist:
21
      | activity   | name         | intro                       | course | idnumber  | section |
22
      | assign     | Assignment 1 | Test assignment description | C1     | assign1   | 0       |
23
      | lesson     | Lesson 1     | Test lesson description     | C1     | lesson1   | 0       |
24
      | forum      | Forum 1      | Test forum description      | C1     | forum1    | 0       |
25
 
26
  Scenario: Step through hidden activities in the course as a teacher.
27
    Given I log in as "teacher1"
28
    When I am on "Course 1" course homepage
29
    # The first activity (Forum 1) won't have the previous activity link.
30
    Then "#prev-activity-link" "css_element" should not exist
31
    And I should see "Assignment 1 (hidden)" in the "#next-activity-link" "css_element"
32
    And I follow "Assignment 1 (hidden)"
33
    And I should see "Forum 1" in the "#prev-activity-link" "css_element"
34
    And I should see "Lesson 1 (hidden)" in the "#next-activity-link" "css_element"
35
    And I follow "Lesson 1 (hidden)"
36
    And I should see "Assignment 1 (hidden)" in the "#prev-activity-link" "css_element"
37
    And "#next-activity-link" "css_element" should not exist
38
 
39
  Scenario: Jump to a hidden activity as a teacher
40
    Given I log in as "teacher1"
41
    When I am on "Course 1" course homepage
42
    Then "Jump to..." "field" should exist
43
    # The current activity (Forum 1) will not be listed.
44
    And the "Jump to..." select box should not contain "Forum 1"
45
    # Check drop down menu contents.
46
    And the "Jump to..." select box should contain "Assignment 1 (hidden)"
47
    And the "Jump to..." select box should contain "Lesson 1 (hidden)"
48
    # Jump to a hidden activity somewhere in the middle.
49
    When I select "Assignment 1 (hidden)" from the "Jump to..." singleselect
50
    Then I should see "Assignment 1"
51
    And I should see "Forum 1" in the "#prev-activity-link" "css_element"
52
    And I should see "Lesson 1 (hidden)" in the "#next-activity-link" "css_element"
53
    # Jump to the first activity.
54
    And I select "Forum 1" from the "Jump to..." singleselect
55
    And I should see "Assignment 1 (hidden)" in the "#next-activity-link" "css_element"
56
    But "#prev-activity-link" "css_element" should not exist
57
    # Jump to the last activity.
58
    And I select "Lesson 1 (hidden)" from the "Jump to..." singleselect
59
    And I should see "Assignment 1 (hidden)" in the "#prev-activity-link" "css_element"
60
    But "#next-activity-link" "css_element" should not exist
61
 
62
  Scenario: The activity navigation controls are not available as a student.
63
    Given I log in as "student1"
64
    And I am on "Course 1" course homepage
65
    # The first activity won't have the previous activity link.
66
    Then "#prev-activity-link" "css_element" should not exist
67
    And "#next-activity-link" "css_element" should not exist
68
    And "Jump to..." "field" should not exist
69
 
70
  Scenario: The activity navigation asks for login to guest user
71
    Given I log in as "guest"
72
    When I am on "Course 1" course homepage
73
    Then I should see "Guests cannot access this course. Please log in"
74
 
75
  Scenario: The activity navigation asks for login to not enrolled user
76
    Given I log in as "student2"
77
    When I am on "Course 1" course homepage
78
    Then I should see "You cannot enrol yourself in this course"
79
 
80
  Scenario: The single activity course format supports multilang course names
81
    Given the "multilang" filter is "on"
82
    And the "multilang" filter applies to "content and headings"
83
    When I am on the "Course 1" "course editing" page logged in as "teacher1"
84
    And I expand all fieldsets
85
    And I set the field "Course full name" in the "General" "fieldset" to "<span lang=\"de\" class=\"multilang\">Kurs</span><span lang=\"en\" class=\"multilang\">Course</span> 1"
86
    And I click on "Save and display" "button"
87
    Then I should see "Course 1" in the ".page-header-headings" "css_element"
88
    And I should not see "KursCourse 1" in the ".page-header-headings" "css_element"