i_am_on_page.feature 5.18 KB
Newer Older
1
2
3
4
5
6
7
@tool @tool_behat
Feature: Use core page resolvers for the I am on the page steps
  In order to write tests correctly
  As a developer
  I need to have steps which take me straight to a page

  Scenario Outline: When I am on an instance
8
9
10
11
    Given the following "categories" exist:
      | name  | category | idnumber |
      | Cat 1 | 0        | CAT1     |
    And the following "course" exists:
12
13
14
15
16
17
18
19
20
21
22
23
24
      | fullname  | Economics 101 |
      | shortname | ECON101       |
      | idnumber  | 2021-econ101  |
    And the following "activity" exists:
      | course   | ECON101                   |
      | activity | forum                     |
      | name     | Fundamentals of Economics |
      | idnumber | fundamentalsofeconomics   |
    And I log in as "admin"
    When I am on the <identifier> <type> page
    Then I should see "<shouldsee>"

    Examples:
25
      | description              | identifier                  | type                         | shouldsee                  |
26
27
      | Course Category idnumber | CAT1                        | category                     | Add a new course           |
      | Course Category name     | "Cat 1"                     | Category                     | Add a new course           |
28
29
30
31
      | Course Full name         | "Economics 101"             | course                       | Fundamentals of Economics  |
      | Course Short name        | ECON101                     | COURSE                       | Fundamentals of Economics  |
      | Course idnumber          | "2021-econ101"              | Course                       | Fundamentals of Economics  |
      | Forum idnumber           | fundamentalsofeconomics     | Activity                     | Add a new discussion       |
32
      | Generic activity editing | fundamentalsofeconomics     | "Activity editing"           | Updating: Forum            |
33
34
      | Forum name               | "Fundamentals of Economics" | "Forum activity"             | Add a new discussion       |
      | Forum name editing       | "Fundamentals of Economics" | "Forum activity editing"     | Updating: Forum            |
35
36
      | Forum name permissions   | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun  |
      | Forum name roles         | "Fundamentals of Economics" | "Forum activity roles"       | Assign roles in Forum: Fun |
37
38

  Scenario Outline: When I am on an instance logged in as
39
40
41
42
    Given the following "categories" exist:
      | name  | category | idnumber |
      | Cat 1 | 0        | CAT1     |
    And the following "course" exists:
43
44
45
46
47
48
49
50
51
52
53
54
      | fullname  | Economics 101 |
      | shortname | ECON101       |
      | idnumber  | 2021-econ101  |
    And the following "activity" exists:
      | course   | ECON101                   |
      | activity | forum                     |
      | name     | Fundamentals of Economics |
      | idnumber | fundamentalsofeconomics   |
    When I am on the <identifier> <type> page logged in as admin
    Then I should see "<shouldsee>"

    Examples:
55
      | description              | identifier                  | type                         | shouldsee                  |
56
57
      | Course Category idnumber | CAT1                        | category                     | Add a new course           |
      | Course Category name     | "Cat 1"                     | Category                     | Add a new course           |
58
59
60
61
      | Course Full name         | "Economics 101"             | course                       | Fundamentals of Economics  |
      | Course Short name        | ECON101                     | COURSE                       | Fundamentals of Economics  |
      | Course idnumber          | "2021-econ101"              | Course                       | Fundamentals of Economics  |
      | Forum idnumber           | fundamentalsofeconomics     | Activity                     | Add a new discussion       |
62
      | Generic activity editing | fundamentalsofeconomics     | "Activity editing"           | Updating: Forum            |
63
64
      | Forum name               | "Fundamentals of Economics" | "Forum activity"             | Add a new discussion       |
      | Forum name editing       | "Fundamentals of Economics" | "Forum activity editing"     | Updating: Forum            |
65
66
      | Forum name permissions   | "Fundamentals of Economics" | "Forum activity permissions" | Permissions in Forum: Fun  |
      | Forum name roles         | "Fundamentals of Economics" | "Forum activity roles"       | Assign roles in Forum: Fun |
67
68
69
70
71
72
73
74

  Scenario Outline: When I am on a named page
    Given I log in as "admin"
    When I am on the <identifier> page
    Then I should see "<shouldsee>"

    Examples:
      | description | identifier | shouldsee                   |
75
      | Admin page  | "Admin notifications"      | Check for available updates |
76
77
78
79
80
81
82
83
      | Home page   | Homepage   | Recently accessed courses   |

  Scenario Outline: When I am on a named page logged in as
    When I am on the <identifier> page logged in as admin
    Then I should see "<shouldsee>"

    Examples:
      | description | identifier            | shouldsee                   |
84
      | Admin page  | "Admin notifications" | Check for available updates |
85
      | Home page   | Homepage              | Recently accessed courses   |