Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@availability @availability_completion
2
Feature: Confirm that conditions on completion no longer cause a bug
3
  In order to use completion conditions
4
  As a teacher
5
  I need it to not break when I set up certain conditions on some modules
6
 
7
  Background:
8
    Given the following "courses" exist:
9
      | fullname | shortname | format | enablecompletion |
10
      | Course 1 | C1        | topics | 1                |
11
    And the following "users" exist:
12
      | username |
13
      | teacher1 |
14
    And the following "course enrolments" exist:
15
      | user     | course | role           |
16
      | teacher1 | C1     | editingteacher |
17
 
18
  @javascript
19
  Scenario: Multiple completion conditions on glossary
20
    # Add a couple of Pages with manual completion.
21
    And the following "activities" exist:
22
      | activity | course | name  | completion |
23
      | page     | C1     | Page1 | 1          |
24
      | page     | C1     | Page2 | 1          |
25
    And I log in as "teacher1"
26
    # Add a Glossary.
27
    When I add a glossary activity to course "Course 1" section "1"
28
    And I set the following fields to these values:
29
      | Name | TestGlossary |
30
    And I expand all fieldsets
31
 
32
    # Add restrictions to the previous Pages being complete.
33
    And I press "Add restriction..."
34
    And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
35
    And I set the field "Activity or resource" to "Page1"
36
    And I press "Add restriction..."
37
    And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
38
    And I set the field with xpath "//div[contains(concat(' ', normalize-space(@class), ' '), ' availability-item ')][preceding-sibling::div]//select[@name='cm']" to "Page2"
39
    And I press "Save and return to course"
40
    And I click on "Show more" "button" in the "TestGlossary" "core_availability > Activity availability"
41
    Then I should see "Not available unless:" in the ".activity.glossary" "css_element"
42
    And I should see "The activity Page1 is marked complete" in the ".activity.glossary" "css_element"
43
    And I should see "The activity Page2 is marked complete" in the ".activity.glossary" "css_element"
44
 
45
    # Behat will automatically check there is no error on this page.
46
    And I am on the TestGlossary "glossary activity" page
47
    And I should see "TestGlossary"