mercury-rails 0.2.0 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/POST_INSTALL +15 -0
- data/README.md +27 -6
- data/VERSION +1 -1
- data/app/controllers/mercury_controller.rb +4 -4
- data/app/views/layouts/mercury.html.erb +14 -3
- data/app/views/mercury/panels/snippets.html +1 -1
- data/app/views/mercury/snippets/{example_options.html.erb → example/options.html.erb} +0 -0
- data/app/views/mercury/snippets/{example.html.erb → example/preview.html.erb} +0 -0
- data/config/routes.rb +2 -2
- data/features/loading/loading.feature +22 -0
- data/features/loading/navigating.feature +77 -0
- data/features/loading/user_interface.feature +67 -0
- data/features/regions/editable/advanced_editing.feature +0 -0
- data/features/regions/editable/basic_editing.feature +195 -0
- data/features/regions/editable/inserting_links.feature +98 -0
- data/features/regions/editable/inserting_media.feature +110 -0
- data/features/regions/editable/inserting_snippets.feature +103 -0
- data/features/regions/editable/inserting_special_characters.feature +24 -0
- data/features/regions/editable/inserting_tables.feature +109 -0
- data/features/regions/editable/pasting.feature +0 -0
- data/features/regions/editable/uploading_images.feature +0 -0
- data/features/regions/markupable/advanced_editing.feature +0 -0
- data/features/regions/markupable/basic_editing.feature +0 -0
- data/features/regions/markupable/inserting_links.feature +0 -0
- data/features/regions/markupable/inserting_media.feature +0 -0
- data/features/regions/markupable/inserting_snippets.feature +0 -0
- data/features/regions/markupable/inserting_special_characters.feature +0 -0
- data/features/regions/markupable/inserting_tables.feature +0 -0
- data/features/regions/markupable/uploading_images.feature +0 -0
- data/features/regions/snippetable/advanced_editing.feature +0 -0
- data/features/regions/snippetable/basic_editing.feature +0 -0
- data/features/regions/snippetable/inserting_snippets.feature +0 -0
- data/features/saving/saving.feature +33 -0
- data/features/step_definitions/debug_steps.rb +2 -2
- data/features/step_definitions/mercury_steps.rb +441 -0
- data/features/support/env.rb +3 -3
- data/features/support/mercury_contents.rb +25 -0
- data/features/support/mercury_selectors.rb +147 -0
- data/features/support/paths.rb +20 -18
- data/features/support/selectors.rb +5 -3
- data/lib/generators/mercury/install/install_generator.rb +14 -0
- data/mercury-rails.gemspec +50 -20
- data/spec/javascripts/mercury/lightview_spec.js.coffee +55 -27
- data/spec/javascripts/mercury/mercury_spec.js.coffee +3 -3
- data/spec/javascripts/mercury/modal_spec.js.coffee +2 -2
- data/spec/javascripts/mercury/native_extensions_spec.js.coffee +0 -24
- data/spec/javascripts/mercury/page_editor_spec.js.coffee +148 -67
- data/spec/javascripts/mercury/panel_spec.js.coffee +2 -2
- data/spec/javascripts/mercury/region_spec.js.coffee +10 -7
- data/spec/javascripts/mercury/regions/editable_spec.js.coffee +0 -20
- data/spec/javascripts/mercury/snippet_toolbar_spec.js.coffee +2 -2
- data/spec/javascripts/mercury/toolbar.button_group_spec.js.coffee +1 -1
- data/spec/javascripts/mercury/toolbar.expander_spec.js.coffee +1 -1
- data/spec/javascripts/templates/mercury/page_editor.html +3 -3
- data/vendor/assets/images/mercury/close.png +0 -0
- data/vendor/assets/javascripts/mercury.js +140 -73
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/jquery-1.6.js +0 -0
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/jquery-ui-1.8.13.custom.js +0 -0
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/jquery.additions.js +0 -0
- data/vendor/assets/javascripts/mercury/dependencies/jquery.htmlClean.js +527 -0
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/liquidmetal.js +0 -0
- data/vendor/assets/javascripts/{mercury_dependencies → mercury/dependencies}/showdown.js +0 -0
- data/vendor/assets/javascripts/mercury/lightview.js.coffee +5 -2
- data/vendor/assets/javascripts/mercury/mercury.js.coffee +9 -8
- data/vendor/assets/javascripts/mercury/modals/htmleditor.js.coffee +3 -1
- data/vendor/assets/javascripts/mercury/modals/inserttable.js.coffee +2 -2
- data/vendor/assets/javascripts/mercury/native_extensions.js.coffee +6 -17
- data/vendor/assets/javascripts/mercury/page_editor.js.coffee +29 -8
- data/vendor/assets/javascripts/mercury/plugins/save_as_xml/mercury/page_editor.js.coffee +27 -0
- data/vendor/assets/javascripts/mercury/plugins/save_as_xml/plugin.js +9 -0
- data/vendor/assets/javascripts/mercury/region.js.coffee +2 -2
- data/vendor/assets/javascripts/mercury/regions/editable.js.coffee +89 -93
- data/vendor/assets/javascripts/mercury/regions/markupable.js.coffee +1 -1
- data/vendor/assets/javascripts/mercury/support/history.js +1 -0
- data/vendor/assets/javascripts/mercury/uploader.js.coffee +0 -1
- data/vendor/assets/javascripts/mercury_loader.js +4 -4
- data/vendor/assets/stylesheets/mercury/lightview.css +8 -0
- data/vendor/assets/stylesheets/mercury/mercury.css +12 -0
- data/vendor/assets/stylesheets/mercury/modal.css +0 -12
- data/vendor/assets/stylesheets/mercury/toolbar.css +1 -0
- data/vendor/assets/stylesheets/mercury_overrides.css +17 -0
- metadata +73 -45
- data/app/views/mercury/lightviews/imageprocessor.html +0 -3
- data/app/views/mercury/modals/sanitizer.html +0 -9
- data/features/editing/basic.feature +0 -11
- data/vendor/assets/images/mercury/clippy.png +0 -0
@@ -0,0 +1,98 @@
|
|
1
|
+
@javascript
|
2
|
+
Feature:
|
3
|
+
As a content editor type person
|
4
|
+
In order to manage content
|
5
|
+
I should be able to insert links of different types
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am on an editable page
|
9
|
+
And the editor won't prompt when leaving the page
|
10
|
+
|
11
|
+
Scenario: A user can expect all this!
|
12
|
+
|
13
|
+
|
14
|
+
# Scenario: A user can insert and edit a link to an external site
|
15
|
+
Given the content of the editable region is simple content
|
16
|
+
And I make a selection
|
17
|
+
|
18
|
+
When I click on the "Insert Link" button
|
19
|
+
Then the modal window should be visible
|
20
|
+
And the "Link Content" field should contain "simple"
|
21
|
+
|
22
|
+
When I fill in "URL" with "http://google.com"
|
23
|
+
And press "Insert Link"
|
24
|
+
Then the contents of the editable region should be "this is <a href='http://google.com'>simple</a> <b>content</b>"
|
25
|
+
And the modal window should not be visible
|
26
|
+
|
27
|
+
When I click on the "Insert Link" button
|
28
|
+
Then I should not see "Link Content"
|
29
|
+
|
30
|
+
When I fill in "URL" with "http://cnn.com"
|
31
|
+
And press "Insert Link"
|
32
|
+
Then the contents of the editable region should be "this is <a href='http://cnn.com'>simple</a> <b>content</b>"
|
33
|
+
|
34
|
+
|
35
|
+
# Scenario: A user can insert and edit a link with a target set
|
36
|
+
Given the content of the editable region is simple content
|
37
|
+
And I make a selection
|
38
|
+
|
39
|
+
When I click on the "Insert Link" button
|
40
|
+
And fill in "URL" with "http://google.com"
|
41
|
+
And select "Blank (a new window or tab)" from "Link Target"
|
42
|
+
And press "Insert Link"
|
43
|
+
Then the contents of the editable region should be "this is <a target='_blank' href='http://google.com'>simple</a> <b>content</b>"
|
44
|
+
|
45
|
+
When I click on the "Insert Link" button
|
46
|
+
And select "Top (removes any frames)" from "Link Target"
|
47
|
+
And press "Insert Link"
|
48
|
+
Then the contents of the editable region should be "this is <a target='_top' href='http://google.com'>simple</a> <b>content</b>"
|
49
|
+
|
50
|
+
|
51
|
+
# Scenario: A user can insert a link to an external site and open it in a popup
|
52
|
+
Given the content of the editable region is simple content
|
53
|
+
And I make a selection
|
54
|
+
|
55
|
+
When I click on the "Insert Link" button
|
56
|
+
And fill in "URL" with "http://google.com"
|
57
|
+
And select "Popup Window (javascript new window popup)" from "Link Target"
|
58
|
+
And I fill in "Popup Width" with "500"
|
59
|
+
And fill in "Popup Height" with "200"
|
60
|
+
And press "Insert Link"
|
61
|
+
Then the contents of the editable region should be "this is <a href='javascript:void(window.open('http://google.com', 'popup_window', 'width=500,height=200,menubar=no,toolbar=no'))'>simple</a> <b>content</b>"
|
62
|
+
|
63
|
+
When I click on the "Insert Link" button
|
64
|
+
Then the "Popup Width" field should contain "500"
|
65
|
+
And the "Popup Height" field should contain "200"
|
66
|
+
|
67
|
+
|
68
|
+
# Scenario: A user can insert a bookmark and then link to it
|
69
|
+
Given the content of the editable region is simple content
|
70
|
+
And I make a selection
|
71
|
+
|
72
|
+
When I click on the "Insert Link" button
|
73
|
+
And I choose "Bookmark"
|
74
|
+
And fill in "Bookmark" with "test-bookmark1"
|
75
|
+
And press "Insert Link"
|
76
|
+
Then the contents of the editable region should be "this is <a name='test-bookmark1'>simple</a> <b>content</b>"
|
77
|
+
|
78
|
+
When I make a selection for "b"
|
79
|
+
And click on the "Insert Link" button
|
80
|
+
And I choose "Existing Links"
|
81
|
+
And select "simple" from "Existing Links"
|
82
|
+
And press "Insert Link"
|
83
|
+
Then the contents of the editable region should be "this is <a name='test-bookmark1'>simple</a> <a href='#test-bookmark1'>content</a>"
|
84
|
+
|
85
|
+
When I make a selection for "a"
|
86
|
+
And click on the "Insert Link" button
|
87
|
+
# todo: this should prefill
|
88
|
+
#Then the "Bookmark" field should contain "test-bookmark1"
|
89
|
+
And I choose "Bookmark"
|
90
|
+
And fill in "Bookmark" with "test-bookmark2"
|
91
|
+
And press "Insert Link"
|
92
|
+
Then the contents of the editable region should be "this is <a name='test-bookmark2'>simple</a> <a href='#test-bookmark1'>content</a>"
|
93
|
+
|
94
|
+
# todo: when I change the name of a bookmark, and bookmarks that are pointing to me should also be updated (on this page)
|
95
|
+
|
96
|
+
|
97
|
+
Scenario: A user can navigate links inside of regions
|
98
|
+
# todo: finish
|
@@ -0,0 +1,110 @@
|
|
1
|
+
@javascript
|
2
|
+
Feature:
|
3
|
+
As a content editor type person
|
4
|
+
In order to manage content
|
5
|
+
I should be able to insert different types of media
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am on an editable page
|
9
|
+
And the editor won't prompt when leaving the page
|
10
|
+
|
11
|
+
Scenario: A user can expect all this!
|
12
|
+
|
13
|
+
|
14
|
+
# Scenario: A user can insert and edit an image
|
15
|
+
Given the content of the editable region is simple content
|
16
|
+
And I make a selection
|
17
|
+
|
18
|
+
When I click on the "Insert Media" button
|
19
|
+
Then the modal window should be visible
|
20
|
+
And I should see "Insert Media (images and videos)" within the modal title
|
21
|
+
|
22
|
+
When I fill in "URL" with "/assets/mercury/temp-logo.png"
|
23
|
+
And press "Insert Media"
|
24
|
+
Then the contents of the editable region should be "this is <img src='/assets/mercury/temp-logo.png'> <b>content</b>"
|
25
|
+
And the modal window should not be visible
|
26
|
+
|
27
|
+
When I make a selection for "img"
|
28
|
+
And click on the "Insert Media" button
|
29
|
+
Then the "media_image_url" field should contain "/assets/mercury/temp-logo.png"
|
30
|
+
|
31
|
+
When I fill in "URL" with "/assets/mercury/default-snippet.png"
|
32
|
+
And press "Insert Media"
|
33
|
+
Then the contents of the editable region should be "this is <img src='/assets/mercury/default-snippet.png'> <b>content</b>"
|
34
|
+
|
35
|
+
|
36
|
+
# Scenario: A user can insert and edit an image with an alignment set
|
37
|
+
Given the content of the editable region is simple content
|
38
|
+
And I make a selection
|
39
|
+
|
40
|
+
When I click on the "Insert Media" button
|
41
|
+
When I fill in "media_image_url" with "/assets/mercury/temp-logo.png"
|
42
|
+
And select "Right" from "Alignment"
|
43
|
+
And press "Insert Media"
|
44
|
+
Then the contents of the editable region should be "this is <img src='/assets/mercury/temp-logo.png' align='right'> <b>content</b>"
|
45
|
+
|
46
|
+
When I make a selection for "img"
|
47
|
+
And click on the "Insert Media" button
|
48
|
+
And select "Absolute Middle" from "Alignment"
|
49
|
+
And press "Insert Media"
|
50
|
+
Then the contents of the editable region should be "this is <img src='/assets/mercury/temp-logo.png' align='absmiddle'> <b>content</b>"
|
51
|
+
|
52
|
+
|
53
|
+
Scenario: A user can edit an image by double clicking it
|
54
|
+
Given the content of the editable region has an image
|
55
|
+
|
56
|
+
When I double click on the first image in the editable region
|
57
|
+
Then the modal window should be visible
|
58
|
+
And I should see "Insert Media (images and videos)" within the modal title
|
59
|
+
And the "media_image_url" field should contain "/assets/mercury/temp-logo.png"
|
60
|
+
|
61
|
+
When I fill in "URL" with "/assets/mercury/default-snippet.png"
|
62
|
+
And select "Absolute Middle" from "Alignment"
|
63
|
+
And press "Insert Media"
|
64
|
+
Then the contents of the editable region should be "this is <img src='/assets/mercury/default-snippet.png' align='absmiddle'> <b>content</b>"
|
65
|
+
|
66
|
+
|
67
|
+
Scenario: A user can embed and edit a youtube video
|
68
|
+
Given the content of the editable region is simple content
|
69
|
+
And I make a selection
|
70
|
+
|
71
|
+
When I click on the "Insert Media" button
|
72
|
+
And choose "YouTube Share URL"
|
73
|
+
And fill in "YouTube Share URL" with "http://youtu.be/Pny4hoN8eII"
|
74
|
+
And fill in "Width" with "400"
|
75
|
+
And fill in "Height" with "200"
|
76
|
+
And press "Insert Media"
|
77
|
+
Then the contents of the editable region should be "this is <iframe allowfullscreen='true' src='http://www.youtube.com/embed/Pny4hoN8eII?wmode=transparent' style='width: 400px; height: 200px;' frameborder='0'></iframe> <b>content</b>"
|
78
|
+
|
79
|
+
When I make a selection for "iframe"
|
80
|
+
And click on the "Insert Media" button
|
81
|
+
Then the "media_youtube_url" field should contain "http://youtu.be/Pny4hoN8eII"
|
82
|
+
|
83
|
+
When I fill in "YouTube Share URL" with "http://youtu.be/Pny4hoN8eI"
|
84
|
+
And fill in "Width" with "500"
|
85
|
+
And fill in "Height" with "300"
|
86
|
+
And press "Insert Media"
|
87
|
+
Then the contents of the editable region should be "this is <iframe allowfullscreen='true' src='http://www.youtube.com/embed/Pny4hoN8eI?wmode=transparent' style='width: 500px; height: 300px;' frameborder='0'></iframe> <b>content</b>"
|
88
|
+
|
89
|
+
|
90
|
+
# Scenario: A user can embed and edit a vimeo video
|
91
|
+
Given the content of the editable region is simple content
|
92
|
+
And I make a selection
|
93
|
+
|
94
|
+
When I click on the "Insert Media" button
|
95
|
+
And choose "Vimeo URL"
|
96
|
+
And fill in "Vimeo URL" with "http://vimeo.com/25708134"
|
97
|
+
And fill in "Width" with "400"
|
98
|
+
And fill in "Height" with "200"
|
99
|
+
And press "Insert Media"
|
100
|
+
Then the contents of the editable region should be "this is <iframe src='http://player.vimeo.com/video/25708134?title=1&byline=1&portrait=0&color=ffffff' style='width: 400px; height: 200px;' frameborder='0'></iframe> <b>content</b>"
|
101
|
+
|
102
|
+
When I make a selection for "iframe"
|
103
|
+
And click on the "Insert Media" button
|
104
|
+
Then the "media_vimeo_url" field should contain "http://vimeo.com/25708134"
|
105
|
+
|
106
|
+
When I fill in "Vimeo URL" with "http://vimeo.com/2570813"
|
107
|
+
And fill in "Width" with "500"
|
108
|
+
And fill in "Height" with "300"
|
109
|
+
And press "Insert Media"
|
110
|
+
Then the contents of the editable region should be "this is <iframe src='http://player.vimeo.com/video/2570813?title=1&byline=1&portrait=0&color=ffffff' style='width: 500px; height: 300px;' frameborder='0'></iframe> <b>content</b>"
|
@@ -0,0 +1,103 @@
|
|
1
|
+
@javascript
|
2
|
+
Feature:
|
3
|
+
As a content editor type person
|
4
|
+
In order to reuse content chunks
|
5
|
+
I should be able to put snippets into regions
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am on an editable page
|
9
|
+
And the editor won't prompt when leaving the page
|
10
|
+
|
11
|
+
Scenario: A user can expect all this!
|
12
|
+
|
13
|
+
|
14
|
+
# todo: these can't be one scenario because snippet.load doesn't find/replace existing ones
|
15
|
+
Scenario: A user can drag and drop snippets into an editable region
|
16
|
+
Given the content of the editable region is simple content
|
17
|
+
And I make a selection
|
18
|
+
|
19
|
+
When I open the snippet panel
|
20
|
+
And I drag the example snippet into the editable region
|
21
|
+
Then the modal window should be visible
|
22
|
+
And I should see "Snippet Options" within the modal title
|
23
|
+
|
24
|
+
When I fill in "First Name" with "Jeremy"
|
25
|
+
And fill in "Favorite Beer" with "Stella"
|
26
|
+
And press "Insert Snippet"
|
27
|
+
Then the modal window should not be visible
|
28
|
+
And the contents of the editable region should be "this is <div data-version='1' data-snippet='snippet_14' class='mercury-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div><span>simple</span> <b>content</b>"
|
29
|
+
|
30
|
+
|
31
|
+
Scenario: A user can use the snippet toolbar to remove a snippet
|
32
|
+
Given the options for the example snippet "snippet_42" are first_name: "Jeremy", favorite_beer: "Stella"
|
33
|
+
And the content of the editable region has that snippet
|
34
|
+
|
35
|
+
When I hover over the snippet
|
36
|
+
Then the snippet toolbar should be visible
|
37
|
+
|
38
|
+
When I click on the remove snippet toolbar button
|
39
|
+
Then the contents of the editable region should be " <b>content</b>"
|
40
|
+
|
41
|
+
|
42
|
+
Scenario: A user can use the snippet toolbar to edit the options of a snippet
|
43
|
+
Given the options for the example snippet "snippet_42" are first_name: "Hipsters", favorite_beer: "PBR"
|
44
|
+
And the content of the editable region has that snippet
|
45
|
+
|
46
|
+
When I hover over the snippet
|
47
|
+
And click on the edit snippet settings toolbar button
|
48
|
+
Then the modal window should be visible
|
49
|
+
And the "First Name" field should contain "Hipsters"
|
50
|
+
And the "Favorite Beer" field should contain "PBR"
|
51
|
+
|
52
|
+
When I fill in "First Name" with "Jeremy"
|
53
|
+
And fill in "Favorite Beer" with "Stella"
|
54
|
+
And press "Insert Snippet"
|
55
|
+
Then the contents of the editable region should be "<div data-version='2' data-snippet='snippet_42' class='mercury-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
|
56
|
+
|
57
|
+
|
58
|
+
Scenario: A user can make changes to a snippets options, and they'll be versioned for undo and redo
|
59
|
+
Given the options for the example snippet "snippet_42" are first_name: "Hipsters", favorite_beer: "PBR"
|
60
|
+
And the content of the editable region has that snippet
|
61
|
+
|
62
|
+
When I edit the snippet
|
63
|
+
And I fill in "First Name" with "Jeremy"
|
64
|
+
And fill in "Favorite Beer" with "Stella"
|
65
|
+
And press "Insert Snippet"
|
66
|
+
Then the contents of the editable region should be "<div data-version='2' data-snippet='snippet_42' class='mercury-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
|
67
|
+
|
68
|
+
When I edit the snippet
|
69
|
+
Then the "First Name" field should contain "Jeremy"
|
70
|
+
And the "Favorite Beer" field should contain "Stella"
|
71
|
+
|
72
|
+
When fill in "First Name" with "Diesel"
|
73
|
+
And fill in "Favorite Beer" with "Bells Hopslam"
|
74
|
+
And press "Insert Snippet"
|
75
|
+
Then the content of the editable region should be "<div data-version='3' data-snippet='snippet_42' class='mercury-snippet' contenteditable='false'><strong>Diesel</strong> likes Bells Hopslam</div> <b>content</b>"
|
76
|
+
|
77
|
+
When I click on the "Undo" button
|
78
|
+
Then the contents of the editable region should be "<div data-version='2' data-snippet='snippet_42' class='mercury-snippet' contenteditable='false'><strong>Jeremy</strong> likes Stella</div> <b>content</b>"
|
79
|
+
|
80
|
+
When I edit the snippet
|
81
|
+
# todo: this is a bug
|
82
|
+
# Then the "First Name" field should contain "Jeremy"
|
83
|
+
# And the "Favorite Beer" field should contain "Stella"
|
84
|
+
|
85
|
+
When I close the modal
|
86
|
+
When I click on the "Redo" button
|
87
|
+
Then the contents of the editable region should be "<div data-version='3' data-snippet='snippet_42' class='mercury-snippet' contenteditable='false'><strong>Diesel</strong> likes Bells Hopslam</div> <b>content</b>"
|
88
|
+
|
89
|
+
When I edit the snippet
|
90
|
+
Then the "First Name" field should contain "Diesel"
|
91
|
+
And the "Favorite Beer" field should contain "Bells Hopslam"
|
92
|
+
|
93
|
+
When I fill in "First Name" with "Jen"
|
94
|
+
And fill in "Favorite Beer" with "Miller High Life"
|
95
|
+
And press "Insert Snippet"
|
96
|
+
Then the contents of the editable region should be "<div data-version='4' data-snippet='snippet_42' class='mercury-snippet' contenteditable='false'><strong>Jen</strong> likes Miller High Life</div> <b>content</b>"
|
97
|
+
|
98
|
+
|
99
|
+
Scenario: When a user saves, the snippets should be gone from the html, but the options are serialized
|
100
|
+
Given the options for the example snippet "snippet_42" are first_name: "Hipsters", favorite_beer: "PBR"
|
101
|
+
And the content of the editable region has that snippet
|
102
|
+
|
103
|
+
When I click on the "Save" button
|
@@ -0,0 +1,24 @@
|
|
1
|
+
@javascript
|
2
|
+
Feature:
|
3
|
+
As a content editor type person
|
4
|
+
In order to manage content
|
5
|
+
I should be able to insert characters that are otherwise hard
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am on an editable page
|
9
|
+
And the editor won't prompt when leaving the page
|
10
|
+
|
11
|
+
Scenario: A user can expect all this!
|
12
|
+
|
13
|
+
|
14
|
+
# Scenario: A user can insert special characters
|
15
|
+
Given the content of the editable region is simple content
|
16
|
+
And I make a selection
|
17
|
+
|
18
|
+
When I click on the "Insert Character" button
|
19
|
+
Then the modal window should be visible
|
20
|
+
And I should see "Special Characters" within the modal title
|
21
|
+
|
22
|
+
When I click on the sweet snowman
|
23
|
+
Then the modal window should not be visible
|
24
|
+
And the contents of the editable region should be "this is ☃ <b>content</b>"
|
@@ -0,0 +1,109 @@
|
|
1
|
+
@javascript
|
2
|
+
Feature:
|
3
|
+
As a content editor type person
|
4
|
+
In order to manage content
|
5
|
+
I should be able to insert and edit complex tables
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am on an editable page
|
9
|
+
And the editor won't prompt when leaving the page
|
10
|
+
|
11
|
+
Scenario: A user can expect all this!
|
12
|
+
|
13
|
+
|
14
|
+
# Scenario: A user can insert a table
|
15
|
+
Given the content of the editable region is simple content
|
16
|
+
And I make a selection
|
17
|
+
|
18
|
+
When I click on the "Insert Table" button
|
19
|
+
Then the modal window should be visible
|
20
|
+
And I should see "Insert Table" within the modal title
|
21
|
+
|
22
|
+
When I click on the third cell in the first row
|
23
|
+
And I add a column before it
|
24
|
+
Then the table column count should be 4
|
25
|
+
And the selected cell should be the forth cell in the first row
|
26
|
+
|
27
|
+
When I add a column after
|
28
|
+
Then the table column count should be 5
|
29
|
+
And the selected cell should be the forth cell in the first row
|
30
|
+
|
31
|
+
When I add a row after
|
32
|
+
Then the table row count should be 3
|
33
|
+
And the selected cell should be the forth cell in the first row
|
34
|
+
|
35
|
+
When I add a row before
|
36
|
+
Then the table row count should be 4
|
37
|
+
And the selected cell should be the forth cell in the second row
|
38
|
+
|
39
|
+
When I delete the column
|
40
|
+
Then the table column count should be 4
|
41
|
+
And a selected cell should not be visible
|
42
|
+
|
43
|
+
When I click on the second cell in the second row
|
44
|
+
And delete the row
|
45
|
+
Then the table row count should be 3
|
46
|
+
And a selected cell should not be visible
|
47
|
+
|
48
|
+
When I click on the second cell in the second row
|
49
|
+
And increase the colspan
|
50
|
+
And click on the first cell in the first row
|
51
|
+
And increase the rowspan
|
52
|
+
And select "Right" from "Alignment"
|
53
|
+
And fill in "Border" with "2"
|
54
|
+
And fill in "Spacing" with "2"
|
55
|
+
And press "Insert Table"
|
56
|
+
Then the contents of the editable region should be "this is <table align='right' border='2' cellspacing='2'><tbody><tr><td rowspan='2'> </td><td> </td><td> </td><td> </td></tr><tr><td colspan='2'> </td><td> </td></tr><tr><td> </td><td> </td><td> </td><td> </td></tr></tbody></table> <b>content</b>"
|
57
|
+
And the modal window should not be visible
|
58
|
+
|
59
|
+
|
60
|
+
# Scenario: A user can edit a table after inserting one (in an editable region)
|
61
|
+
Given the content of the editable region has a table
|
62
|
+
And I make a selection
|
63
|
+
|
64
|
+
When I click on the add row before editor button
|
65
|
+
Then the table row count should be 3
|
66
|
+
And the contents of the editable region should be "this is a <table><tbody><tr><td> </td><td> </td></tr><tr><td><span>1</span></td><td><span>2</span></td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
67
|
+
|
68
|
+
When I click on the add row after editor button
|
69
|
+
Then the table row count should be 4
|
70
|
+
And the contents of the editable region should be "this is a <table><tbody><tr><td> </td><td> </td></tr><tr><td><span>1</span></td><td><span>2</span></td></tr><tr><td> </td><td> </td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
71
|
+
|
72
|
+
When I click on the add column before editor button
|
73
|
+
Then the column count should be 3
|
74
|
+
And the contents of the editable region should be "this is a <table><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td><span>1</span></td><td><span>2</span></td></tr><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
75
|
+
|
76
|
+
When I click on the add column after editor button
|
77
|
+
Then the column count should be 4
|
78
|
+
And the contents of the editable region should be "this is a <table><tbody><tr><td> </td><td> </td><td> </td><td> </td></tr><tr><td> </td><td><span>1</span></td><td> </td><td><span>2</span></td></tr><tr><td> </td><td> </td><td> </td><td> </td></tr><tr><td> </td><td><span>3</span></td><td> </td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
79
|
+
|
80
|
+
When I click on the delete row editor button
|
81
|
+
Then the table row count should be 3
|
82
|
+
And the contents of the editable region should be "this is a <table><tbody><tr><td> </td><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td><td> </td></tr><tr><td> </td><td><span>3</span></td><td> </td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
83
|
+
|
84
|
+
When I make a selection
|
85
|
+
And click on the delete column editor button
|
86
|
+
Then the table column count should be 3
|
87
|
+
And the contents of the editable region should be "this is a <table><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
88
|
+
|
89
|
+
|
90
|
+
# Scenario: A user can adjust the colspans of a table (in an editable region)
|
91
|
+
Given the content of the editable region has a table
|
92
|
+
And I make a selection
|
93
|
+
|
94
|
+
When I click on the increase colspan editor button
|
95
|
+
Then the contents of the editable region should be "this is a <table><tbody><tr><td colspan='2'><span>1</span></td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
96
|
+
|
97
|
+
When I click on the decrease colspan editor button
|
98
|
+
Then the contents of the editable region should be "this is a <table><tbody><tr><td><span>1</span></td><td> </td></tr><tr><td><span>3</span></td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
99
|
+
|
100
|
+
|
101
|
+
# Scenario: A user can adjust the rowspans of a table (in an editable region)
|
102
|
+
Given the content of the editable region has a table
|
103
|
+
And I make a selection
|
104
|
+
|
105
|
+
When I click on the increase rowspan editor button
|
106
|
+
Then the contents of the editable region should be "this is a <table><tbody><tr><td rowspan='2'><span>1</span></td><td><span>2</span></td></tr><tr><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|
107
|
+
|
108
|
+
When I click on the decrease rowspan editor button
|
109
|
+
Then the contents of the editable region should be "this is a <table><tbody><tr><td><span>1</span></td><td><span>2</span></td></tr><tr><td> </td><td><span>4</span></td></tr></tbody></table> <b>content</b>"
|