Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@mod @mod_resource
2
Feature: Teacher can specify different display options for the resource
3
  In order to provide more information about a file
4
  As a teacher
5
  I need to be able to show size, type and modified date
6
 
7
  Background:
8
    Given the following "users" exist:
9
      | username | firstname | lastname | email |
10
      | student1 | Student | 1 | student1@example.com |
11
      | teacher1 | Teacher | 1 | teacher1@example.com |
12
    And the following "courses" exist:
13
      | fullname | shortname | category |
14
      | Course 1 | C1 | 0 |
15
    And the following "course enrolments" exist:
16
      | user | course | role |
17
      | teacher1 | C1 | editingteacher |
18
      | student1 | C1 | student |
19
    And the following "activities" exist:
20
      | activity | course | name   | intro        | defaultfilename                            | uploaded |
21
      | resource | C1     | Myfile | My cool file | mod/resource/tests/fixtures/samplefile.txt | 1        |
22
    And I log in as "teacher1"
23
    And I am on "Course 1" course homepage with editing mode on
24
 
25
  Scenario: Specifying no additional display options for a file resource
26
    When I am on the "Myfile" "resource activity editing" page
27
    And I set the following fields to these values:
28
      | Show upload/modified date | 0 |
29
      | showsize                  | 0 |
30
      | showtype                  | 0 |
31
    And I press "Save and display"
32
    Then ".resourcedetails" "css_element" should not exist
33
    And I am on "Course 1" course homepage
34
    And ".activity.resource .resourcelinkdetails" "css_element" should not exist
35
 
36
  Scenario Outline: Specifying different display options for a file resource
37
    When I am on the "Myfile" "resource activity editing" page
38
    And I set the following fields to these values:
39
      | display                   | 5          |
40
      | Show size                 | <showsize> |
41
      | Show type                 | <showtype> |
42
      | Show upload/modified date | <showdate> |
43
    And I press "Save and display"
44
    Then I <seesize> see "6 bytes" in the ".resourcedetails" "css_element"
45
    And I <seetype> see "TXT" in the ".resourcedetails" "css_element"
46
    And I <seedate> see "Uploaded" in the ".resourcedetails" "css_element"
47
    And I am on "Course 1" course homepage
48
    And I <seesize> see "6 bytes" in the ".activity.resource .resourcelinkdetails" "css_element"
49
    And I <seetype> see "TXT" in the ".activity.resource .activitybadge" "css_element"
50
    And I <seedate> see "Uploaded" in the ".activity.resource .resourcelinkdetails" "css_element"
51
    Examples:
52
      | showsize | showtype | showdate | seesize    | seetype    | seedate    |
53
      | 1        | 0        | 0        | should     | should not | should not |
54
      | 0        | 0        | 1        | should not | should not | should     |
55
      | 1        | 1        | 0        | should     | should     | should not |
56
      | 1        | 0        | 1        | should     | should not | should     |
57
      | 0        | 1        | 1        | should not | should     | should     |
58
      | 1        | 1        | 1        | should     | should     | should     |
59
 
60
  Scenario Outline: Specify different display options for an embedded file resource
61
    When I am on the "Myfile" "resource activity editing" page
62
    And I set the following fields to these values:
63
      | display                      | Embed      |
64
      | Show type                    | <showtype> |
65
      | Display resource description | <showdesc> |
66
    And I press "Save and display"
67
    Then I <seetype> see "TXT" in the "region-main" "region"
68
    And I <seedesc> see "My cool file" in the "region-main" "region"
69
    Examples:
70
      | showtype | showdesc | seetype    | seedesc    |
71
      | 1        | 0        | should     | should not |
72
      | 1        | 1        | should     | should     |
73
      | 0        | 1        | should not | should     |
74
      | 0        | 0        | should not | should not |
75
 
76
  Scenario: Specifying only show type for a file resource
77
    When I am on the "Myfile" "resource activity editing" page
78
    And I set the following fields to these values:
79
      | display                   | 5          |
80
      | Show size                 | 0          |
81
      | Show type                 | 1          |
82
      | Show upload/modified date | 0          |
83
    And I press "Save and display"
84
    Then I should see "TXT" in the ".resourcedetails" "css_element"
85
    Then I should not see "6 bytes" in the ".resourcedetails" "css_element"
86
    And I should see "TXT" in the ".resourcedetails" "css_element"
87
    And I should not see "Uploaded" in the ".resourcedetails" "css_element"
88
    And I am on "Course 1" course homepage
89
    And I should see "TXT" in the ".activity.resource .activitybadge" "css_element"
90
    And ".activity.resource .resourcelinkdetails" "css_element" should not exist