Ignore:
Timestamp:
May 2, 2016, 12:09:23 PM (3 years ago)
Author:
jrpelegrina
Message:

Updated to moodle 3.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moodle/trunk/fuentes/availability/tests/behat/edit_availability.feature

    r136 r1331  
    3131  Scenario: Confirm the 'enable availability' option is working
    3232    When I log in as "teacher1"
     33    And I am on site homepage
    3334    And I follow "Course 1"
    3435    And I turn editing mode on
     
    4041    Then "Restrict access" "fieldset" should not exist
    4142
    42     When I log out
    43     And I log in as "admin"
    44     And I set the following administration settings values:
    45       | Enable conditional access | 1 |
    46 
    47     When I log out
    48     And I log in as "teacher1"
    49     And I follow "Course 1"
    50     And I turn editing mode on
     43    And the following config values are set as admin:
     44      | enableavailability | 1 |
     45
     46    And I am on site homepage
     47    And I follow "Course 1"
    5148    And I add a "Page" to section "1"
    5249    Then "Restrict access" "fieldset" should exist
     
    5956  Scenario: Edit availability using settings in activity form
    6057    # Set up.
    61     Given I log in as "admin"
    62     And I set the following administration settings values:
    63       | Enable conditional access | 1 |
    64     And I log out
     58    Given the following config values are set as admin:
     59      | enableavailability | 1 |
    6560    And I log in as "teacher1"
    6661    And I follow "Course 1"
     
    154149  Scenario: Edit availability using settings in section form
    155150    # Set up.
    156     Given I log in as "admin"
    157     And I set the following administration settings values:
    158       | Enable conditional access | 1 |
    159     And I log out
     151    Given the following config values are set as admin:
     152      | enableavailability | 1 |
    160153    And I log in as "teacher1"
     154    And I am on site homepage
    161155    And I follow "Course 1"
    162156    And I turn editing mode on
     
    173167    And "Restriction type" "select" should be visible
    174168    And I should see "Date" in the "Restrict access" "fieldset"
     169
     170  @javascript
     171  Scenario: 'Add group/grouping access restriction' button unavailable
     172    # Button does not exist when conditional access restrictions are turned off.
     173    Given I log in as "admin"
     174    And I am on site homepage
     175    And I follow "Course 1"
     176    And I turn editing mode on
     177    And I add a "Forum" to section "1"
     178    When I expand all fieldsets
     179    Then "Add group/grouping access restriction" "button" should not exist
     180
     181  @javascript
     182  Scenario: Use the 'Add group/grouping access restriction' button
     183    # Button should initially be disabled.
     184    Given the following config values are set as admin:
     185      | enableavailability | 1 |
     186    And the following "groupings" exist:
     187      | name | course | idnumber |
     188      | GX1  | C1     | GXI1     |
     189    And I log in as "admin"
     190    And I am on site homepage
     191    And I follow "Course 1"
     192    And I turn editing mode on
     193    And I add a "Forum" to section "1"
     194    And I set the following fields to these values:
     195      | Forum name  | MyForum |
     196      | Description | x       |
     197    When I expand all fieldsets
     198    Then the "Add group/grouping access restriction" "button" should be disabled
     199
     200    # Turn on separate groups.
     201    And I set the field "Group mode" to "Separate groups"
     202    And the "Add group/grouping access restriction" "button" should be enabled
     203
     204    # Press the button and check it adds a restriction and disables itself.
     205    And I should see "None" in the "Restrict access" "fieldset"
     206    And I press "Add group/grouping access restriction"
     207    And I should see "Group" in the "Restrict access" "fieldset"
     208    And the "Add group/grouping access restriction" "button" should be disabled
     209
     210    # Delete the restriction and check it is enabled again.
     211    And I click on "Delete" "link" in the "Restrict access" "fieldset"
     212    And the "Add group/grouping access restriction" "button" should be enabled
     213
     214    # Try a grouping instead.
     215    And I set the field "Grouping" to "GX1"
     216    And I press "Add group/grouping access restriction"
     217    And I should see "Grouping" in the "Restrict access" "fieldset"
     218
     219    # Check the button still works after saving and editing.
     220    And I press "Save and display"
     221    And I navigate to "Edit settings" node in "Forum administration"
     222    And I expand all fieldsets
     223    And the "Add group/grouping access restriction" "button" should be disabled
     224    And I should see "Grouping" in the "Restrict access" "fieldset"
     225
     226    # And check it's still active if I delete the condition.
     227    And I click on "Delete" "link" in the "Restrict access" "fieldset"
     228    And the "Add group/grouping access restriction" "button" should be enabled
Note: See TracChangeset for help on using the changeset viewer.