11 |
efrain |
1 |
@editor @editor_atto @atto @atto_link
|
1 |
efrain |
2 |
Feature: Add links to Atto
|
|
|
3 |
To write rich text - I need to add links.
|
|
|
4 |
|
|
|
5 |
@javascript
|
|
|
6 |
Scenario: Insert a links
|
11 |
efrain |
7 |
Given the following "user private file" exists:
|
|
|
8 |
| user | admin |
|
|
|
9 |
| filepath | lib/editor/atto/tests/fixtures/moodle-logo.png |
|
1 |
efrain |
10 |
And I log in as "admin"
|
|
|
11 |
When I open my profile in edit mode
|
|
|
12 |
And I set the field "Description" to "Super cool"
|
|
|
13 |
And I select the text in the "Description" Atto editor
|
|
|
14 |
And I click on "Link" "button"
|
|
|
15 |
Then the field "Text to display" matches value "Super cool"
|
|
|
16 |
And I click on "Browse repositories..." "button"
|
|
|
17 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
18 |
And I click on "moodle-logo.png" "link"
|
|
|
19 |
And I click on "Select this file" "button"
|
|
|
20 |
And I click on "Update profile" "button"
|
|
|
21 |
And I follow "Preferences" in the user menu
|
|
|
22 |
And I follow "Editor preferences"
|
|
|
23 |
And I set the field "Text editor" to "Plain text area"
|
|
|
24 |
And I press "Save changes"
|
|
|
25 |
And I click on "Edit profile" "link" in the "region-main" "region"
|
|
|
26 |
And I should see "Super cool</a>"
|
|
|
27 |
|
|
|
28 |
@javascript
|
|
|
29 |
Scenario: Insert a link without providing text to display
|
|
|
30 |
Given I log in as "admin"
|
|
|
31 |
When I open my profile in edit mode
|
|
|
32 |
And I click on "Link" "button"
|
|
|
33 |
And I set the field "Enter a URL" to "https://moodle.org/"
|
|
|
34 |
Then the field "Text to display" matches value "https://moodle.org/"
|
|
|
35 |
And I click on "Create link" "button"
|
|
|
36 |
And I should see "https://moodle.org/"
|
|
|
37 |
And I click on "Link" "button"
|
|
|
38 |
And the field "Text to display" matches value "https://moodle.org/"
|
|
|
39 |
And the field "Enter a URL" matches value "https://moodle.org/"
|
|
|
40 |
And I click on "Close" "button" in the "Create link" "dialogue"
|
|
|
41 |
And I click on "Show more buttons" "button"
|
|
|
42 |
And I click on "HTML" "button"
|
|
|
43 |
And I should see "https://moodle.org/</a>"
|
|
|
44 |
|
|
|
45 |
@javascript
|
|
|
46 |
Scenario: Insert a link with providing text to display
|
|
|
47 |
Given I log in as "admin"
|
|
|
48 |
When I open my profile in edit mode
|
|
|
49 |
And I click on "Link" "button"
|
|
|
50 |
And I set the field "Text to display" to "Moodle - Open-source learning platform"
|
|
|
51 |
And I set the field "Enter a URL" to "https://moodle.org/"
|
|
|
52 |
And I click on "Create link" "button"
|
|
|
53 |
Then I should see "Moodle - Open-source learning platform"
|
|
|
54 |
And I click on "Link" "button"
|
|
|
55 |
And the field "Text to display" matches value "Moodle - Open-source learning platform"
|
|
|
56 |
And the field "Enter a URL" matches value "https://moodle.org/"
|
|
|
57 |
And I click on "Close" "button" in the "Create link" "dialogue"
|
|
|
58 |
And I click on "Show more buttons" "button"
|
|
|
59 |
And I click on "HTML" "button"
|
|
|
60 |
And I should see "Moodle - Open-source learning platform</a>"
|
|
|
61 |
And I should not see "https://moodle.org/</a>"
|
|
|
62 |
|
|
|
63 |
@javascript
|
|
|
64 |
Scenario: Edit a link that already had a custom text to display
|
|
|
65 |
Given I log in as "admin"
|
|
|
66 |
And I follow "Preferences" in the user menu
|
|
|
67 |
And I follow "Editor preferences"
|
|
|
68 |
And I set the field "Text editor" to "Plain text area"
|
|
|
69 |
And I press "Save changes"
|
|
|
70 |
And I click on "Edit profile" "link" in the "region-main" "region"
|
|
|
71 |
And I set the field "Description" to "<a href=\"https://moodle.org/\">Moodle - Open-source learning platform</a>"
|
|
|
72 |
And I click on "Update profile" "button"
|
|
|
73 |
And I follow "Preferences" in the user menu
|
|
|
74 |
And I follow "Editor preferences"
|
|
|
75 |
And I set the field "Text editor" to "Atto HTML editor"
|
|
|
76 |
And I press "Save changes"
|
|
|
77 |
When I click on "Edit profile" "link" in the "region-main" "region"
|
|
|
78 |
Then I should see "Moodle - Open-source learning platform"
|
|
|
79 |
And I click on "Link" "button"
|
|
|
80 |
And the field "Text to display" matches value "Moodle - Open-source learning platform"
|
|
|
81 |
And the field "Enter a URL" matches value "https://moodle.org/"
|
|
|
82 |
|
|
|
83 |
@javascript
|
|
|
84 |
Scenario: Insert a link for an image
|
11 |
efrain |
85 |
Given the following "user private file" exists:
|
|
|
86 |
| user | admin |
|
|
|
87 |
| filepath | lib/editor/atto/tests/fixtures/moodle-logo.png |
|
|
|
88 |
And I log in as "admin"
|
1 |
efrain |
89 |
And I open my profile in edit mode
|
|
|
90 |
And I click on "Insert or edit image" "button"
|
|
|
91 |
And I click on "Browse repositories..." "button"
|
|
|
92 |
And I click on "Private files" "link" in the ".fp-repo-area" "css_element"
|
|
|
93 |
And I click on "moodle-logo.png" "link"
|
|
|
94 |
And I click on "Select this file" "button"
|
|
|
95 |
And I set the field "Describe this image for someone who cannot see it" to "It's the Moodle"
|
|
|
96 |
And I press "Save image"
|
|
|
97 |
And I select the text in the "Description" Atto editor
|
|
|
98 |
And I press the right key
|
|
|
99 |
And I press the shift left key
|
|
|
100 |
And I click on "Link" "button"
|
|
|
101 |
And I set the field "Enter a URL" to "https://moodle.org/"
|
|
|
102 |
And I set the field "Text to display" to "Moodle - Open-source learning platform"
|
|
|
103 |
And I click on "Create link" "button"
|
|
|
104 |
When I click on "Show more buttons" "button"
|
|
|
105 |
And I click on "HTML" "button"
|
|
|
106 |
Then I should see "<a href=\"https://moodle.org/\" title=\"Moodle - Open-source learning platform\"><img"
|
|
|
107 |
And I click on "HTML" "button"
|
|
|
108 |
And I select the text in the "Description" Atto editor
|
|
|
109 |
And I press the shift left key
|
|
|
110 |
And I click on "Insert or edit image" "button"
|
|
|
111 |
And the field "Describe this image for someone who cannot see it" matches value "It's the Moodle"
|
|
|
112 |
And I click on "Close" "button" in the "Image properties" "dialogue"
|
|
|
113 |
And I click on "Link" "button"
|
|
|
114 |
And the field "Text to display" matches value "Moodle - Open-source learning platform"
|
|
|
115 |
And the field "Enter a URL" matches value "https://moodle.org/"
|