netzke-basepack 0.7.7 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. data/.travis.yml +15 -10
  2. data/{CHANGELOG.rdoc → CHANGELOG.md} +146 -110
  3. data/LICENSE +7 -1
  4. data/README.md +47 -56
  5. data/Rakefile +5 -5
  6. data/config/before-travis.sh +10 -0
  7. data/javascripts/basepack.js +0 -130
  8. data/javascripts/netzkeremotecombo.js +59 -0
  9. data/lib/netzke/basepack.rb +9 -14
  10. data/lib/netzke/basepack/accordion.rb +45 -0
  11. data/lib/netzke/basepack/active_record.rb +12 -0
  12. data/lib/netzke/basepack/active_record/relation_extensions.rb +27 -0
  13. data/lib/netzke/basepack/columns.rb +309 -0
  14. data/lib/netzke/basepack/data_accessor.rb +22 -12
  15. data/lib/netzke/basepack/data_adapters/abstract_adapter.rb +75 -11
  16. data/lib/netzke/basepack/data_adapters/active_record_adapter.rb +154 -49
  17. data/lib/netzke/basepack/fields.rb +162 -0
  18. data/lib/netzke/basepack/form.rb +136 -0
  19. data/lib/netzke/basepack/{form_panel → form}/javascripts/comma_list_cbg.js +0 -1
  20. data/lib/netzke/basepack/{form_panel/javascripts/form_panel.js → form/javascripts/form.js} +20 -26
  21. data/lib/netzke/basepack/{form_panel → form}/javascripts/n_radio_group.js +0 -1
  22. data/lib/netzke/basepack/{form_panel → form}/javascripts/readonly_mode.js +0 -0
  23. data/lib/netzke/basepack/form/services.rb +115 -0
  24. data/lib/netzke/basepack/{form_panel → form}/stylesheets/readonly_mode.css +0 -0
  25. data/lib/netzke/basepack/grid.rb +355 -0
  26. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/advanced_search.js +1 -1
  27. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/check_column_fix.js +0 -0
  28. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/edit_in_form.js +3 -3
  29. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/event_handling.js +5 -2
  30. data/lib/netzke/basepack/{grid_panel/javascripts/grid_panel.js → grid/javascripts/grid.js} +120 -132
  31. data/lib/netzke/basepack/{grid_panel → grid}/javascripts/misc.js +0 -0
  32. data/lib/netzke/basepack/grid/services.rb +216 -0
  33. data/lib/netzke/basepack/item_persistence.rb +44 -0
  34. data/lib/netzke/basepack/item_persistence/events_plugin.rb +47 -0
  35. data/lib/netzke/basepack/{paging_form_panel.rb → paging_form.rb} +24 -30
  36. data/lib/netzke/basepack/{paging_form_panel/javascripts/paging_form_panel.js → paging_form/javascripts/paging_form.js} +2 -4
  37. data/lib/netzke/basepack/query_builder.rb +44 -73
  38. data/lib/netzke/basepack/query_builder/javascripts/query_builder.js +16 -2
  39. data/lib/netzke/basepack/record_form_window.rb +67 -0
  40. data/lib/netzke/basepack/search_panel.rb +22 -24
  41. data/lib/netzke/basepack/search_panel/javascripts/condition_field.js +2 -2
  42. data/lib/netzke/basepack/search_window.rb +47 -53
  43. data/lib/netzke/basepack/simple_app.rb +10 -13
  44. data/lib/netzke/basepack/simple_app/javascripts/simple_app.js +2 -8
  45. data/lib/netzke/basepack/tab_panel.rb +5 -4
  46. data/lib/netzke/basepack/tab_panel/javascripts/tab_panel.js +5 -5
  47. data/lib/netzke/basepack/version.rb +2 -2
  48. data/lib/netzke/basepack/viewport.rb +16 -0
  49. data/lib/netzke/basepack/window.rb +27 -18
  50. data/lib/netzke/basepack/window/javascripts/window.js +7 -1
  51. data/lib/netzke/basepack/wrap_lazy_loaded.rb +18 -18
  52. data/locales/en.yml +40 -24
  53. data/netzke-basepack.gemspec +51 -82
  54. data/stylesheets/basepack.css +0 -41
  55. data/test/basepack_test_app/Gemfile +9 -46
  56. data/test/basepack_test_app/Gemfile.lock +61 -96
  57. data/test/basepack_test_app/app/components/author_form.rb +8 -5
  58. data/test/basepack_test_app/app/components/author_grid.rb +2 -2
  59. data/test/basepack_test_app/app/components/book_form.rb +34 -31
  60. data/test/basepack_test_app/app/components/book_form_with_defaults.rb +6 -7
  61. data/test/basepack_test_app/app/components/book_form_with_file_upload.rb +10 -0
  62. data/test/basepack_test_app/app/components/book_form_with_nested_attributes.rb +5 -6
  63. data/test/basepack_test_app/app/components/book_grid.rb +19 -8
  64. data/test/basepack_test_app/app/components/book_grid_filtering.rb +4 -7
  65. data/test/basepack_test_app/app/components/book_grid_loader.rb +28 -15
  66. data/test/basepack_test_app/app/components/book_grid_with_custom_columns.rb +45 -21
  67. data/test/basepack_test_app/app/components/book_grid_with_default_values.rb +26 -8
  68. data/test/basepack_test_app/app/components/book_grid_with_excluded_columns.rb +11 -0
  69. data/test/basepack_test_app/app/components/book_grid_with_extra_feedback.rb +2 -2
  70. data/test/basepack_test_app/app/components/book_grid_with_extra_filters.rb +7 -6
  71. data/test/basepack_test_app/app/components/book_grid_with_mass_assignment_security.rb +9 -0
  72. data/test/basepack_test_app/app/components/book_grid_with_nested_attributes.rb +9 -9
  73. data/test/basepack_test_app/app/components/book_grid_with_overridden_columns.rb +5 -3
  74. data/test/basepack_test_app/app/components/book_grid_with_paging.rb +6 -8
  75. data/test/basepack_test_app/app/components/book_grid_with_persistence.rb +6 -4
  76. data/test/basepack_test_app/app/components/book_grid_with_scope.rb +6 -0
  77. data/test/basepack_test_app/app/components/book_grid_with_scoped_authors.rb +10 -7
  78. data/test/basepack_test_app/app/components/book_grid_with_virtual_attributes.rb +21 -13
  79. data/test/basepack_test_app/app/components/book_paging_form.rb +21 -0
  80. data/test/basepack_test_app/app/components/book_query_builder.rb +7 -6
  81. data/test/basepack_test_app/app/components/book_with_custom_primary_key_grid.rb +6 -7
  82. data/test/basepack_test_app/app/components/books_bound_to_author.rb +9 -7
  83. data/test/basepack_test_app/app/components/border_layout_panel_with_persistence.rb +12 -0
  84. data/test/basepack_test_app/app/components/double_book_grid.rb +19 -14
  85. data/test/basepack_test_app/app/components/form_without_model.rb +15 -16
  86. data/test/basepack_test_app/app/components/grid_with_initial_sorting.rb +7 -0
  87. data/test/basepack_test_app/app/components/grid_with_inline_data.rb +7 -0
  88. data/test/basepack_test_app/app/components/paging_form_with_search.rb +2 -2
  89. data/test/basepack_test_app/app/components/panel_with_persistent_regions.rb +35 -0
  90. data/test/basepack_test_app/app/components/query_builder.rb +7 -0
  91. data/test/basepack_test_app/app/components/simple_panel.rb +16 -11
  92. data/test/basepack_test_app/app/components/simple_window.rb +7 -6
  93. data/test/basepack_test_app/app/components/some_accordion.rb +18 -0
  94. data/test/basepack_test_app/app/components/some_auth_app.rb +5 -5
  95. data/test/basepack_test_app/app/components/some_border_layout.rb +20 -20
  96. data/test/basepack_test_app/app/components/some_search_panel.rb +6 -0
  97. data/test/basepack_test_app/app/components/some_simple_app.rb +30 -16
  98. data/test/basepack_test_app/app/components/some_tab_panel.rb +18 -15
  99. data/test/basepack_test_app/app/components/user_form.rb +18 -16
  100. data/test/basepack_test_app/app/components/user_form_with_default_fields.rb +5 -6
  101. data/test/basepack_test_app/app/components/user_grid.rb +11 -6
  102. data/test/basepack_test_app/app/components/user_grid_with_customized_form_fields.rb +5 -3
  103. data/test/basepack_test_app/app/components/window_component_loader.rb +25 -21
  104. data/test/basepack_test_app/app/models/address.rb +0 -26
  105. data/test/basepack_test_app/app/models/author.rb +0 -31
  106. data/test/basepack_test_app/app/models/book.rb +1 -42
  107. data/test/basepack_test_app/app/models/book_with_custom_primary_key.rb +1 -23
  108. data/test/basepack_test_app/app/models/role.rb +0 -21
  109. data/test/basepack_test_app/app/models/user.rb +0 -24
  110. data/test/basepack_test_app/app/views/layouts/components.html.erb +1 -1
  111. data/test/basepack_test_app/config/application.rb +1 -1
  112. data/test/basepack_test_app/config/database.yml.travis +2 -6
  113. data/test/basepack_test_app/config/initializers/netzke.rb +1 -6
  114. data/test/basepack_test_app/db/schema.rb +14 -14
  115. data/test/basepack_test_app/features/accordion_panel.feature +2 -2
  116. data/test/basepack_test_app/features/form_panel.feature +7 -7
  117. data/test/basepack_test_app/features/grid_panel.feature +93 -39
  118. data/test/basepack_test_app/features/grid_panel_with_custom_primary_key.feature +2 -1
  119. data/test/basepack_test_app/features/grid_sorting.feature +30 -6
  120. data/test/basepack_test_app/features/paging_form_panel.feature +7 -7
  121. data/test/basepack_test_app/features/persistent_regions.feature +30 -0
  122. data/test/basepack_test_app/features/search_in_grid.feature +5 -5
  123. data/test/basepack_test_app/features/simple_app.feature +6 -7
  124. data/test/basepack_test_app/features/step_definitions/form_panel_steps.rb +1 -1
  125. data/test/basepack_test_app/features/step_definitions/generic_steps.rb +109 -4
  126. data/test/basepack_test_app/features/step_definitions/grid_panel_steps.rb +8 -10
  127. data/test/basepack_test_app/features/step_definitions/window_steps.rb +27 -0
  128. data/test/basepack_test_app/features/tab_panel.feature +1 -1
  129. data/test/basepack_test_app/features/window.feature +17 -0
  130. data/test/unit/accordion_panel_test.rb +2 -2
  131. data/test/unit/grid_panel_test.rb +4 -4
  132. metadata +57 -83
  133. data/TODO.rdoc +0 -8
  134. data/lib/generators/netzke/basepack_generator.rb +0 -10
  135. data/lib/generators/netzke/templates/assets/ts-checkbox.gif +0 -0
  136. data/lib/generators/netzke/templates/create_netzke_field_lists.rb +0 -18
  137. data/lib/netzke/active_record.rb +0 -20
  138. data/lib/netzke/active_record/attributes.rb +0 -259
  139. data/lib/netzke/active_record/combobox_options.rb +0 -16
  140. data/lib/netzke/active_record/relation_extensions.rb +0 -37
  141. data/lib/netzke/basepack/accordion_panel.rb +0 -39
  142. data/lib/netzke/basepack/action_column.rb +0 -68
  143. data/lib/netzke/basepack/action_column/javascripts/action_column.js +0 -61
  144. data/lib/netzke/basepack/auth_app.rb +0 -159
  145. data/lib/netzke/basepack/basic_app.rb +0 -7
  146. data/lib/netzke/basepack/border_layout_panel.rb +0 -53
  147. data/lib/netzke/basepack/border_layout_panel/javascripts/border_layout_panel.js +0 -40
  148. data/lib/netzke/basepack/data_adapters/data_mapper_adapter.rb +0 -264
  149. data/lib/netzke/basepack/data_adapters/sequel_adapter.rb +0 -260
  150. data/lib/netzke/basepack/form_panel.rb +0 -144
  151. data/lib/netzke/basepack/form_panel/fields.rb +0 -208
  152. data/lib/netzke/basepack/form_panel/javascripts/misc.js +0 -4
  153. data/lib/netzke/basepack/form_panel/services.rb +0 -142
  154. data/lib/netzke/basepack/grid_panel.rb +0 -441
  155. data/lib/netzke/basepack/grid_panel/columns.rb +0 -400
  156. data/lib/netzke/basepack/grid_panel/javascripts/rows-dd.js +0 -281
  157. data/lib/netzke/basepack/grid_panel/record_form_window.rb +0 -41
  158. data/lib/netzke/basepack/grid_panel/services.rb +0 -235
  159. data/lib/netzke/basepack/panel.rb +0 -11
  160. data/lib/netzke/basepack/wrapper.rb +0 -28
  161. data/lib/netzke/data_mapper.rb +0 -18
  162. data/lib/netzke/data_mapper/attributes.rb +0 -273
  163. data/lib/netzke/data_mapper/combobox_options.rb +0 -11
  164. data/lib/netzke/data_mapper/relation_extensions.rb +0 -38
  165. data/lib/netzke/sequel.rb +0 -18
  166. data/lib/netzke/sequel/attributes.rb +0 -274
  167. data/lib/netzke/sequel/combobox_options.rb +0 -10
  168. data/lib/netzke/sequel/relation_extensions.rb +0 -40
  169. data/locales/zh-cn.yml +0 -79
  170. data/test/basepack_test_app/app/components/book_form_with_custom_fields.rb +0 -21
  171. data/test/basepack_test_app/app/components/book_grid_with_column_actions.rb +0 -15
  172. data/test/basepack_test_app/app/components/book_grid_with_defaults.rb +0 -6
  173. data/test/basepack_test_app/app/components/book_paging_form_panel.rb +0 -22
  174. data/test/basepack_test_app/app/components/generic_user_form.rb +0 -12
  175. data/test/basepack_test_app/app/components/simple_accordion.rb +0 -11
  176. data/test/basepack_test_app/app/components/simple_tab_panel.rb +0 -11
  177. data/test/basepack_test_app/app/components/simple_wrapper.rb +0 -7
  178. data/test/basepack_test_app/app/components/some_accordion_panel.rb +0 -22
  179. data/test/basepack_test_app/app/presenters/forms/generic_user.rb +0 -6
  180. data/test/basepack_test_app/app/views/components/loadable_window.html.erb +0 -9
  181. data/test/basepack_test_app/app/views/components/simple_panel.html.erb +0 -1
  182. data/test/basepack_test_app/features/components_in_view.feature +0 -11
  183. data/test/basepack_test_app/features/simple_panel.feature +0 -11
  184. data/test/basepack_test_app/features/validations_in_grid.feature +0 -13
  185. data/test/basepack_test_app/features/virtual_attributes.feature +0 -16
  186. data/test/basepack_test_app/spec/components/form_panel_spec.rb +0 -53
  187. data/test/basepack_test_app/spec/components/grid_panel_spec.rb +0 -10
  188. data/test/basepack_test_app/spec/data_adapter/adapter_spec.rb +0 -68
  189. data/test/basepack_test_app/spec/data_adapter/attributes_spec.rb +0 -56
  190. data/test/basepack_test_app/spec/data_adapter/relation_extensions_spec.rb +0 -125
  191. data/test/basepack_test_app/spec/factories.rb +0 -28
  192. data/test/basepack_test_app/spec/spec_helper.rb +0 -39
@@ -10,7 +10,7 @@ Scenario: BookGrid should correctly display data
10
10
 
11
11
  When I go to the BookGrid test page
12
12
  Then I should see "Nabokov, Vladimir"
13
- And I should see "2011-12-13 11:12:13"
13
+ And I should see "12/13/2011 11:12:13"
14
14
  And I should see "01/30/2005"
15
15
 
16
16
  @javascript
@@ -23,17 +23,19 @@ Scenario: Adding a record via "Add in form"
23
23
  And I press "OK"
24
24
  Then I should see "Herman"
25
25
  And I should see "Hesse"
26
+ And a user should exist with first_name: "Herman", last_name: "Hesse"
26
27
 
27
28
  @javascript
28
29
  Scenario: Updating a record via "Edit in form"
29
30
  Given a user exists with first_name: "Carlos", last_name: "Castaneda"
30
31
  When I go to the UserGrid test page
32
+ And I wait for response from server
31
33
  And I select first row in the grid
32
34
  And I press "Edit in form"
33
35
  And I fill in "First name:" with "Maxim"
34
36
  And I fill in "Last name:" with "Osminogov"
35
37
  And I press "OK"
36
- And I wait for the response from the server
38
+ And I wait for response from server
37
39
  Then I should see "Maxim"
38
40
  And I should see "Osminogov"
39
41
  And a user should not exist with first_name: "Carlos"
@@ -41,30 +43,32 @@ Scenario: Updating a record via "Edit in form"
41
43
  @javascript
42
44
  Scenario: Deleting a record
43
45
  Given a user exists with first_name: "Anton", last_name: "Chekhov"
44
- And a user exists with first_name: "Maxim", last_name: "Osminogov"
45
46
  When I go to the UserGrid test page
46
- And I select all rows in the grid
47
- And I press "Delete"
48
- Then I should see "Are you sure?"
49
- When I press "Yes"
50
- Then I should see "Deleted 2 record(s)"
47
+ And I wait for response from server
48
+ And I select first row in the grid
49
+ And I press button with text "Delete"
50
+ Then I should see "Are you sure?" within ".x-window"
51
+ When I press button with text "Yes"
52
+ Then I should see "Deleted 1 record(s)"
51
53
  Then a user should not exist with first_name: "Anton"
52
- And a user should not exist with first_name: "Maxim"
53
54
 
54
55
  @javascript
55
56
  Scenario: Multi-editing records
56
57
  Given a user exists with first_name: "Carlos", last_name: "Castaneda"
57
58
  And a user exists with first_name: "Herman", last_name: "Hesse"
58
59
  When I go to the UserGrid test page
60
+ And I wait for response from server
59
61
  And I select all rows in the grid
60
62
  And I press "Edit in form"
63
+ And I wait for response from server
61
64
  And I fill in "First name:" with "Maxim"
62
65
  And I press "OK"
63
- And I wait for the response from the server
66
+ And I wait for response from server
64
67
  Then the following users should exist:
65
68
  | first_name | last_name |
66
69
  | Maxim | Castaneda |
67
70
  | Maxim | Hesse |
71
+ And I should not see window
68
72
  But a user should not exist with first_name: "Carlos"
69
73
 
70
74
  @javascript
@@ -95,21 +99,22 @@ Scenario: Grid with columns with default values
95
99
  When I press "Add"
96
100
  Then I should see "Nabokov"
97
101
  And I press "Apply"
98
- And I wait for the response from the server
102
+ And I wait for response from server
99
103
  Then a book should exist with title: "Lolita", exemplars: 100, digitized: true, author: that author
100
104
 
101
105
  When I press "Add in form"
102
106
  And I press "OK"
103
- And I wait for the response from the server
107
+ And I wait for response from server
104
108
  Then 2 books should exist with title: "Lolita", exemplars: 100, digitized: true, author: that author
105
109
 
106
110
  @javascript
107
111
  Scenario: Inline editing
108
112
  Given a book exists with title: "Magus", exemplars: 100
109
113
  When I go to the BookGrid test page
114
+ And I wait for response from server
110
115
  And I edit row 1 of the grid with title: "Collector", exemplars: 200
111
116
  And I press "Apply"
112
- And I wait for the response from the server
117
+ And I wait for response from server
113
118
  Then the grid should have 0 modified records
114
119
  And a book should exist with title: "Collector", exemplars: 200
115
120
  But a book should not exist with title: "Magus"
@@ -120,15 +125,16 @@ Scenario: Inline editing of association
120
125
  And a book exists with title: "Lolita", author: that author
121
126
  And an author exists with first_name: "Herman", last_name: "Hesse"
122
127
  When I go to the BookGrid test page
128
+ And I wait for response from server
123
129
  And I expand combobox "author__name" in row 1 of the grid
124
- And I wait for the response from the server
130
+ And I wait for response from server
125
131
  And I select "Hesse, Herman" in combobox "author__name" in row 1 of the grid
126
132
  And I edit row 1 of the grid with title: "Demian"
127
133
  And I stop editing the grid
128
134
  Then I should see "Hesse, Herman" within "#book_grid"
129
135
 
130
136
  When I press "Apply"
131
- And I wait for the response from the server
137
+ And I wait for response from server
132
138
  Then a book should exist with title: "Demian", author: that author
133
139
  But a book should not exist with title: "Lolita"
134
140
 
@@ -140,37 +146,38 @@ Scenario: Inline adding of records
140
146
  When I go to the BookGrid test page
141
147
  And I press "Add"
142
148
  And I expand combobox "author__name" in row 1 of the grid
143
- And I wait for the response from the server
149
+ And I wait for response from server
144
150
  And I select "Hesse, Herman" in combobox "author__name" in row 1 of the grid
145
151
  And I edit row 1 of the grid with title: "Demian"
152
+ And I stop editing the grid
146
153
 
147
154
  And I press "Add"
148
155
  And I expand combobox "author__name" in row 2 of the grid
149
- And I wait for the response from the server
156
+ And I wait for response from server
150
157
  And I select "Nabokov, Vladimir" in combobox "author__name" in row 2 of the grid
151
158
  And I edit row 2 of the grid with title: "Lolita"
152
-
153
159
  And I stop editing the grid
160
+
154
161
  And I press "Apply"
155
- And I wait for the response from the server
162
+ And I wait for response from server
156
163
  Then a book should exist with title: "Lolita", author: author "Nabokov"
157
164
  And a book should exist with title: "Demian", author: author "Hesse"
158
165
 
159
166
  @javascript
160
- Scenario: Inline adding of records in GridPanel with default values
167
+ Scenario: Inline adding of records in Grid with default values
161
168
  Given an author: "Nabokov" exists with first_name: "Vladimir", last_name: "Nabokov"
162
169
  And an author: "Hesse" exists with first_name: "Herman", last_name: "Hesse"
163
170
 
164
171
  When I go to the BookGridWithDefaultValues test page
165
172
  And I press "Add"
166
173
  And I expand combobox "author__last_name" in row 1 of the grid
167
- And I wait for the response from the server
174
+ And I wait for response from server
168
175
  And I select "Hesse" in combobox "author__last_name" in row 1 of the grid
169
176
  And I edit row 1 of the grid with title: "Demian"
170
177
 
171
178
  And I stop editing the grid
172
179
  And I press "Apply"
173
- And I wait for the response from the server
180
+ And I wait for response from server
174
181
  Then a book should exist with title: "Demian", author: author "Hesse"
175
182
 
176
183
  @javascript
@@ -193,28 +200,32 @@ Scenario: Reloading grid data
193
200
  Scenario: Advanced search window should be hidable after loading grid panel dynamically second time
194
201
  Given I am on the BookGridLoader test page
195
202
  When I press "Load one"
196
- And I wait for the response from the server
203
+ And I wait for response from server
197
204
  And I press "Search"
198
205
  And I press "Cancel"
199
206
 
200
207
  When I press "Load two"
201
- And I wait for the response from the server
208
+ And I wait for response from server
202
209
 
203
210
  When I press "Load one"
204
- And I wait for the response from the server
211
+ And I wait for response from server
205
212
 
206
213
  And I press "Search" within "#book_grid_loader__book_grid_one"
207
- And I wait for the response from the server
208
- And I press "Cancel" within "#book_grid_loader__book_grid_one__search_form"
209
- Then the "book_grid_loader__book_grid_one__search_form" component should be hidden
214
+ And I wait for response from server
215
+ And I press "Cancel" within "#book_grid_loader__book_grid_one__search_window"
216
+ Then the "book_grid_loader__book_grid_one__search_window" component should be hidden
210
217
 
211
218
  @javascript
212
219
  Scenario: Column order should be saved across page reloads
213
220
  Given I am on the BookGridWithPersistence test page
214
221
  When I drag "Digitized" column before "Title"
215
- And I wait for the response from the server
222
+ And I wait for response from server
216
223
  And I go to the BookGridWithPersistence test page
217
224
  Then I should see columns in order: "Digitized", "Title", "Exemplars"
225
+ When I drag "Digitized" column before "Exemplars"
226
+ And I wait for response from server
227
+ And I go to the BookGridWithPersistence test page
228
+ Then I should see columns in order: "Title", "Digitized", "Exemplars"
218
229
 
219
230
  @javascript
220
231
  Scenario: I must see total records value
@@ -229,7 +240,7 @@ Scenario: I must see total records value
229
240
  Then I should see "of 2" within paging toolbar
230
241
 
231
242
  @javascript
232
- Scenario: GridPanel with overridden columns
243
+ Scenario: Grid with overridden columns
233
244
  Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
234
245
  And a book exists with title: "Lolita", author: that author
235
246
  When I go to the BookGridWithOverriddenColumns test page
@@ -248,14 +259,15 @@ Scenario: GridPanel with overridden columns
248
259
  When I go to the BookGridWithVirtualAttributes test page
249
260
  Then the grid's column "In abundance" should not be editable
250
261
 
251
- @javascript
252
- Scenario: Delete record via an column action
253
- Given a book exists with title: "Some Title"
254
- When I go to the BookGridWithColumnActions test page
255
- And I click the "Delete row" action icon
256
- And I press "Yes"
257
- Then I should see "Deleted 1 record(s)"
258
- And a book should not exist with title: "Some Title"
262
+ # TODO: Action column code has been moved to Communitypack, move the tests
263
+ # @javascript
264
+ # Scenario: Delete record via an column action
265
+ # Given a book exists with title: "Some Title"
266
+ # When I go to the BookGridWithColumnActions test page
267
+ # And I click the "Delete row" action icon
268
+ # And I press "Yes"
269
+ # Then I should see "Deleted 1 record(s)"
270
+ # And a book should not exist with title: "Some Title"
259
271
 
260
272
  @javascript
261
273
  Scenario: Pagination in grid panel
@@ -272,6 +284,48 @@ Scenario: Pagination in grid panel
272
284
  And the grid should show 2 records
273
285
 
274
286
  When I go forward one page
275
- And I wait for the response from the server
287
+ And I wait for response from server
276
288
  Then I should see "Getting Things Done"
277
289
  And I should see "Magus"
290
+
291
+ @javascript
292
+ Scenario: Hidden columns
293
+ When I go to the BookGridWithExcludedColumns test page
294
+ Then I should not see "Notes"
295
+ And I should not see "Exemplars"
296
+
297
+ @javascript
298
+ Scenario: Editing in grid with mass-assignment security
299
+ # exemplars and author_id are protected attributes, not possible to change
300
+ Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
301
+ And a book exists with title: "Lolita", author: that author, exemplars: 100
302
+ And an author exists with first_name: "Herman", last_name: "Hesse"
303
+ When I go to the BookGridWithMassAssignmentSecurity test page
304
+ And I wait for response from server
305
+ And I expand combobox "author__name" in row 1 of the grid
306
+ And I wait for response from server
307
+ And I select "Hesse, Herman" in combobox "author__name" in row 1 of the grid
308
+ And I edit row 1 of the grid with title: "Demian", exemplars: 200
309
+ And I stop editing the grid
310
+ And I press "Apply"
311
+ And I wait for response from server
312
+ Then a book should not exist with author: that author
313
+ And a book should not exist with exemplars: 200
314
+ But a book should exist with title: "Demian", exemplars: 100
315
+
316
+ @javascript
317
+ Scenario: Scoping out grid records
318
+ Given an author exists with first_name: "Vladimir", last_name: "Nabokov"
319
+ And a book exists with title: "Lolita", author: that author
320
+ And a book exists with title: "Louzhin Defence", author: that author
321
+ And an author exists with first_name: "Herman", last_name: "Hesse"
322
+ And a book exists with title: "Demian", author: that author
323
+ When I go to the BookGridWithScope test page
324
+ And I wait for response from server
325
+ Then the grid should show 2 records
326
+
327
+ @javascript
328
+ Scenario: Inline grid data
329
+ Given a book exists with title: "Man for himself"
330
+ When I go to the GridWithInlineData test page
331
+ Then I should see "Man for himself"
@@ -7,9 +7,10 @@ Feature: Grid panel with custom primary key
7
7
  Scenario: Inline editing
8
8
  Given a book_with_custom_primary_key exists with title: "Book you are to write"
9
9
  When I go to the BookWithCustomPrimaryKeyGrid test page
10
+ And I wait for response from server
10
11
  And I edit row 1 of the grid with title: "My fight club"
11
12
  And I press "Apply"
12
- And I wait for the response from the server
13
+ And I wait for response from server
13
14
  Then the grid should have 0 modified records
14
15
  And a book_with_custom_primary_key should exist with title: "My fight club"
15
16
  But a book should not exist with title: "Book you are to write"
@@ -12,12 +12,16 @@ Feature: Grid sorting
12
12
  | Avatar |
13
13
 
14
14
  When I go to the BookGrid test page
15
+
16
+ # HACK
17
+ And I sleep 1 second
18
+
15
19
  And I click on column "Title"
16
- And I wait for the response from the server
20
+ And I wait for response from server
17
21
  Then the grid should have records sorted by "Title"
18
22
 
19
23
  When I click on column "Title"
20
- And I wait for the response from the server
24
+ And I wait for response from server
21
25
  Then the grid should have records sorted by "Title" desc
22
26
 
23
27
  @javascript
@@ -30,18 +34,38 @@ Feature: Grid sorting
30
34
  And a book exists with title: "Magus", author: that author
31
35
 
32
36
  When I go to the BookGridWithCustomColumns test page
37
+
38
+ # HACK
39
+ And I sleep 1 second
40
+
33
41
  And I click on column "Author first name"
34
- And I wait for the response from the server
42
+ And I wait for response from server
35
43
  Then the grid should have records sorted by "Author first name"
36
44
 
37
45
  When I click on column "Author first name"
38
- And I wait for the response from the server
46
+ And I wait for response from server
39
47
  Then the grid should have records sorted by "Author first name" desc
40
48
 
41
49
  When I go to the BookGrid test page
50
+
51
+ # HACK
52
+ And I sleep 1 second
53
+
42
54
  And I click on column "Author name"
43
- And I wait for the response from the server
55
+ And I wait for response from server
44
56
  Then the grid should have records sorted by "Author name"
45
57
  When I click on column "Author name"
46
- And I wait for the response from the server
58
+ And I wait for response from server
47
59
  Then the grid should have records sorted by "Author name" desc
60
+
61
+ @javascript
62
+ Scenario: Sorting on regular column
63
+ Given the following books exist:
64
+ | title |
65
+ | Belief |
66
+ | Cosmos |
67
+ | Avatar |
68
+
69
+ When I go to the GridWithInitialSorting test page
70
+ And I wait for response from server
71
+ Then the grid should have records sorted by "Title" desc
@@ -12,32 +12,32 @@ Background:
12
12
 
13
13
  @javascript
14
14
  Scenario: Paging through records
15
- When I go to the BookPagingFormPanel test page
15
+ When I go to the BookPagingForm test page
16
16
  Then I should see "Journey to Ixtlan"
17
17
 
18
18
  When I go forward one page
19
- And I wait for the response from the server
19
+ And I wait for response from server
20
20
  Then the form should show title: "Lolita"
21
21
 
22
22
  When I go forward one page
23
- And I wait for the response from the server
23
+ And I wait for response from server
24
24
  Then the form should show title: "Getting Things Done"
25
25
 
26
26
  #@javascript
27
27
  #Scenario: Searching
28
- #When I go to the BookPagingFormPanel test page
28
+ #When I go to the BookPagingForm test page
29
29
  #And I press "Search"
30
- #And I wait for the response from the server
30
+ #And I wait for response from server
31
31
  #And I expand combobox "undefined_attr"
32
32
  #And I select "Exemplars" from combobox "undefined_attr"
33
33
  #And I expand combobox "exemplars_operator"
34
34
  #And I select "Less than" from combobox "exemplars_operator"
35
35
  #And I fill in "exemplars_value" with "5"
36
36
  #And I press "Search" within "#book_paging_form_panel__search_form"
37
- #And I wait for the response from the server
37
+ #And I wait for response from server
38
38
  #Then the form should show title: "Getting Things Done"
39
39
 
40
40
  @javascript
41
41
  Scenario: I must see total records value
42
- When I go to the BookPagingFormPanel test page
42
+ When I go to the BookPagingForm test page
43
43
  Then I should see "of 3" within paging toolbar
@@ -0,0 +1,30 @@
1
+ Feature: Persistent regions
2
+ In order to value
3
+ As a role
4
+ I want feature
5
+
6
+ @javascript
7
+ Scenario: A panel with persistent regions should store its region sizes
8
+ When I go to the PanelWithPersistentRegions test page
9
+ Then the west region should have size of 100
10
+ And the south region should have size of 100
11
+
12
+ When I resize the west region to the size of 300
13
+ And I resize the south region to the size of 200
14
+
15
+ And I wait for response from server
16
+ And I go to the PanelWithPersistentRegions test page
17
+ Then the west region should have size of 300
18
+ And the south region should have size of 200
19
+
20
+ @javascript
21
+ Scenario: A panel with persistent regions should store its region collapse status
22
+ Given I am on the PanelWithPersistentRegions test page
23
+ When I collapse the south region
24
+ And I wait for response from server
25
+ And I go to the PanelWithPersistentRegions test page
26
+ Then the south region should be collapsed
27
+ When I expand the south region
28
+ And I wait for response from server
29
+ And I go to the PanelWithPersistentRegions test page
30
+ Then the south region should be expanded
@@ -22,13 +22,13 @@
22
22
  #Then the grid should show 4 records
23
23
 
24
24
  #When I press "Search"
25
- #And I wait for the response from the server
25
+ #And I wait for response from server
26
26
  #And I expand combobox "undefined_attr"
27
27
  #And I select "First name" from combobox "undefined_attr"
28
- #And I wait for the response from the server
28
+ #And I wait for response from server
29
29
  #And I fill in "first_name_value" with "ai"
30
30
  #And I press "Search" within "#user_grid__search_form"
31
- #And I wait for the response from the server
31
+ #And I wait for response from server
32
32
  #Then the grid should show 2 records
33
33
 
34
34
  # When I press "Search"
@@ -37,7 +37,7 @@
37
37
  # And I select "First name" from combobox "undefined_attr"
38
38
  # And I fill in "first_name_value" with "in"
39
39
  # And I press "Search" within "#user_grid__search_form"
40
- # And I wait for the response from the server
40
+ # And I wait for response from server
41
41
  # Then the grid should show 3 records
42
42
 
43
43
  # Search on association column not supported yet
@@ -45,5 +45,5 @@
45
45
  # And I fill in "Role name like:" with "adm"
46
46
  # And I fill in "First name like:" with ""
47
47
  # And I press "Search" within "#user_grid__search_form"
48
- # And I wait for the response from the server
48
+ # And I wait for response from server
49
49
  # Then the grid should show 3 records