Proyectos de Subversion Moodle

Rev

Ir a la última revisión | | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
@editor @editor_atto @atto @atto_image @_file_upload
2
Feature: Add images to Atto
3
  To write rich text - I need to add images.
4
 
5
  @javascript
6
  Scenario: Insert an image
7
    Given the following "blocks" exist:
8
      | blockname     | contextlevel | reference | pagetypepattern | defaultregion |
9
      | private_files | System       | 1         | my-index        | side-post     |
10
    And I log in as "admin"
11
    And I follow "Manage private files..."
12
    And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
13
    And I click on "Save changes" "button"
14
    And I open my profile in edit mode
15
    When I set the field "Description" to "<p>Image test</p>"
16
    And I select the text in the "Description" Atto editor
17
    And I click on "Insert or edit image" "button"
18
    And I click on "Browse repositories..." "button"
19
    And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
20
    And I click on "moodle-logo.png" "link"
21
    And I click on "Select this file" "button"
22
    And I set the field "Describe this image for someone who cannot see it" to "It's the Moodle"
23
    # Wait for the page to "settle".
24
    And I wait until the page is ready
25
    And the field "Width" matches value "204"
26
    And the field "Height" matches value "61"
27
    And I set the field "Auto size" to "1"
28
    And I wait until the page is ready
29
    And I set the field "Width" to "2040"
30
    # Trigger blur on the width field.
31
    And I take focus off "Width" "field"
32
    And the field "Height" matches value "610"
33
    And I set the field "Height" to "61"
34
    # Trigger blur on the height field.
35
    And I take focus off "Height" "field"
36
    And the field "Width" matches value "204"
37
    And I set the field "Auto size" to "0"
38
    And I wait until the page is ready
39
    And I set the field "Width" to "123"
40
    And I set the field "Height" to "456"
41
    # Trigger blur on the height field.
42
    And I take focus off "Height" "field"
43
    And the field "Width" matches value "123"
44
    And the field "Height" matches value "456"
45
    And I change window size to "large"
46
    And I press "Save image"
47
    And I press "Update profile"
48
    And I click on "Edit profile" "link" in the "region-main" "region"
49
    And I select the text in the "Description" Atto editor
50
    And I click on "Insert or edit image" "button"
51
    Then the field "Describe this image for someone who cannot see it" matches value "It's the Moodle"
52
    And the field "Width" matches value "123"
53
    And the field "Height" matches value "456"
54
 
55
  @javascript
56
  Scenario: Manually inserting an image
57
    Given I log in as "admin"
58
    And I open my profile in edit mode
59
    And I set the field "Description" to "<p>Image: <img src='/nothing/here'>.</p>"
60
    And I select the text in the "Description" Atto editor
61
    When I click on "Insert or edit image" "button"
62
    Then the field "Enter URL" matches value "/nothing/here"
63
    And I set the field "Describe this image for someone who cannot see it" to "Something"
64
    And I set the field "Width" to "1"
65
    And I set the field "Height" to "1"
66
    And I press "Save image"
67
    And I set the field "Description" to "<p>Image: <img src='/nothing/again' width='123' height='456' alt='Awesome!'>.</p>"
68
    And I press "Update profile"
69
    And I click on "Edit profile" "link" in the "region-main" "region"
70
    And I select the text in the "Description" Atto editor
71
    And I click on "Insert or edit image" "button"
72
    And the field "Enter URL" matches value "/nothing/again"
73
    And the field "Width" matches value "123"
74
    And the field "Height" matches value "456"
75
    And the field "Describe this image" matches value "Awesome!"
76
 
77
  @javascript
78
  Scenario: Error handling when inserting an image manually
79
    Given I log in as "admin"
80
    And I open my profile in edit mode
81
    And I set the field "Description" to "<p>Image: <img src='/nothing/here'>.</p>"
82
    And I select the text in the "Description" Atto editor
83
    When I click on "Insert or edit image" "button"
84
    Then the field "Enter URL" matches value "/nothing/here"
85
    And I set the field "Describe this image for someone who cannot see it" to ""
86
    And I take focus off "Describe this image for someone who cannot see it" "field"
87
    And I should see "An image must have a description, unless it is marked as decorative only."
88
    And I set the field "Describe this image for someone who cannot see it" to "Something"
89
    And I set the field "Enter URL" to ""
90
    And I press "Save image"
91
    And I should see "An image must have a URL."
92
    And I set the field "Enter URL" to "/nothing/here"
93
    And I set the field "Width" to "1"
94
    And I set the field "Height" to "1"
95
    And I press "Save image"
96
    And I press "Update profile"