weekly release 4.0dev
[moodle.git] / lib / editor / atto / plugins / image / tests / behat / image.feature
CommitLineData
d27c8d92 1@editor @editor_atto @atto @atto_image @_file_upload
457a9fa6
DW
2Feature: Add images to Atto
3 To write rich text - I need to add images.
4
5 @javascript
6 Scenario: Insert an image
7 Given I log in as "admin"
4887d152 8 And I follow "Manage private files..."
457a9fa6
DW
9 And I upload "lib/editor/atto/tests/fixtures/moodle-logo.png" file to "Files" filemanager
10 And I click on "Save changes" "button"
353e7876 11 And I open my profile in edit mode
5d25a2cb 12 When I set the field "Description" to "<p>Image test</p>"
e3adee55 13 And I select the text in the "Description" Atto editor
1906a735 14 And I click on "Insert or edit image" "button"
457a9fa6 15 And I click on "Browse repositories..." "button"
ba5c5083 16 And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
457a9fa6
DW
17 And I click on "moodle-logo.png" "link"
18 And I click on "Select this file" "button"
e01012e9 19 And I set the field "Describe this image for someone who cannot see it" to "It's the Moodle"
457a9fa6 20 # Wait for the page to "settle".
d7a0b721 21 And I wait until the page is ready
f756d3d4
FM
22 And the field "Width" matches value "204"
23 And the field "Height" matches value "61"
24 And I set the field "Auto size" to "1"
9b4903c8 25 And I wait until the page is ready
f756d3d4
FM
26 And I set the field "Width" to "2040"
27 # Trigger blur on the width field.
d7a0b721 28 And I take focus off "Width" "field"
f756d3d4
FM
29 And the field "Height" matches value "610"
30 And I set the field "Height" to "61"
31 # Trigger blur on the height field.
d7a0b721 32 And I take focus off "Height" "field"
f756d3d4
FM
33 And the field "Width" matches value "204"
34 And I set the field "Auto size" to "0"
9b4903c8 35 And I wait until the page is ready
f756d3d4
FM
36 And I set the field "Width" to "123"
37 And I set the field "Height" to "456"
38 # Trigger blur on the height field.
d7a0b721 39 And I take focus off "Height" "field"
f756d3d4
FM
40 And the field "Width" matches value "123"
41 And the field "Height" matches value "456"
7e03b27d
MC
42 And I change window size to "large"
43 And I press "Save image"
44 And I press "Update profile"
ba5c5083 45 And I click on "Edit profile" "link" in the "region-main" "region"
e3adee55 46 And I select the text in the "Description" Atto editor
1906a735 47 And I click on "Insert or edit image" "button"
e01012e9 48 Then the field "Describe this image for someone who cannot see it" matches value "It's the Moodle"
f756d3d4
FM
49 And the field "Width" matches value "123"
50 And the field "Height" matches value "456"
457a9fa6 51
f756d3d4
FM
52 @javascript
53 Scenario: Manually inserting an image
54 Given I log in as "admin"
353e7876 55 And I open my profile in edit mode
f756d3d4
FM
56 And I set the field "Description" to "<p>Image: <img src='/nothing/here'>.</p>"
57 And I select the text in the "Description" Atto editor
1906a735 58 When I click on "Insert or edit image" "button"
f756d3d4 59 Then the field "Enter URL" matches value "/nothing/here"
e01012e9 60 And I set the field "Describe this image for someone who cannot see it" to "Something"
f756d3d4
FM
61 And I set the field "Enter URL" to ""
62 And I press "Save image"
63 And I set the field "Description" to "<p>Image: <img src='/nothing/again' width='123' height='456' alt='Awesome!'>.</p>"
64 And I press "Update profile"
ba5c5083 65 And I click on "Edit profile" "link" in the "region-main" "region"
f756d3d4 66 And I select the text in the "Description" Atto editor
1906a735 67 And I click on "Insert or edit image" "button"
f756d3d4
FM
68 And the field "Enter URL" matches value "/nothing/again"
69 And the field "Width" matches value "123"
70 And the field "Height" matches value "456"
5d25a2cb 71 And the field "Describe this image" matches value "Awesome!"