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_availabilityconditions
2
Feature: Manage availability conditions
3
  In order to control availability restrictions
4
  As an administrator
5
  I need to see the list of restrictions and hide or show them
6
 
7
  @javascript
8
  Scenario: Display list of availability conditions
9
    # Check the report doesn't show when not enabled.
10
    Given the following config values are set as admin:
11
      | unaddableblocks | | theme_boost|
12
    And I log in as "admin"
13
    And I turn editing mode on
14
    And I add the "Administration" block if not present
15
    And the following config values are set as admin:
16
      | enableavailability | 0 |
17
    And I expand "Site administration" node
18
    When I expand "Plugins" node
19
    Then I should not see "Availability restrictions"
20
 
21
    # Enable it and check I can now see and click on it.
22
    And the following config values are set as admin:
23
      | enableavailability | 1 |
24
    And I am on homepage
25
    And I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration
26
 
27
    # Having clicked on it, I should also see the list of plugins.
28
    And I should see "Restriction by date"
29
    And I should see "Restriction by grades"
30
 
31
  @javascript
32
  Scenario: Hide and show conditions
33
    # Get to the right page
34
    Given the following "courses" exist:
35
      | fullname | shortname | format |
36
      | Course 1 | C1        | topics |
37
    And the following "activity" exists:
38
      | activity | page |
39
      | course   | C1   |
40
      | name     | P1   |
41
    And I log in as "admin"
42
    When I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration
43
 
44
    # Check the icon is there (it should be a Hide icon, meaning is currently visible).
45
    Then "Hide" "icon" should exist in the "Restriction by date" "table_row"
46
 
1441 ariadna 47
    # Click the icon. It should toggle to disabled.
48
    And I toggle the "Disable Restriction by date" admin switch "off"
49
    And I should see "Restriction by date disabled."
1 efrain 50
 
51
    # Toggle it back to visible (title=Hide).
1441 ariadna 52
    And I toggle the "Enable Restriction by date" admin switch "on"
53
    And I should see "Restriction by date enabled."
1 efrain 54
 
55
    # OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
1441 ariadna 56
    And I toggle the "Disable Restriction by grade" admin switch "off"
1 efrain 57
    And I am on the "P1" "page activity editing" page
58
    And I expand all fieldsets
59
    And I click on "Add restriction..." "button"
60
    And "Add restriction..." "dialogue" should be visible
61
    And "Date" "button" should exist in the "Add restriction..." "dialogue"
62
    And "Grade" "button" should not exist in the "Add restriction..." "dialogue"