Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@eWallah @availability @availability_relativedate
2
Feature: availability_relativedate delete relative activities
3
  In order to use conditions that are based on other activities
4
  As a teacher
5
  I need to be able to delete activities that are part of the condition without errors
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username |
10
      | student1 |
11
      | teacher1 |
12
    And the following config values are set as admin:
13
      | enableavailability  | 1 |        |
14
    And the following "course" exists:
15
      | fullname          | Course 1             |
16
      | shortname         | C1                   |
17
      | category          | 0                    |
18
      | enablecompletion  | 1                    |
19
      | startdate         | ## -10 days 17:00 ## |
20
      | enddate           | ## +2 weeks 17:00 ## |
21
    And the following "course enrolments" exist:
22
      | user     | course | role           |
23
      | student1 | C1     | student        |
24
      | teacher1 | C1     | editingteacher |
25
 
26
  @javascript
27
  Scenario Outline: Delete a module that is part of a Relative condition in a section
28
    Given the following "activities" exist:
29
      | activity   | name | course | idnumber | section | completion |
30
      | <activity> | Act1 | C1     | id1      | 1       | 1          |
31
    And I log in as "teacher1"
32
    And I am on "Course 1" course homepage with editing mode on
33
    And I edit the section "1"
34
    And I expand all fieldsets
35
    And I press "Add restriction..."
36
    And I click on "Relative date" "button" in the "Add restriction..." "dialogue"
37
    And I set the field "relativenumber" to "1"
38
    And I set the field "relativednw" to "1"
39
    And I set the field "relativestart" to "7"
40
    And I set the field "relativecoursemodule" to "Act1"
41
    When I press "Save changes"
42
    And I should see "1 hour after completion of activity Act1"
43
    And I delete "Act1" activity
44
    And I should see "1 hour after completion of activity Act1"
45
    And I reload the page
46
    And I run all adhoc tasks
47
    And I log out
48
    And I am on the "C1" "Course" page logged in as "student1"
49
    Then I should not see "Act1" in the "region-main" "region"
50
    And I should see "1 hour after completion of activity (missing)"
51
 
52
    Examples:
53
      | activity |
54
      | lesson   |
55
      | page     |
56
 
57
  @javascript
58
  Scenario Outline: Relative condition for each module
59
    Given the following "activities" exist:
60
      | activity   | name | course | idnumber | section | completion |
61
      | <activity> | Act1 | C1     | id1      | 1       | 1          |
62
      | <activity> | Act2 | C1     | id2      | 1       | 1          |
63
    And I log in as "teacher1"
64
    And I am on "Course 1" course homepage with editing mode on
65
    And I open "Act2" actions menu
66
    And I click on "Edit settings" "link" in the "Act2" activity
67
    And I expand all fieldsets
68
    And I click on "Add restriction..." "button"
69
    When I click on "Relative date" "button" in the "Add restriction..." "dialogue"
70
    And I set the field "relativenumber" to "1"
71
    And I set the field "relativednw" to "1"
72
    And I set the field "relativestart" to "7"
73
    And I set the field "relativecoursemodule" to "Act1"
74
    And I press "Save and return to course"
75
    And I should see "1 hour after completion of activity Act1"
76
    And I delete "Act1" activity
77
    And I should see "1 hour after completion of activity Act1"
78
    And I reload the page
79
    And I run all adhoc tasks
80
    And I log out
81
    And I am on the "C1" "Course" page logged in as "student1"
82
    Then I should see "Act2" in the "region-main" "region"
83
    And I should see "1 hour after completion of activity (missing)"
84
 
85
    Examples:
86
      | activity |
87
      | book     |
88
      | url      |