rwiki 0.1.3 → 0.2.1
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/Capfile +2 -0
- data/Gemfile +30 -0
- data/Rakefile +22 -65
- data/VERSION +1 -1
- data/config.ru +11 -0
- data/config/config.yml.example +1 -0
- data/config/deploy.rb +37 -0
- data/features/create_page.feature +30 -20
- data/features/delete_page.feature +23 -18
- data/features/display_page.feature +10 -11
- data/features/editor.feature +45 -0
- data/features/history.feature +46 -0
- data/features/rename_page.feature +42 -37
- data/features/step_definitions/common_steps.rb +19 -47
- data/features/step_definitions/common_transforms.rb +5 -0
- data/features/step_definitions/dialog_box_steps.rb +16 -0
- data/features/step_definitions/history_steps.rb +11 -0
- data/features/step_definitions/tab_panel_steps.rb +27 -0
- data/features/step_definitions/tree_panel_steps.rb +42 -0
- data/features/step_definitions/wait_steps.rb +21 -0
- data/features/support/env.rb +6 -0
- data/features/tab_panel.feature +47 -0
- data/features/tree_panel.feature +14 -15
- data/lib/rwiki.rb +1 -0
- data/lib/rwiki/app.rb +14 -2
- data/lib/rwiki/models/folder.rb +1 -1
- data/lib/rwiki/models/node.rb +11 -1
- data/lib/rwiki/models/page.rb +1 -1
- data/public/favicon.ico +0 -0
- data/public/images/compressed.png +0 -0
- data/public/images/css.png +0 -0
- data/public/images/file.png +0 -0
- data/public/images/html.png +0 -0
- data/public/images/icon_word.png +0 -0
- data/public/images/image.png +0 -0
- data/public/images/javascript.png +0 -0
- data/public/images/pdf.png +0 -0
- data/public/images/php.png +0 -0
- data/public/images/presentation.png +0 -0
- data/public/images/ruby.png +0 -0
- data/public/images/shellscript.png +0 -0
- data/public/images/stylesheet.png +0 -0
- data/public/images/text.png +0 -0
- data/public/images/wordprocessing.png +0 -0
- data/public/javascripts/Rwiki.js +71 -29
- data/public/javascripts/Rwiki/EditorPanel.js +5 -37
- data/public/javascripts/Rwiki/EditorPanel/Editor.js +8 -44
- data/public/javascripts/Rwiki/EditorWindow.js +66 -0
- data/public/javascripts/Rwiki/FuzzyFinderDialog.js +61 -0
- data/public/javascripts/Rwiki/NavigationPanel.js +25 -0
- data/public/javascripts/Rwiki/NodeManager.js +2 -0
- data/public/javascripts/Rwiki/TabPanel.js +39 -2
- data/public/javascripts/Rwiki/TreePanel.js +39 -26
- data/public/javascripts/Rwiki/TreePanel/Menu.js +1 -1
- data/public/javascripts/Rwiki/TreePanel/Node.js +46 -0
- data/public/javascripts/vendor/ext/adapter/ext/ext-base-debug.js +836 -710
- data/public/javascripts/vendor/ext/adapter/ext/ext-base.js +5 -5
- data/public/javascripts/vendor/ext/adapter/jquery/ext-jquery-adapter-debug.js +47 -700
- data/public/javascripts/vendor/ext/adapter/jquery/ext-jquery-adapter.js +5 -5
- data/public/javascripts/vendor/ext/adapter/prototype/ext-prototype-adapter-debug.js +45 -698
- data/public/javascripts/vendor/ext/adapter/prototype/ext-prototype-adapter.js +5 -5
- data/public/javascripts/vendor/ext/adapter/yui/ext-yui-adapter-debug.js +39 -696
- data/public/javascripts/vendor/ext/adapter/yui/ext-yui-adapter.js +5 -5
- data/public/javascripts/vendor/ext/ext-all-debug-w-comments.js +17932 -12860
- data/public/javascripts/vendor/ext/ext-all-debug.js +11674 -8102
- data/public/javascripts/vendor/ext/ext-all.js +6 -6
- data/public/javascripts/vendor/ext/ux/StatusBar.js +418 -0
- data/public/resources/ext/charts.swf +0 -0
- data/public/resources/ext/css/debug.css +4 -4
- data/public/resources/ext/css/ext-all-notheme.css +204 -52
- data/public/resources/ext/css/ext-all.css +234 -54
- data/public/resources/ext/css/reset-min.css +4 -4
- data/public/resources/ext/css/structure/borders.css +4 -4
- data/public/resources/ext/css/structure/box.css +4 -4
- data/public/resources/ext/css/structure/button.css +7 -7
- data/public/resources/ext/css/structure/combo.css +4 -4
- data/public/resources/ext/css/structure/core.css +15 -5
- data/public/resources/ext/css/structure/date-picker.css +4 -4
- data/public/resources/ext/css/structure/dd.css +4 -4
- data/public/resources/ext/css/structure/debug.css +4 -4
- data/public/resources/ext/css/structure/dialog.css +6 -9
- data/public/resources/ext/css/structure/editor.css +4 -4
- data/public/resources/ext/css/structure/form.css +14 -4
- data/public/resources/ext/css/structure/grid.css +15 -5
- data/public/resources/ext/css/structure/layout.css +7 -7
- data/public/resources/ext/css/structure/list-view.css +4 -4
- data/public/resources/ext/css/structure/menu.css +13 -6
- data/public/resources/ext/css/structure/panel-reset.css +4 -4
- data/public/resources/ext/css/structure/panel.css +70 -22
- data/public/resources/ext/css/structure/pivotgrid.css +65 -0
- data/public/resources/ext/css/structure/progress.css +4 -4
- data/public/resources/ext/css/structure/qtips.css +4 -4
- data/public/resources/ext/css/structure/reset.css +11 -5
- data/public/resources/ext/css/structure/resizable.css +4 -4
- data/public/resources/ext/css/structure/slider.css +4 -4
- data/public/resources/ext/css/structure/tabs.css +13 -8
- data/public/resources/ext/css/structure/toolbar.css +5 -5
- data/public/resources/ext/css/structure/tree.css +11 -11
- data/public/resources/ext/css/structure/window.css +5 -5
- data/public/resources/ext/css/theme-access/borders.css +4 -4
- data/public/resources/ext/css/theme-access/box.css +4 -4
- data/public/resources/ext/css/theme-access/button.css +4 -4
- data/public/resources/ext/css/theme-access/combo.css +4 -4
- data/public/resources/ext/css/theme-access/core.css +4 -4
- data/public/resources/ext/css/theme-access/date-picker.css +4 -4
- data/public/resources/ext/css/theme-access/dd.css +4 -4
- data/public/resources/ext/css/theme-access/debug.css +4 -4
- data/public/resources/ext/css/theme-access/dialog.css +4 -4
- data/public/resources/ext/css/theme-access/editor.css +4 -4
- data/public/resources/ext/css/theme-access/form.css +4 -4
- data/public/resources/ext/css/theme-access/grid.css +4 -4
- data/public/resources/ext/css/theme-access/layout.css +4 -4
- data/public/resources/ext/css/theme-access/list-view.css +8 -4
- data/public/resources/ext/css/theme-access/menu.css +4 -4
- data/public/resources/ext/css/theme-access/panel.css +4 -4
- data/public/resources/ext/css/theme-access/progress.css +4 -4
- data/public/resources/ext/css/theme-access/qtips.css +4 -4
- data/public/resources/ext/css/theme-access/resizable.css +4 -4
- data/public/resources/ext/css/theme-access/slider.css +4 -4
- data/public/resources/ext/css/theme-access/tabs.css +4 -4
- data/public/resources/ext/css/theme-access/toolbar.css +4 -4
- data/public/resources/ext/css/theme-access/tree.css +4 -4
- data/public/resources/ext/css/theme-access/window.css +5 -5
- data/public/resources/ext/css/theme-gray/borders.css +4 -4
- data/public/resources/ext/css/theme-gray/box.css +4 -4
- data/public/resources/ext/css/theme-gray/button.css +4 -4
- data/public/resources/ext/css/theme-gray/combo.css +4 -4
- data/public/resources/ext/css/theme-gray/core.css +6 -4
- data/public/resources/ext/css/theme-gray/date-picker.css +4 -4
- data/public/resources/ext/css/theme-gray/dd.css +4 -4
- data/public/resources/ext/css/theme-gray/debug.css +4 -4
- data/public/resources/ext/css/theme-gray/dialog.css +4 -4
- data/public/resources/ext/css/theme-gray/editor.css +4 -4
- data/public/resources/ext/css/theme-gray/form.css +4 -4
- data/public/resources/ext/css/theme-gray/grid.css +10 -6
- data/public/resources/ext/css/theme-gray/layout.css +4 -4
- data/public/resources/ext/css/theme-gray/list-view.css +5 -5
- data/public/resources/ext/css/theme-gray/menu.css +4 -4
- data/public/resources/ext/css/theme-gray/panel.css +4 -4
- data/public/resources/ext/css/theme-gray/pivotgrid.css +28 -0
- data/public/resources/ext/css/theme-gray/progress.css +4 -4
- data/public/resources/ext/css/theme-gray/qtips.css +4 -4
- data/public/resources/ext/css/theme-gray/resizable.css +4 -4
- data/public/resources/ext/css/theme-gray/slider.css +4 -4
- data/public/resources/ext/css/theme-gray/tabs.css +4 -4
- data/public/resources/ext/css/theme-gray/toolbar.css +4 -4
- data/public/resources/ext/css/theme-gray/tree.css +4 -4
- data/public/resources/ext/css/theme-gray/window.css +4 -4
- data/public/resources/ext/css/visual/borders.css +4 -4
- data/public/resources/ext/css/visual/box.css +4 -4
- data/public/resources/ext/css/visual/button.css +4 -4
- data/public/resources/ext/css/visual/combo.css +4 -4
- data/public/resources/ext/css/visual/core.css +6 -4
- data/public/resources/ext/css/visual/date-picker.css +4 -4
- data/public/resources/ext/css/visual/dd.css +4 -4
- data/public/resources/ext/css/visual/debug.css +4 -4
- data/public/resources/ext/css/visual/dialog.css +4 -4
- data/public/resources/ext/css/visual/editor.css +4 -4
- data/public/resources/ext/css/visual/form.css +4 -4
- data/public/resources/ext/css/visual/grid.css +8 -4
- data/public/resources/ext/css/visual/layout.css +4 -4
- data/public/resources/ext/css/visual/list-view.css +4 -4
- data/public/resources/ext/css/visual/menu.css +4 -4
- data/public/resources/ext/css/visual/panel.css +4 -4
- data/public/resources/ext/css/visual/pivotgrid.css +28 -0
- data/public/resources/ext/css/visual/progress.css +4 -4
- data/public/resources/ext/css/visual/qtips.css +4 -4
- data/public/resources/ext/css/visual/resizable.css +4 -4
- data/public/resources/ext/css/visual/slider.css +4 -4
- data/public/resources/ext/css/visual/tabs.css +4 -4
- data/public/resources/ext/css/visual/toolbar.css +5 -5
- data/public/resources/ext/css/visual/tree.css +4 -4
- data/public/resources/ext/css/visual/window.css +4 -4
- data/public/resources/ext/css/xtheme-access.css +9 -5
- data/public/resources/ext/css/xtheme-blue.css +34 -6
- data/public/resources/ext/css/xtheme-gray.css +35 -7
- data/public/resources/ext/css/yourtheme.css +11 -5
- data/public/resources/ext/images/access/panel/tool-sprites.gif +0 -0
- data/public/resources/ext/images/default/grid/grid3-rowheader.gif +0 -0
- data/public/resources/ext/images/default/grid/refresh-disabled.gif +0 -0
- data/public/resources/ext/images/default/panel/tool-sprites.gif +0 -0
- data/public/resources/ext/images/gray/grid/sort-hd.gif +0 -0
- data/public/resources/ext/images/gray/panel/tool-sprites.gif +0 -0
- data/public/resources/ext/images/gray/window/left-corners.png +0 -0
- data/public/resources/ext/images/gray/window/left-right.png +0 -0
- data/public/resources/ext/images/gray/window/right-corners.png +0 -0
- data/public/resources/ext/images/gray/window/top-bottom.png +0 -0
- data/public/stylesheets/coderay.css +3 -0
- data/public/stylesheets/markitup.css +19 -0
- data/public/stylesheets/style.css +1 -1
- data/run_tests.sh +1 -0
- data/rwiki.gemspec +56 -37
- data/test/fixtures/pages/Info/dummy +0 -0
- data/test/rwiki/models/test_folder.rb +4 -4
- data/vendor/.gitkeep +0 -0
- data/views/layout.erb +13 -5
- metadata +78 -69
- data/.idea/projectCodeStyle.xml +0 -80
- data/.rvmrc +0 -1
- data/public/javascripts/Rwiki/SidePanel.js +0 -26
- data/public/javascripts/Rwiki/Toolbar.js +0 -31
- data/public/javascripts/Rwiki/Viewport.js +0 -10
- data/tmp/ExtDesigner/MyViewport.js +0 -18
- data/tmp/ExtDesigner/MyViewport.ui.js +0 -29
- data/tmp/ExtDesigner/Rwiki.EditorPanel.js +0 -19
- data/tmp/ExtDesigner/Rwiki.EditorPanel.ui.js +0 -27
- data/tmp/ExtDesigner/Rwiki.MainPanel.js +0 -19
- data/tmp/ExtDesigner/Rwiki.MainPanel.ui.js +0 -29
- data/tmp/ExtDesigner/Rwiki.TabPane.PageTab.js +0 -19
- data/tmp/ExtDesigner/Rwiki.TabPane.PageTab.ui.js +0 -19
- data/tmp/ExtDesigner/Rwiki.TabPanel.js +0 -19
- data/tmp/ExtDesigner/Rwiki.TabPanel.ui.js +0 -27
- data/tmp/ExtDesigner/Rwiki.TreePanel.js +0 -19
- data/tmp/ExtDesigner/Rwiki.TreePanel.ui.js +0 -27
- data/tmp/ExtDesigner/Rwiki.Viewport.js +0 -18
- data/tmp/ExtDesigner/Rwiki.Viewport.ui.js +0 -30
- data/tmp/ExtDesigner/rwiki.xds +0 -192
- data/tmp/ExtDesigner/xds_includeOrder.txt +0 -12
- data/tmp/ExtDesigner/xds_index.html +0 -26
- data/tmp/ExtDesigner/xds_index.js +0 -19
|
@@ -1,81 +1,86 @@
|
|
|
1
1
|
Feature: Rename a node
|
|
2
2
|
|
|
3
3
|
Background:
|
|
4
|
-
Given I
|
|
5
|
-
And I wait for ajax call complete
|
|
4
|
+
Given I open the application
|
|
6
5
|
|
|
7
6
|
@javascript
|
|
8
7
|
Scenario: Rename a page
|
|
9
|
-
When I right click node "./home.txt"
|
|
8
|
+
When I right click the node with path "./home.txt"
|
|
10
9
|
And I follow "Rename node"
|
|
11
10
|
Then I should see dialog box titled "Rename node"
|
|
12
11
|
|
|
13
|
-
When I fill in the
|
|
14
|
-
And press "OK"
|
|
15
|
-
|
|
16
|
-
And I should see "The new home"
|
|
12
|
+
When I fill in the input with "The new home" within the dialog box
|
|
13
|
+
And I press "OK" within the dialog box
|
|
14
|
+
Then I should see the node titled "The new home"
|
|
17
15
|
|
|
18
|
-
When I
|
|
19
|
-
|
|
16
|
+
When I reload the application
|
|
17
|
+
Then I should see the node titled "The new home"
|
|
18
|
+
|
|
19
|
+
When I click the node with path "./The new home.txt"
|
|
20
20
|
Then I should see "Sample page" within "h1"
|
|
21
21
|
|
|
22
22
|
@javascript
|
|
23
23
|
Scenario: Rename a page to existing name
|
|
24
|
-
When I right click node "./home.txt"
|
|
24
|
+
When I right click the node with path "./home.txt"
|
|
25
25
|
And I follow "Rename node"
|
|
26
26
|
Then I should see dialog box titled "Rename node"
|
|
27
27
|
|
|
28
|
-
When I fill in the
|
|
29
|
-
And press "OK"
|
|
30
|
-
And I reload the
|
|
28
|
+
When I fill in the input with "test" within the dialog box
|
|
29
|
+
And I press "OK" within the dialog box
|
|
30
|
+
And I reload the application
|
|
31
31
|
And I should see "home"
|
|
32
32
|
And I should see "test"
|
|
33
33
|
|
|
34
|
-
When I click node "./home.txt"
|
|
35
|
-
And I wait for ajax call complete
|
|
34
|
+
When I click the node with path "./home.txt"
|
|
36
35
|
Then I should see "Sample page" within "h1"
|
|
37
36
|
|
|
38
|
-
When I click node "./test.txt"
|
|
39
|
-
And I wait for ajax call complete
|
|
37
|
+
When I click the node with path "./test.txt"
|
|
40
38
|
Then I should see "This is a test"
|
|
39
|
+
And I should see page title "Rwiki ./test.txt"
|
|
41
40
|
And I should have the following open tabs:
|
|
42
41
|
| home |
|
|
43
42
|
| test |
|
|
44
43
|
|
|
45
44
|
@javascript
|
|
46
45
|
Scenario: Rename a page when tab is open
|
|
47
|
-
When I click node "./
|
|
48
|
-
And I click node "./
|
|
49
|
-
|
|
46
|
+
When I click the node with path "./test.txt"
|
|
47
|
+
And I click the node with path "./home.txt"
|
|
48
|
+
Then I should see page title "Rwiki ./home.txt"
|
|
49
|
+
|
|
50
|
+
And I right click the node with path "./home.txt"
|
|
50
51
|
And I follow "Rename node"
|
|
51
52
|
Then I should see dialog box titled "Rename node"
|
|
52
53
|
|
|
53
|
-
When I fill in the
|
|
54
|
-
And press "OK"
|
|
55
|
-
Then I should
|
|
56
|
-
|
|
54
|
+
When I fill in the input with "The new home" within the dialog box
|
|
55
|
+
And I press "OK" within the dialog box
|
|
56
|
+
Then I should see the node titled "The new home"
|
|
57
|
+
And I should have the following open tabs:
|
|
57
58
|
| test |
|
|
59
|
+
| The new home |
|
|
60
|
+
And I should see page title "Rwiki ./The new home.txt"
|
|
58
61
|
|
|
59
62
|
@javascript
|
|
60
63
|
Scenario: Rename a folder
|
|
61
|
-
When I
|
|
64
|
+
When I double click the node with path "./folder"
|
|
65
|
+
And I click the node with path "./folder/test.txt"
|
|
66
|
+
Then I should see page title "Rwiki ./folder/test.txt"
|
|
67
|
+
|
|
68
|
+
When I right click the node with path "./folder"
|
|
62
69
|
And I follow "Rename node"
|
|
63
70
|
Then I should see dialog box titled "Rename node"
|
|
64
71
|
|
|
65
|
-
When I fill in the
|
|
66
|
-
And press "OK"
|
|
67
|
-
Then I should see "The new folder name"
|
|
72
|
+
When I fill in the input with "The new folder name" within the dialog box
|
|
73
|
+
And I press "OK" within the dialog box
|
|
74
|
+
Then I should see the node titled "The new folder name"
|
|
75
|
+
Then I should see page title "Rwiki ./The new folder name/test.txt"
|
|
68
76
|
|
|
69
|
-
When I double click node "./The new folder name"
|
|
70
|
-
And I click node "./The new folder name/test.txt"
|
|
71
|
-
And I wait for ajax call complete
|
|
77
|
+
When I double click the node with path "./The new folder name"
|
|
78
|
+
And I click the node with path "./The new folder name/test.txt"
|
|
72
79
|
Then I should see "Test 1" within "h3"
|
|
73
80
|
|
|
74
|
-
When I reload the
|
|
75
|
-
|
|
76
|
-
And I double click node "./The new folder name"
|
|
77
|
-
And I click node "./The new folder name/test.txt"
|
|
78
|
-
And I wait for ajax call complete
|
|
81
|
+
When I reload the application
|
|
82
|
+
Then I should see the node titled "The new folder name"
|
|
83
|
+
And I double click the node with path "./The new folder name"
|
|
84
|
+
And I click the node with path "./The new folder name/test.txt"
|
|
79
85
|
Then I should see "Test 1" within "h3"
|
|
80
|
-
|
|
81
86
|
|
|
@@ -1,64 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Then /^I enter the break point$/ do
|
|
2
|
+
debugger
|
|
3
|
+
p 'debugger'
|
|
3
4
|
end
|
|
4
5
|
|
|
5
|
-
When /^I
|
|
6
|
+
When /^I open the application$/ do
|
|
6
7
|
When %Q{I go to the home page}
|
|
7
|
-
And %Q{I wait for ajax call complete}
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
timeout = 10
|
|
12
|
-
wait_until(timeout) do
|
|
13
|
-
ajax_in_progress = Capybara.current_session.evaluate_script <<-JS
|
|
14
|
-
Rwiki.ajaxCallInProgress
|
|
15
|
-
JS
|
|
16
|
-
|
|
17
|
-
!ajax_in_progress
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
When /^I double click node "([^"]*)"$/ do |path|
|
|
22
|
-
node_id = Capybara.current_session.evaluate_script <<-JS
|
|
23
|
-
Rwiki.treePanel.findNodeByPath('#{path}').id
|
|
24
|
-
JS
|
|
25
|
-
|
|
26
|
-
Capybara.current_session.execute_script <<-JS
|
|
27
|
-
$("div[ext\\\\:tree-node-id='#{node_id}']").trigger("dblclick")
|
|
28
|
-
JS
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
When /^I click node "([^"]*)"$/ do |path|
|
|
32
|
-
node_id = Capybara.current_session.evaluate_script <<-JS
|
|
33
|
-
Rwiki.treePanel.findNodeByPath('#{path}').id
|
|
34
|
-
JS
|
|
35
|
-
|
|
10
|
+
When /^I reload the application$/ do
|
|
36
11
|
Capybara.current_session.execute_script <<-JS
|
|
37
|
-
|
|
12
|
+
window.location.reload();
|
|
38
13
|
JS
|
|
39
14
|
end
|
|
40
15
|
|
|
41
|
-
When /^I
|
|
42
|
-
|
|
43
|
-
var node = Rwiki.treePanel.findNodeByPath('#{path}')
|
|
44
|
-
Rwiki.treePanel.fireEvent('contextmenu', node, { getXY: function() { return [0,0] } })
|
|
45
|
-
JS
|
|
16
|
+
When /^I open the application for page with path "([^"]*)"$/ do |path|
|
|
17
|
+
visit('/#' + path)
|
|
46
18
|
end
|
|
47
19
|
|
|
48
|
-
Then /^I should
|
|
49
|
-
|
|
50
|
-
table.diff!(actual_table)
|
|
20
|
+
Then /^I should see dialog box titled "([^"]*)"$/ do |title|
|
|
21
|
+
%Q{Then I should see "#{title}" within "span.x-window-header-text"}
|
|
51
22
|
end
|
|
52
23
|
|
|
53
|
-
Then /^I should
|
|
54
|
-
|
|
24
|
+
Then /^I should see page title "([^"]*)"$/ do |title|
|
|
25
|
+
find("title").text.should == title
|
|
55
26
|
end
|
|
56
27
|
|
|
57
|
-
|
|
58
|
-
%
|
|
59
|
-
|
|
28
|
+
When /^I create a new page title "([^"]*)" for the node with path "([^"]*)"$/ do |title, path|
|
|
29
|
+
When %{I right click the node with path "#{path}"}
|
|
30
|
+
And %{I follow "Create page"}
|
|
31
|
+
Then %{I should see dialog box titled "Create page"}
|
|
60
32
|
|
|
61
|
-
When
|
|
62
|
-
|
|
63
|
-
|
|
33
|
+
When %{I fill in the input with "#{title}" within the dialog box}
|
|
34
|
+
And %{I press "OK" within the dialog box}
|
|
35
|
+
Then %{I should see the node titled "#{title}"}
|
|
64
36
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
When /^I fill in the input with "([^"]*)" within the dialog box$/ do |text|
|
|
2
|
+
field = find('div.x-window-dlg input')
|
|
3
|
+
field.set(text)
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
When /^I press "([^"]*)" within the dialog box$/ do |button|
|
|
7
|
+
When %{I press "#{button}" within "div.x-window-dlg"}
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
Then /^I should see the window titled "([^"]*)"$/ do |title|
|
|
11
|
+
page.find("span.x-window-header-text").text.should == title
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Then /^I should not see the window$/ do
|
|
15
|
+
page.should have_no_css('div.x-window', :visible => true)
|
|
16
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
When /^I close tab for page "([^"]*)"$/ do |path|
|
|
2
|
+
tab_id = Capybara.current_session.evaluate_script <<-JS
|
|
3
|
+
Rwiki.tabPanel.findTabByPagePath('#{path}').tabEl.id;
|
|
4
|
+
JS
|
|
5
|
+
|
|
6
|
+
close_button = find("li##{tab_id} a.x-tab-strip-close")
|
|
7
|
+
# TODO try fix this workaround see http://groups.google.com/group/ruby-capybara/browse_thread/thread/985b123dc98d27b5
|
|
8
|
+
close_button.click rescue nil
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
When /^I click tab for page "([^"]*)"$/ do |path|
|
|
12
|
+
tab_id = Capybara.current_session.evaluate_script <<-JS
|
|
13
|
+
Rwiki.tabPanel.findTabByPagePath('#{path}').tabEl.id;
|
|
14
|
+
JS
|
|
15
|
+
|
|
16
|
+
tab = find("li##{tab_id}")
|
|
17
|
+
tab.click
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
Then /^I should have the following open tabs:$/ do |table|
|
|
21
|
+
actual_table = table(tableish("div.x-tab-panel ul li[@class!='x-tab-edge']", "a.x-tab-right"))
|
|
22
|
+
table.diff!(actual_table)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
Then /^I should have no open tabs$/ do
|
|
26
|
+
page.all("div.x-tab-panel ul li[class!='x-tab-edge']").size.should == 0
|
|
27
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
Then /^I should see the node titled "([^"]*)"$/ do |title|
|
|
2
|
+
Then %{I should see "#{title}" within "div#tree"}
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
Then /^I should not see the node titled "([^"]*)"$/ do |title|
|
|
6
|
+
Then %{I should not see "#{title}" within "div#tree"}
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
When /^I double click (the node with path "(?:[^"]*)")$/ do |tree_node_id|
|
|
10
|
+
Capybara.current_session.execute_script <<-JS
|
|
11
|
+
$("div[ext\\\\:tree-node-id='#{tree_node_id}']").trigger("dblclick")
|
|
12
|
+
JS
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
When /^I click (the node with path "(?:[^"]*)")$/ do |tree_node_id|
|
|
16
|
+
Capybara.current_session.execute_script <<-JS
|
|
17
|
+
$("div[ext\\\\:tree-node-id='#{tree_node_id}']").trigger("click");
|
|
18
|
+
JS
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
When /^I right click the node with path "([^"]*)"$/ do |path|
|
|
22
|
+
Capybara.current_session.execute_script <<-JS
|
|
23
|
+
var node = Rwiki.treePanel.findNodeByPath('#{path}')
|
|
24
|
+
Rwiki.treePanel.fireEvent('contextmenu', node, { getXY: function() { return [0, 0] } });
|
|
25
|
+
JS
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
Then /^(the node with path "(?:[^"]*)") should be selected$/ do |tree_node_id|
|
|
29
|
+
div_id = Capybara.current_session.evaluate_script <<-JS
|
|
30
|
+
$('div[ext\\\\:tree-node-id="#{tree_node_id}"]').attr('id');
|
|
31
|
+
JS
|
|
32
|
+
|
|
33
|
+
page.has_css? "div##{div_id}.x-tree-selected"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
Then /^(the node with path "(?:[^"]*)") should not be selected$/ do |tree_node_id|
|
|
37
|
+
div_id = Capybara.current_session.evaluate_script <<-JS
|
|
38
|
+
$('div[ext\\\\:tree-node-id="#{tree_node_id}"]').attr('id');
|
|
39
|
+
JS
|
|
40
|
+
|
|
41
|
+
page.has_no_css? "div##{div_id}.x-tree-selected"
|
|
42
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
When /^I wait for (\d+) second$/ do |n|
|
|
2
|
+
sleep(n.to_i)
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
Given /^I wait for load the tree$/ do
|
|
6
|
+
timeout = 10
|
|
7
|
+
wait_until(timeout) do
|
|
8
|
+
Capybara.current_session.evaluate_script <<-JS
|
|
9
|
+
Rwiki.treeLoaded;
|
|
10
|
+
JS
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Given /^I wait for load an ajax call complete$/ do
|
|
15
|
+
timeout = 10
|
|
16
|
+
wait_until(timeout) do
|
|
17
|
+
Capybara.current_session.evaluate_script <<-JS
|
|
18
|
+
Rwiki.ajaxCallCompleted;
|
|
19
|
+
JS
|
|
20
|
+
end
|
|
21
|
+
end
|
data/features/support/env.rb
CHANGED
|
@@ -8,6 +8,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '../../test/tmpdir_he
|
|
|
8
8
|
|
|
9
9
|
Rwiki::App.set(:environment, :test)
|
|
10
10
|
|
|
11
|
+
Capybara.default_selector = :css
|
|
11
12
|
Capybara.register_driver :selenium do |app|
|
|
12
13
|
Capybara::Driver::Selenium
|
|
13
14
|
profile = Selenium::WebDriver::Firefox::Profile.new
|
|
@@ -24,6 +25,11 @@ World do
|
|
|
24
25
|
|
|
25
26
|
include TmpdirHelper
|
|
26
27
|
|
|
28
|
+
AfterStep do
|
|
29
|
+
Given %Q{I wait for load the tree}
|
|
30
|
+
And %Q{I wait for load an ajax call complete}
|
|
31
|
+
end
|
|
32
|
+
|
|
27
33
|
Before do
|
|
28
34
|
create_tmpdir!
|
|
29
35
|
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
Feature: Tab Panel
|
|
2
|
+
|
|
3
|
+
Background:
|
|
4
|
+
Given I open the application
|
|
5
|
+
|
|
6
|
+
@javascript
|
|
7
|
+
Scenario: Close a tab
|
|
8
|
+
When I click the node with path "./home.txt"
|
|
9
|
+
And I click the node with path "./test.txt"
|
|
10
|
+
|
|
11
|
+
Then I should have the following open tabs:
|
|
12
|
+
| home |
|
|
13
|
+
| test |
|
|
14
|
+
And the node with path "./test.txt" should be selected
|
|
15
|
+
|
|
16
|
+
When I close tab for page "./test.txt"
|
|
17
|
+
Then I should have the following open tabs:
|
|
18
|
+
| home |
|
|
19
|
+
And the node with path "./test.txt" should be selected
|
|
20
|
+
|
|
21
|
+
When I close tab for page "./home.txt"
|
|
22
|
+
Then I should have no open tabs
|
|
23
|
+
|
|
24
|
+
@javascript
|
|
25
|
+
Scenario: Switching a tabs
|
|
26
|
+
When I click the node with path "./home.txt"
|
|
27
|
+
And I click the node with path "./test.txt"
|
|
28
|
+
Then I should see "This is a test"
|
|
29
|
+
|
|
30
|
+
When I click tab for page "./home.txt"
|
|
31
|
+
Then I should see "Sample page" within "h1"
|
|
32
|
+
And the node with path "./home.txt" should be selected
|
|
33
|
+
And the node with path "./test.txt" should not be selected
|
|
34
|
+
|
|
35
|
+
When I click tab for page "./test.txt"
|
|
36
|
+
Then I should see "This is a test"
|
|
37
|
+
And the node with path "./test.txt" should be selected
|
|
38
|
+
And the node with path "./home.txt" should not be selected
|
|
39
|
+
|
|
40
|
+
@javascript
|
|
41
|
+
Scenario: Close tab from context menu
|
|
42
|
+
|
|
43
|
+
@javascript
|
|
44
|
+
Scenario: Close other tabs from context menu
|
|
45
|
+
|
|
46
|
+
@javascript
|
|
47
|
+
Scenario: Close all tabs from context menu
|
data/features/tree_panel.feature
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
Feature: Tree Panel
|
|
2
2
|
|
|
3
3
|
Background:
|
|
4
|
-
Given I
|
|
5
|
-
And I wait for ajax call complete
|
|
4
|
+
Given I open the application
|
|
6
5
|
|
|
7
6
|
@javascript
|
|
8
7
|
Scenario: Browsing a tree
|
|
9
8
|
Then I should see "empty_folder"
|
|
10
|
-
And I should see "folder"
|
|
11
|
-
And I should see "subfolder"
|
|
12
|
-
And I should see "home"
|
|
13
|
-
And I should see "test"
|
|
9
|
+
And I should see the node titled "folder"
|
|
10
|
+
And I should see the node titled "subfolder"
|
|
11
|
+
And I should see the node titled "home"
|
|
12
|
+
And I should see the node titled "test"
|
|
14
13
|
|
|
15
|
-
And I should not see "ruby"
|
|
16
|
-
And I should not see "test 1"
|
|
17
|
-
And I should not see "test 2"
|
|
14
|
+
And I should not see the node titled "ruby"
|
|
15
|
+
And I should not see the node titled "test 1"
|
|
16
|
+
And I should not see the node titled "test 2"
|
|
18
17
|
|
|
19
|
-
When I double click node "./folder"
|
|
20
|
-
Then I should see "test"
|
|
21
|
-
And I should see "test 1"
|
|
22
|
-
And I should see "test 2"
|
|
18
|
+
When I double click the node with path "./folder"
|
|
19
|
+
Then I should see the node titled "test"
|
|
20
|
+
And I should see the node titled "test 1"
|
|
21
|
+
And I should see the node titled "test 2"
|
|
23
22
|
|
|
24
|
-
When I double click node "./folder/subfolder"
|
|
25
|
-
Then I should see "ruby"
|
|
23
|
+
When I double click the node with path "./folder/subfolder"
|
|
24
|
+
Then I should see the node titled "ruby"
|