Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@core @core_course
2
Feature: Browse course list and return back from enrolment page
3
  In order to navigate between course list consistently
4
  As a user
5
  I need to be able to return back from enrolment page
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | user1 | User | 1 | user1@example.com |
11
      | user2 | User | 2 | user2@example.com |
12
    And the following "categories" exist:
13
      | name | category | idnumber |
14
      | Sample category | 0 | CAT1 |
15
    And the following "courses" exist:
16
      | fullname      | shortname | category |
17
      | Sample course | C1        | 0        |
18
      | Course 1      | COURSE1   | CAT1     |
19
 
20
  Scenario: A user can return to the category page from enrolment page
21
    When I log in as "user2"
22
    And I am on course index
23
    And I follow "Category 1"
24
    And I follow "Sample course"
25
    And I press "Continue"
26
    Then I should see "Courses" in the ".breadcrumb" "css_element"
27
    And I click on "Courses" "link" in the ".breadcrumb" "css_element"
28
    And I follow "Sample category"
29
    And I am on "Course 1" course homepage
30
    And I press "Continue"
31
    And I should see "Sample category" in the ".breadcrumb" "css_element"
32
 
33
  @javascript
34
  Scenario: A user can return to the previous page from enrolment page by clicking navigation links
35
    Given I log in as "admin"
36
    And I am on site homepage
37
    And I turn editing mode on
38
    And the following config values are set as admin:
39
      | unaddableblocks | | theme_boost|
40
    And I add the "Navigation" block if not present
41
    And I configure the "Navigation" block
42
    And I set the following fields to these values:
43
      | Page contexts | Display throughout the entire site |
44
    And I press "Save changes"
45
    And I log out
46
    When I log in as "user2"
47
    And I change window size to "large"
48
    And I open my profile in edit mode
49
    And I expand "Courses" node
50
    And I expand "Sample category" node
51
    And I follow "Course 1"
52
    And I press "Continue"
53
    Then I should see "Edit profile" in the ".breadcrumb" "css_element"
54
 
55
  Scenario: User can return to the choice activity from enrolment page
56
    Given the following "roles" exist:
57
      | name                   | shortname | description      | archetype      |
58
      | Non-enrolled           | custom1   | My custom role 1 | user           |
59
    And the following "role assigns" exist:
60
      | user  | role           | contextlevel | reference |
61
      | user1 | custom1        | Course       | C1        |
62
    And the following "activities" exist:
63
      | activity   | name        | intro                         | course | idnumber    |
64
      | choice     | Test choice | Test choice description       | C1     | choice1     |
65
    And the following "role capability" exists:
66
      | role               | custom1 |
67
      | moodle/course:view | allow   |
68
    When I log in as "user1"
69
    And I am on course index
70
    And I follow "Category 1"
71
    And I follow "Sample course"
72
    And I follow "Test choice"
73
    And I should see "Sorry, only enrolled users are allowed to make choices."
74
    And I press "Enrol me in this course"
75
    And I press "Continue"
76
    Then I should see "Test choice" in the ".breadcrumb" "css_element"