marty 2.5.2 → 2.5.4
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.
- checksums.yaml +5 -5
- data/.gitignore +4 -0
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +11 -589
- data/Gemfile +9 -9
- data/Gemfile.lock +1 -1
- data/Rakefile +1 -3
- data/app/components/marty/api_auth_view.rb +3 -3
- data/app/components/marty/api_config_view.rb +8 -8
- data/app/components/marty/api_log_view.rb +16 -20
- data/app/components/marty/auth_app.rb +6 -6
- data/app/components/marty/base_rule_view.rb +27 -19
- data/app/components/marty/config_view.rb +12 -9
- data/app/components/marty/data_grid_view.rb +26 -26
- data/app/components/marty/delorean_rule_view.rb +0 -1
- data/app/components/marty/event_view.rb +27 -27
- data/app/components/marty/extras/layout.rb +26 -26
- data/app/components/marty/extras/misc.rb +2 -2
- data/app/components/marty/grid.rb +13 -13
- data/app/components/marty/grid_append_only.rb +0 -1
- data/app/components/marty/import_type_view.rb +13 -13
- data/app/components/marty/import_view.rb +17 -16
- data/app/components/marty/log_view.rb +16 -14
- data/app/components/marty/main_auth_app.rb +59 -59
- data/app/components/marty/main_auth_app/client/main_auth_app.js +3 -3
- data/app/components/marty/mcfly_grid_panel.rb +10 -10
- data/app/components/marty/new_posting_form.rb +11 -11
- data/app/components/marty/new_posting_window.rb +0 -1
- data/app/components/marty/posting_grid.rb +12 -13
- data/app/components/marty/promise_view.rb +6 -6
- data/app/components/marty/report_form.rb +50 -53
- data/app/components/marty/report_select.rb +27 -27
- data/app/components/marty/reporting.rb +4 -4
- data/app/components/marty/script_form.rb +40 -42
- data/app/components/marty/script_grid.rb +24 -24
- data/app/components/marty/script_tester.rb +40 -42
- data/app/components/marty/scripting.rb +25 -27
- data/app/components/marty/simple_app.rb +24 -9
- data/app/components/marty/tag_grid.rb +12 -13
- data/app/components/marty/user_view.rb +35 -35
- data/app/controllers/marty/application_controller.rb +3 -4
- data/app/controllers/marty/components_controller.rb +1 -1
- data/app/controllers/marty/delayed_job_controller.rb +1 -0
- data/app/controllers/marty/diagnostic/controller.rb +4 -6
- data/app/controllers/marty/job_controller.rb +6 -6
- data/app/controllers/marty/report_controller.rb +11 -11
- data/app/controllers/marty/rpc_controller.rb +15 -16
- data/app/helpers/marty/script_set.rb +4 -4
- data/app/models/marty/api_auth.rb +4 -5
- data/app/models/marty/api_config.rb +1 -1
- data/app/models/marty/base.rb +9 -8
- data/app/models/marty/base_rule.rb +18 -13
- data/app/models/marty/config.rb +4 -5
- data/app/models/marty/data_grid.rb +157 -181
- data/app/models/marty/delorean_rule.rb +63 -62
- data/app/models/marty/enum.rb +1 -1
- data/app/models/marty/event.rb +56 -59
- data/app/models/marty/helper.rb +38 -6
- data/app/models/marty/import_type.rb +6 -6
- data/app/models/marty/log.rb +3 -2
- data/app/models/marty/name_validator.rb +3 -2
- data/app/models/marty/pg_enum.rb +3 -4
- data/app/models/marty/posting.rb +20 -24
- data/app/models/marty/promise.rb +28 -30
- data/app/models/marty/script.rb +30 -28
- data/app/models/marty/tag.rb +8 -8
- data/app/models/marty/token.rb +2 -2
- data/app/models/marty/user.rb +24 -23
- data/app/models/marty/vw_promise.rb +10 -11
- data/config/routes.rb +2 -2
- data/delorean/blame_report.dl +268 -0
- data/{spec/dummy/delorean/fields.dl → delorean/marty_fields.dl} +8 -0
- data/delorean/table_report.dl +34 -0
- data/docker-compose.dummy.yml +2 -3
- data/lib/marty/aws/base.rb +8 -8
- data/lib/marty/aws/request.rb +4 -4
- data/lib/marty/cache_adapters/mcfly_ruby_cache.rb +1 -0
- data/lib/marty/content_handler.rb +25 -25
- data/lib/marty/data_change.rb +49 -71
- data/lib/marty/data_conversion.rb +20 -28
- data/lib/marty/data_exporter.rb +25 -28
- data/lib/marty/data_importer.rb +25 -27
- data/lib/marty/engine.rb +1 -2
- data/lib/marty/json_schema.rb +22 -24
- data/lib/marty/logger.rb +6 -9
- data/lib/marty/mcfly_model.rb +20 -24
- data/lib/marty/migrations.rb +37 -35
- data/lib/marty/monkey.rb +33 -33
- data/lib/marty/permissions.rb +18 -18
- data/lib/marty/promise_job.rb +17 -17
- data/lib/marty/promise_proxy.rb +6 -6
- data/lib/marty/relation.rb +6 -7
- data/lib/marty/rpc_call.rb +13 -12
- data/lib/marty/rule_script_set.rb +32 -28
- data/lib/marty/schema_helper.rb +37 -51
- data/lib/marty/util.rb +25 -24
- data/lib/marty/version.rb +1 -1
- data/lib/marty/xl.rb +121 -115
- data/make-dummy.mk +3 -0
- data/marty.gemspec +21 -21
- data/other/marty/api/base.rb +34 -35
- data/other/marty/diagnostic/aws/ec2_instance.rb +8 -8
- data/other/marty/diagnostic/base.rb +13 -14
- data/other/marty/diagnostic/collection.rb +2 -1
- data/other/marty/diagnostic/connections.rb +8 -6
- data/other/marty/diagnostic/database.rb +1 -0
- data/other/marty/diagnostic/delayed_job_version.rb +7 -9
- data/other/marty/diagnostic/delayed_job_worker_total_count.rb +1 -1
- data/other/marty/diagnostic/delayed_job_workers.rb +1 -1
- data/other/marty/diagnostic/environment_variables.rb +17 -15
- data/other/marty/diagnostic/fatal.rb +1 -1
- data/other/marty/diagnostic/node.rb +5 -9
- data/other/marty/diagnostic/nodes.rb +7 -5
- data/other/marty/diagnostic/packer.rb +7 -7
- data/other/marty/diagnostic/reporter.rb +24 -27
- data/other/marty/diagnostic/version.rb +3 -5
- data/script/rails +2 -1
- data/spec/controllers/application_controller_spec.rb +6 -6
- data/spec/controllers/delayed_job_controller_spec.rb +4 -4
- data/spec/controllers/diagnostic/controller_spec.rb +59 -60
- data/spec/controllers/job_controller_spec.rb +68 -69
- data/spec/controllers/rpc_controller_spec.rb +353 -359
- data/spec/controllers/rpc_import_spec.rb +15 -16
- data/spec/dummy/delorean/blame_report.dl +110 -15
- data/spec/dummy/delorean/data_report.dl +4 -4
- data/spec/dummy/delorean/marty_fields.dl +63 -0
- data/spec/dummy/delorean/table_report.dl +34 -0
- data/spec/features/auth_app_spec.rb +1 -2
- data/spec/features/data_import_spec.rb +2 -3
- data/spec/features/enum_spec.rb +42 -46
- data/spec/features/jobs_dashboard_spec.rb +14 -8
- data/spec/features/log_view_spec.rb +40 -43
- data/spec/features/reporting_spec.rb +15 -15
- data/spec/features/rule_spec.rb +195 -190
- data/spec/features/scripting_spec.rb +17 -20
- data/spec/features/scripting_test_spec.rb +32 -33
- data/spec/features/user_view_spec.rb +15 -17
- data/spec/job_helper.rb +11 -11
- data/spec/lib/data_blame_spec.rb +82 -0
- data/spec/lib/data_exporter_spec.rb +31 -32
- data/spec/lib/data_importer_spec.rb +382 -395
- data/spec/lib/delorean_query_spec.rb +117 -119
- data/spec/lib/json_schema_spec.rb +382 -392
- data/spec/lib/logger_spec.rb +23 -24
- data/spec/lib/mcfly_model_spec.rb +112 -109
- data/spec/lib/migrations_spec.rb +10 -10
- data/spec/lib/struct_compare_spec.rb +6 -6
- data/spec/lib/table_report_spec.rb +90 -0
- data/spec/lib/xl_spec.rb +63 -65
- data/spec/lib/xl_styles_spec.rb +16 -19
- data/spec/models/api_auth_spec.rb +30 -30
- data/spec/models/config_spec.rb +32 -32
- data/spec/models/data_grid_spec.rb +642 -655
- data/spec/models/event_spec.rb +96 -88
- data/spec/models/import_type_spec.rb +20 -20
- data/spec/models/posting_spec.rb +35 -35
- data/spec/models/promise_spec.rb +5 -5
- data/spec/models/rule_spec.rb +280 -269
- data/spec/models/script_spec.rb +27 -18
- data/spec/models/user_spec.rb +9 -9
- data/spec/other/diagnostic/base_spec.rb +20 -19
- data/spec/other/diagnostic/collection_spec.rb +6 -5
- data/spec/other/diagnostic/delayed_job_version_spec.rb +1 -1
- data/spec/other/diagnostic/delayed_job_workers_spec.rb +8 -8
- data/spec/other/diagnostic/reporter_spec.rb +31 -33
- data/spec/spec_helper.rb +5 -5
- data/spec/support/chromedriver.rb +3 -5
- data/spec/support/components/netzke_combobox.rb +1 -1
- data/spec/support/components/netzke_grid.rb +17 -17
- data/spec/support/custom_matchers.rb +2 -2
- data/spec/support/download_helper.rb +1 -1
- data/spec/support/helper.rb +1 -2
- data/spec/support/netzke.rb +31 -31
- data/spec/support/performance_helper.rb +8 -8
- data/spec/support/post_run_logger.rb +1 -2
- data/spec/support/setup.rb +1 -4
- data/spec/support/shared_connection.rb +2 -2
- data/spec/support/structure_compare.rb +21 -22
- data/spec/support/suite.rb +1 -2
- data/spec/support/users.rb +5 -6
- metadata +32 -26
|
@@ -6,16 +6,16 @@ describe 'Jobs Dashboard', type: :feature, js: true, capybara: true do
|
|
|
6
6
|
firstname: 'other',
|
|
7
7
|
lastname: 'other',
|
|
8
8
|
active: true)
|
|
9
|
-
Marty::Promise.create title:
|
|
9
|
+
Marty::Promise.create title: 'Test Job 1',
|
|
10
10
|
user: Marty::User.find_by(login: 'marty'),
|
|
11
11
|
cformat: 'csv',
|
|
12
12
|
start_dt: Time.now
|
|
13
|
-
Marty::Promise.create title:
|
|
13
|
+
Marty::Promise.create title: 'Test Job 2',
|
|
14
14
|
user: other_user,
|
|
15
15
|
cformat: 'csv',
|
|
16
16
|
start_dt: Time.now
|
|
17
17
|
|
|
18
|
-
visit
|
|
18
|
+
visit '/'
|
|
19
19
|
all 'span', text: 'Sign in', minimum: 1
|
|
20
20
|
find(ext_button_id('Sign in')).click
|
|
21
21
|
fill_in 'Login', with: 'marty'
|
|
@@ -25,29 +25,35 @@ describe 'Jobs Dashboard', type: :feature, js: true, capybara: true do
|
|
|
25
25
|
|
|
26
26
|
find(ext_button_id('Applications')).click
|
|
27
27
|
find(ext_menuitem_id('Jobs Dashboard')).click
|
|
28
|
-
page_title = I18n.t(
|
|
28
|
+
page_title = I18n.t('jobs.promise_view')
|
|
29
29
|
expect(page).to have_content(page_title)
|
|
30
30
|
|
|
31
31
|
sleep 1
|
|
32
32
|
|
|
33
33
|
expect(tree_row_count(page_title)).to eq(2)
|
|
34
34
|
|
|
35
|
-
fill_in
|
|
35
|
+
fill_in 'live_search_text', with: 'marty'
|
|
36
36
|
sleep 1
|
|
37
37
|
expect(tree_row_count(page_title)).to eq(1)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def ext_button_id title
|
|
41
|
-
id = page.evaluate_script(
|
|
41
|
+
id = page.evaluate_script(
|
|
42
|
+
"Ext.ComponentQuery.query(\"button{isVisible(true)}[text='#{title}']\")[0].id"
|
|
43
|
+
)
|
|
42
44
|
"##{id}"
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
def ext_menuitem_id title
|
|
46
|
-
id = page.evaluate_script(
|
|
48
|
+
id = page.evaluate_script(
|
|
49
|
+
"Ext.ComponentQuery.query(\"menuitem[text='#{title}']\")[0].id"
|
|
50
|
+
)
|
|
47
51
|
"##{id}"
|
|
48
52
|
end
|
|
49
53
|
|
|
50
54
|
def tree_row_count name
|
|
51
|
-
page.evaluate_script(
|
|
55
|
+
page.evaluate_script(
|
|
56
|
+
"Ext.ComponentQuery.query('treepanel[title=\"#{name}\"]')[0].getStore().getCount()"
|
|
57
|
+
)
|
|
52
58
|
end
|
|
53
59
|
end
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
|
|
3
3
|
feature 'logger view', js: true, capybara: true do
|
|
4
|
-
|
|
5
4
|
before(:all) do
|
|
6
5
|
self.use_transactional_tests = false
|
|
7
6
|
Marty::Log.delete_all
|
|
8
7
|
|
|
9
8
|
info_s = { info: 'message' }
|
|
10
9
|
error_s = [1, 2, 3, { error: 'message' }]
|
|
11
|
-
fatal_s = [
|
|
10
|
+
fatal_s = ['string', 123, { fatal: 'message', another_key: 'value' }]
|
|
12
11
|
Marty::Logger.info('info message', nil)
|
|
13
12
|
Marty::Logger.error('error message', error_s)
|
|
14
13
|
Marty::Logger.fatal('fatal message', fatal_s)
|
|
15
14
|
|
|
16
|
-
Marty::Log.create!(message_type:
|
|
17
|
-
message:
|
|
18
|
-
details: [
|
|
15
|
+
Marty::Log.create!(message_type: 'debug',
|
|
16
|
+
message: 'hi mom',
|
|
17
|
+
details: ['one', 'two', 3, 4.0],
|
|
19
18
|
timestamp: Time.zone.now - 5.days)
|
|
20
19
|
|
|
21
|
-
Marty::Log.create!(message_type:
|
|
22
|
-
message:
|
|
20
|
+
Marty::Log.create!(message_type: 'warn',
|
|
21
|
+
message: 'all your base',
|
|
23
22
|
details: [5],
|
|
24
23
|
timestamp: Time.zone.now - 10.days)
|
|
25
24
|
|
|
26
|
-
@ts = Marty::Log.select(:timestamp).order(timestamp: :desc).map do
|
|
27
|
-
|(ts)|
|
|
25
|
+
@ts = Marty::Log.select(:timestamp).order(timestamp: :desc).map do |(ts)|
|
|
28
26
|
Time.zone.at(ts[:timestamp]).strftime('%Y-%m-%dT%H:%M:%S.%L%:z')
|
|
29
27
|
end
|
|
30
28
|
|
|
@@ -40,47 +38,46 @@ feature 'logger view', js: true, capybara: true do
|
|
|
40
38
|
end
|
|
41
39
|
|
|
42
40
|
let(:logview) { netzke_find('log_view') }
|
|
43
|
-
it
|
|
41
|
+
it 'updates views correctly' do
|
|
44
42
|
log_in_as('marty')
|
|
45
43
|
press('System')
|
|
46
44
|
show_submenu('Log Maintenance')
|
|
47
45
|
press('View Log')
|
|
48
46
|
wait_for_ajax
|
|
49
47
|
|
|
50
|
-
exp_types = [
|
|
51
|
-
exp_messages = [
|
|
52
|
-
|
|
53
|
-
exp_details = [
|
|
48
|
+
exp_types = ['fatal', 'error', 'info', 'debug', 'warn']
|
|
49
|
+
exp_messages = ['fatal message', 'error message',
|
|
50
|
+
'info message', 'hi mom', 'all your base']
|
|
51
|
+
exp_details = ['["string", 123, {"fatal"=>"message", '\
|
|
54
52
|
"\"another_key\"=>\"value\"}]\n",
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
expect(details).to eq(exp_details.slice(0,exp_count))
|
|
53
|
+
"[1, 2, 3, {\"error\"=>\"message\"}]\n",
|
|
54
|
+
"nil\n",
|
|
55
|
+
"[\"one\", \"two\", 3, 4.0]\n",
|
|
56
|
+
"[5]\n"]
|
|
57
|
+
[[nil, 5], [7, 4], [3, 3], [0, 0]].each do |days, exp_count|
|
|
58
|
+
if days
|
|
59
|
+
press('System')
|
|
60
|
+
show_submenu('Log Maintenance')
|
|
61
|
+
press('Cleanup Log Table')
|
|
62
|
+
wait_for_ajax
|
|
63
|
+
find(:xpath, "//input[contains(@id, 'textfield')]", wait: 5).set(days)
|
|
64
|
+
press('OK')
|
|
65
|
+
wait_for_ready
|
|
66
|
+
find('.x-tool-refresh').click
|
|
67
|
+
wait_for_ready
|
|
68
|
+
end
|
|
69
|
+
wait_for_ajax
|
|
70
|
+
cnt = logview.row_count()
|
|
71
|
+
expect(cnt).to eq(exp_count)
|
|
72
|
+
types = logview.get_col_vals('message_type', cnt, 0)
|
|
73
|
+
messages = logview.get_col_vals('message', cnt, 0)
|
|
74
|
+
details = logview.get_col_vals('details', cnt, 0).
|
|
75
|
+
map { |d| CGI.unescapeHTML(d) }
|
|
76
|
+
ts = logview.get_col_vals('timestamp_custom', cnt, 0)
|
|
77
|
+
expect(ts).to eq(@ts.slice(0, exp_count))
|
|
78
|
+
expect(types).to eq(exp_types.slice(0, exp_count))
|
|
79
|
+
expect(messages).to eq(exp_messages.slice(0, exp_count))
|
|
80
|
+
expect(details).to eq(exp_details.slice(0, exp_count))
|
|
84
81
|
end
|
|
85
82
|
end
|
|
86
83
|
end
|
|
@@ -2,8 +2,8 @@ require 'spec_helper'
|
|
|
2
2
|
|
|
3
3
|
feature 'under Applications menu, Reports workflows', js: true do
|
|
4
4
|
before(:all) do
|
|
5
|
-
SOME_DATE =
|
|
6
|
-
SOME_TIME =
|
|
5
|
+
SOME_DATE = '20130520'
|
|
6
|
+
SOME_TIME = '1200'
|
|
7
7
|
SOME_DT = "#{SOME_DATE} #{SOME_TIME} PST8PDT"
|
|
8
8
|
@clean_file = "/tmp/clean_#{Process.pid}.psql"
|
|
9
9
|
save_clean_db(@clean_file)
|
|
@@ -32,7 +32,7 @@ feature 'under Applications menu, Reports workflows', js: true do
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def populate_sample_reports
|
|
35
|
-
a_report
|
|
35
|
+
a_report = <<DELOREAN
|
|
36
36
|
PostingField:
|
|
37
37
|
field_label = "Posting"
|
|
38
38
|
xtype = ":combo"
|
|
@@ -76,24 +76,24 @@ DD: BB
|
|
|
76
76
|
result = 444
|
|
77
77
|
DELOREAN
|
|
78
78
|
|
|
79
|
-
with_user(
|
|
79
|
+
with_user('dev1') do |u|
|
|
80
80
|
Marty::Posting.do_create('BASE', SOME_DT, 'a comment')
|
|
81
81
|
|
|
82
82
|
Marty::Script.
|
|
83
|
-
load_script_bodies({
|
|
83
|
+
load_script_bodies({ 'SomeReport' => a_report, },
|
|
84
84
|
Date.today)
|
|
85
85
|
|
|
86
86
|
Marty::Script.
|
|
87
|
-
load_script_bodies({
|
|
87
|
+
load_script_bodies({ 'SomeReport' =>
|
|
88
88
|
a_report +
|
|
89
89
|
"CC: BB\n title=\"CC\"\n result = 123" },
|
|
90
90
|
Date.today + 1.minute)
|
|
91
|
-
|
|
91
|
+
end
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
def select_node node_name
|
|
95
95
|
wait_for_ajax
|
|
96
|
-
#hacky: assumes only 1 combobox without label
|
|
96
|
+
# hacky: assumes only 1 combobox without label
|
|
97
97
|
within(:gridpanel, 'report_select', match: :first) do
|
|
98
98
|
# hacky, hardcoding netzkecombobox dropdown arrow name
|
|
99
99
|
arrow = find(:input, 'nodename')['data-componentid'] + '-trigger-picker'
|
|
@@ -131,12 +131,12 @@ DELOREAN
|
|
|
131
131
|
select_node('CC (csv)')
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
and_by 'fill form' do
|
|
135
|
+
wait_for_ajax
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
within(:gridpanel, 'report_form', match: :first) do
|
|
138
|
+
fill_in('Note Rate', with: '3.00')
|
|
139
|
+
end
|
|
140
140
|
end
|
|
141
141
|
|
|
142
142
|
and_by 'do Background Report with delayed jobs' do
|
|
@@ -202,7 +202,7 @@ DELOREAN
|
|
|
202
202
|
# hidden field that causes results to be inlined
|
|
203
203
|
set_field_value('true', 'textfield', 'selected_testing')
|
|
204
204
|
|
|
205
|
-
press(
|
|
205
|
+
press('Generate Report')
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
wait_for_element do
|
|
@@ -284,7 +284,7 @@ DELOREAN
|
|
|
284
284
|
wait_for_ajax
|
|
285
285
|
set_field_value('XYZ', '', 'pt_name')
|
|
286
286
|
set_field_value('true', 'textfield', 'selected_testing')
|
|
287
|
-
press(
|
|
287
|
+
press('Generate URL')
|
|
288
288
|
wait_for_ajax
|
|
289
289
|
|
|
290
290
|
within_window(switch_to_window(windows.last)) do
|
data/spec/features/rule_spec.rb
CHANGED
|
@@ -10,29 +10,32 @@ feature 'rule view', js: true do
|
|
|
10
10
|
dt = DateTime.parse('2017-1-1')
|
|
11
11
|
p = File.expand_path('../../fixtures/csv/rule', __FILE__)
|
|
12
12
|
[Marty::DataGrid, Gemini::XyzRule, Gemini::MyRule].each do |klass|
|
|
13
|
-
f =
|
|
14
|
-
Marty::DataImporter.do_import(klass, File.read(f), dt, nil, nil,
|
|
13
|
+
f = '%s/%s.csv' % [p, klass.to_s.sub(/(Gemini|Marty)::/, '')]
|
|
14
|
+
Marty::DataImporter.do_import(klass, File.read(f), dt, nil, nil, ',')
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
after(:all) do
|
|
18
18
|
restore_clean_db(@save_file)
|
|
19
19
|
end
|
|
20
20
|
def go_to_my_rules
|
|
21
|
-
press(
|
|
22
|
-
press(
|
|
21
|
+
press('Pricing Config.')
|
|
22
|
+
press('My Rules')
|
|
23
23
|
expect(page).to have_content 'My Rules'
|
|
24
24
|
end
|
|
25
|
+
|
|
25
26
|
def go_to_xyz_rules
|
|
26
|
-
press(
|
|
27
|
-
press(
|
|
27
|
+
press('Pricing Config.')
|
|
28
|
+
press('Xyz Rules')
|
|
28
29
|
expect(page).to have_content 'Xyz Rules'
|
|
29
30
|
end
|
|
31
|
+
|
|
30
32
|
def col_id(v, col)
|
|
31
33
|
run_js <<-JS
|
|
32
34
|
#{ext_var(v.grid, 'grid')}
|
|
33
35
|
return #{ext_find(ext_arg('gridcolumn', text: col), 'grid')}.id
|
|
34
36
|
JS
|
|
35
37
|
end
|
|
38
|
+
|
|
36
39
|
# click_checkbox in marty_rspec not working here for some reason
|
|
37
40
|
def click_checkbox(name)
|
|
38
41
|
q = %Q(checkbox[fieldLabel="#{name}"])
|
|
@@ -43,9 +46,9 @@ feature 'rule view', js: true do
|
|
|
43
46
|
end
|
|
44
47
|
|
|
45
48
|
# click_col in marty_rspec is not reliable
|
|
46
|
-
def click_column(rv,name)
|
|
49
|
+
def click_column(rv, name)
|
|
47
50
|
cid = col_id(rv, name)
|
|
48
|
-
c = find('#'+cid)
|
|
51
|
+
c = find('#' + cid)
|
|
49
52
|
c.select_option # .click does not work reliably
|
|
50
53
|
c.send_keys(' ')
|
|
51
54
|
# wait_for_ajax and wait_for_ready do not work here,
|
|
@@ -53,33 +56,36 @@ feature 'rule view', js: true do
|
|
|
53
56
|
sleep 1.0
|
|
54
57
|
end
|
|
55
58
|
|
|
56
|
-
def column_filter(rv,name,value)
|
|
59
|
+
def column_filter(rv, name, value)
|
|
57
60
|
cid = col_id(rv, name)
|
|
58
|
-
c = find('#'+cid)
|
|
61
|
+
c = find('#' + cid)
|
|
59
62
|
c.send_keys([:down, :down, :down, :down, :right, value, :return])
|
|
60
63
|
sleep 1.0
|
|
61
64
|
end
|
|
62
|
-
|
|
65
|
+
|
|
66
|
+
def column_filter_toggle(rv, name)
|
|
63
67
|
cid = col_id(rv, name)
|
|
64
|
-
c = find('#'+cid)
|
|
68
|
+
c = find('#' + cid)
|
|
65
69
|
c.send_keys([:down, :down, :down, :down, ' ', :escape])
|
|
66
70
|
sleep 1.0
|
|
67
71
|
end
|
|
72
|
+
|
|
68
73
|
# idx 0 is the start dt, 1 is the end dt
|
|
69
74
|
def date_fill_in(idx, value)
|
|
70
75
|
dt = all(:xpath, "//input[contains(@name, 'datefield')]")[idx]
|
|
71
76
|
dt.native.clear()
|
|
72
77
|
dt.native.send_keys(value)
|
|
73
78
|
end
|
|
74
|
-
|
|
79
|
+
|
|
80
|
+
def time_fill_in(idx, value)
|
|
75
81
|
tm = all(:xpath, "//input[contains(@name, 'timefield')]")[idx]
|
|
76
82
|
tm.native.clear()
|
|
77
83
|
tm.native.send_keys(value)
|
|
78
84
|
end
|
|
79
|
-
it
|
|
85
|
+
it 'rule workflow' do
|
|
80
86
|
log_in_as('marty')
|
|
81
87
|
go_to_my_rules
|
|
82
|
-
mrv = netzke_find(
|
|
88
|
+
mrv = netzke_find('my_rule_view')
|
|
83
89
|
# test required field
|
|
84
90
|
press('Add')
|
|
85
91
|
wait_for_ajax
|
|
@@ -94,108 +100,108 @@ feature 'rule view', js: true do
|
|
|
94
100
|
time_fill_in(0, '11:03:01')
|
|
95
101
|
date_fill_in(1, '2030-01-01')
|
|
96
102
|
time_fill_in(1, '08:03:01')
|
|
97
|
-
press(
|
|
103
|
+
press('OK')
|
|
98
104
|
wait_for_ajax
|
|
99
105
|
expect(mrv.row_count()).to eq(9)
|
|
100
|
-
expect(mrv.get_row_vals(1)).to include(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
106
|
+
expect(mrv.get_row_vals(1)).to include('name' => 'abc',
|
|
107
|
+
'rule_type' => 'SimpleRule',
|
|
108
|
+
'start_dt' => '2013-01-01T11:03:01',
|
|
109
|
+
'end_dt' => '2030-01-01T08:03:01',
|
|
110
|
+
'other_flag' => false,
|
|
111
|
+
'g_array' => '',
|
|
112
|
+
'g_single' => '',
|
|
113
|
+
'g_string' => '',
|
|
114
|
+
'g_bool' => nil,
|
|
115
|
+
'g_nullbool' => '',
|
|
116
|
+
'g_bool_def' => nil,
|
|
117
|
+
'g_nbool_def' => 'False',
|
|
118
|
+
'g_range' => nil,
|
|
119
|
+
'g_integer' => nil,
|
|
120
|
+
'g_has_default' => 'string default',
|
|
121
|
+
'computed_guards' => '',
|
|
122
|
+
'grids' => '',
|
|
123
|
+
'results' => '',
|
|
124
|
+
)
|
|
119
125
|
|
|
120
126
|
r = Gemini::MyRule.find_by(obsoleted_dt: 'infinity', name: 'abc')
|
|
121
|
-
expect(r.attributes).to include(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
expect(r.attributes).to include('user_id' => 1,
|
|
128
|
+
'o_user_id' => nil,
|
|
129
|
+
'name' => 'abc',
|
|
130
|
+
'engine' => 'Gemini::MyRuleScriptSet',
|
|
131
|
+
'rule_type' => 'SimpleRule',
|
|
132
|
+
'simple_guards' => { 'g_bool' => false,
|
|
133
|
+
'g_bool_def' => false,
|
|
134
|
+
'g_nbool_def' => false,
|
|
135
|
+
'g_has_default' =>
|
|
136
|
+
'string default' },
|
|
137
|
+
'computed_guards' => {},
|
|
138
|
+
'grids' => {},
|
|
139
|
+
'results' => {},
|
|
140
|
+
)
|
|
135
141
|
# type validation (string with values list)
|
|
136
142
|
mrv.select_row(1)
|
|
137
|
-
press(
|
|
143
|
+
press('Edit')
|
|
138
144
|
# type validation (range)
|
|
139
|
-
netzke_find(
|
|
140
|
-
click_checkbox(
|
|
141
|
-
click_checkbox(
|
|
142
|
-
netzke_find(
|
|
143
|
-
netzke_find('Array Guard', 'combobox').select_values(
|
|
144
|
-
netzke_find('Single Guard', 'combobox').select_values(
|
|
145
|
+
netzke_find('String list Guard', 'combobox').select_values('Hi Mom')
|
|
146
|
+
click_checkbox('Bool Guard')
|
|
147
|
+
click_checkbox('Other')
|
|
148
|
+
netzke_find('NullBool Guard', 'combobox').select_values('False')
|
|
149
|
+
netzke_find('Array Guard', 'combobox').select_values('G1V1,G1V3')
|
|
150
|
+
netzke_find('Single Guard', 'combobox').select_values('G2V2')
|
|
145
151
|
fill_in(:g_integer, with: 123)
|
|
146
|
-
fill_in(:g_range, with:
|
|
147
|
-
press(
|
|
152
|
+
fill_in(:g_range, with: 'asfd')
|
|
153
|
+
press('OK')
|
|
148
154
|
wait_for_ajax
|
|
149
155
|
expect(page).to have_content("Wrong type for 'g_range'")
|
|
150
156
|
# validate rule
|
|
151
|
-
fill_in(:g_range, with:
|
|
152
|
-
netzke_find('Grid1', 'combobox').select_values(
|
|
153
|
-
netzke_find('Grid2', 'combobox').select_values(
|
|
154
|
-
fill_in(
|
|
155
|
-
press(
|
|
157
|
+
fill_in(:g_range, with: '<=100')
|
|
158
|
+
netzke_find('Grid1', 'combobox').select_values('DataGrid1')
|
|
159
|
+
netzke_find('Grid2', 'combobox').select_values('DataGrid2')
|
|
160
|
+
fill_in('Defaulted String', with: '12345')
|
|
161
|
+
press('OK')
|
|
156
162
|
wait_for_ajax
|
|
157
|
-
exp = {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
exp = { 'name' => 'abc',
|
|
164
|
+
'rule_type' => 'SimpleRule',
|
|
165
|
+
'start_dt' => '2013-01-01T11:03:01',
|
|
166
|
+
'end_dt' => '2030-01-01T08:03:01',
|
|
167
|
+
'other_flag' => true,
|
|
168
|
+
'g_array' => 'G1V1,G1V3',
|
|
169
|
+
'g_single' => 'G2V2',
|
|
170
|
+
'g_string' => 'Hi Mom',
|
|
171
|
+
'g_bool' => true,
|
|
172
|
+
'g_nullbool' => 'False',
|
|
173
|
+
'g_range' => '<=100',
|
|
174
|
+
'g_integer' => 123,
|
|
175
|
+
'g_has_default' => '12345',
|
|
176
|
+
'computed_guards' => '',
|
|
177
|
+
'grids' => '{"grid1":"DataGrid1","grid2":"DataGrid2"}',
|
|
178
|
+
'results' => '',
|
|
173
179
|
}
|
|
174
|
-
r = Gemini::MyRule.lookup('infinity','abc')
|
|
175
|
-
expect(r[
|
|
180
|
+
r = Gemini::MyRule.lookup('infinity', 'abc')
|
|
181
|
+
expect(r['simple_guards']['g_nullbool']).to eq(false)
|
|
176
182
|
expect(mrv.get_row_vals(1)).to include(exp)
|
|
177
183
|
# grid edits
|
|
178
|
-
press(
|
|
179
|
-
netzke_find('Grid2', 'combobox').select_values(
|
|
180
|
-
press(
|
|
184
|
+
press('Edit')
|
|
185
|
+
netzke_find('Grid2', 'combobox').select_values('---')
|
|
186
|
+
press('OK')
|
|
181
187
|
wait_for_ajax
|
|
182
|
-
expect(mrv.get_row_vals(1)).to include(exp+{
|
|
183
|
-
|
|
184
|
-
press(
|
|
185
|
-
netzke_find(
|
|
186
|
-
press(
|
|
188
|
+
expect(mrv.get_row_vals(1)).to include(exp + { 'grids' =>
|
|
189
|
+
'{"grid1":"DataGrid1"}' })
|
|
190
|
+
press('Edit')
|
|
191
|
+
netzke_find('NullBool Guard', 'combobox').select_values('---')
|
|
192
|
+
press('OK')
|
|
187
193
|
wait_for_ajax
|
|
188
|
-
expect(mrv.get_row_vals(1)).to include(exp+{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
r = Gemini::MyRule.lookup('infinity','abc')
|
|
192
|
-
expect(r[
|
|
194
|
+
expect(mrv.get_row_vals(1)).to include(exp + { 'g_nullbool' => '',
|
|
195
|
+
'grids' =>
|
|
196
|
+
'{"grid1":"DataGrid1"}' })
|
|
197
|
+
r = Gemini::MyRule.lookup('infinity', 'abc')
|
|
198
|
+
expect(r['simple_guards']).not_to include('g_nullbool')
|
|
193
199
|
# computed fields
|
|
194
|
-
press(
|
|
200
|
+
press('Edit')
|
|
195
201
|
|
|
196
202
|
# bad form - BaseRuleView#simple_to_hash will raise
|
|
197
203
|
fill_in(:computed_guards, with: 'sadf asdf ljsf')
|
|
198
|
-
press(
|
|
204
|
+
press('OK')
|
|
199
205
|
wait_for_ajax
|
|
200
206
|
exp = "Computed - Error in rule 'abc' field 'computed_guards': Syntax error on line 1"
|
|
201
207
|
expect(page).to have_content(exp)
|
|
@@ -204,7 +210,7 @@ feature 'rule view', js: true do
|
|
|
204
210
|
|
|
205
211
|
# lhs is not identifier - BaseRuleView#simple_to_has will raise
|
|
206
212
|
fill_in(:computed_guards, with: '0sadf = 123j')
|
|
207
|
-
press(
|
|
213
|
+
press('OK')
|
|
208
214
|
wait_for_ajax
|
|
209
215
|
exp = "Computed - Error in rule 'abc' field 'computed_guards': Syntax error on line 1"
|
|
210
216
|
expect(page).to have_content(exp)
|
|
@@ -212,14 +218,14 @@ feature 'rule view', js: true do
|
|
|
212
218
|
|
|
213
219
|
# bad rhs - delorean compile will raise
|
|
214
220
|
fill_in(:computed_guards, with: 'var = 123j')
|
|
215
|
-
press(
|
|
221
|
+
press('OK')
|
|
216
222
|
wait_for_ajax
|
|
217
223
|
exp = "Computed - Error in rule 'abc' field 'computed_guards': Syntax error"
|
|
218
224
|
expect(page).to have_content(exp)
|
|
219
225
|
sleep 2
|
|
220
226
|
|
|
221
227
|
fill_in(:computed_guards, with: %Q(var1 = "good"\nvar2 = 123\nvar3 = 123j))
|
|
222
|
-
press(
|
|
228
|
+
press('OK')
|
|
223
229
|
wait_for_ajax
|
|
224
230
|
exp = "Computed - Error in rule 'abc' field 'computed_guards': Syntax error"
|
|
225
231
|
expect(page).to have_content(exp)
|
|
@@ -227,14 +233,14 @@ feature 'rule view', js: true do
|
|
|
227
233
|
|
|
228
234
|
fill_in(:computed_guards, with: '')
|
|
229
235
|
fill_in(:results, with: %Q(var1 = "good"\nvar2 = 123\nvar3 = 123j))
|
|
230
|
-
press(
|
|
236
|
+
press('OK')
|
|
231
237
|
wait_for_ajax
|
|
232
238
|
exp = "Computed - Error in rule 'abc' field 'results': Syntax error"
|
|
233
239
|
expect(page).to have_content(exp)
|
|
234
240
|
sleep 2
|
|
235
241
|
|
|
236
242
|
fill_in(:results, with: %Q(abc = "def"\ndef = 5\nxyz=def+10\nsadf asdf lsf))
|
|
237
|
-
press(
|
|
243
|
+
press('OK')
|
|
238
244
|
wait_for_ajax
|
|
239
245
|
exp = "Computed - Error in rule 'abc' field 'results': Syntax error"
|
|
240
246
|
expect(page).to have_content(exp)
|
|
@@ -243,8 +249,8 @@ feature 'rule view', js: true do
|
|
|
243
249
|
fill_in(:results,
|
|
244
250
|
with: %Q(abc = "def"\ndef = "abc"\nklm = "3"\nabc = "xyz"))
|
|
245
251
|
exp = "Computed - Error in rule 'abc' field 'results': Keyword 'abc' specified more"\
|
|
246
|
-
|
|
247
|
-
press(
|
|
252
|
+
' than once (line 4)'
|
|
253
|
+
press('OK')
|
|
248
254
|
wait_for_ajax
|
|
249
255
|
expect(page).to have_content(exp)
|
|
250
256
|
sleep 2
|
|
@@ -265,20 +271,20 @@ klm = 3 +
|
|
|
265
271
|
EOL
|
|
266
272
|
|
|
267
273
|
fill_in(:results, with: multi_line)
|
|
268
|
-
press(
|
|
274
|
+
press('OK')
|
|
269
275
|
wait_for_ajax
|
|
270
276
|
|
|
271
277
|
# re-edit twice to make sure re-indentation and stripping are correct
|
|
272
|
-
press(
|
|
278
|
+
press('Edit')
|
|
273
279
|
wait_for_ajax
|
|
274
280
|
expect(find_field(:results).value).to eq(multi_line_fixed.chomp)
|
|
275
|
-
press(
|
|
281
|
+
press('OK')
|
|
276
282
|
wait_for_ajax
|
|
277
283
|
|
|
278
|
-
press(
|
|
284
|
+
press('Edit')
|
|
279
285
|
wait_for_ajax
|
|
280
286
|
expect(find_field(:results).value).to eq(multi_line_fixed.chomp)
|
|
281
|
-
press(
|
|
287
|
+
press('OK')
|
|
282
288
|
wait_for_ajax
|
|
283
289
|
|
|
284
290
|
# when stored in rule, all lines of a multi line value s/b stripped
|
|
@@ -286,121 +292,121 @@ EOL
|
|
|
286
292
|
expect(r.results['klm']).to eq("3 +\n4 +\nif true then 5 else 0")
|
|
287
293
|
|
|
288
294
|
# make sure change of key/value order is recognized as a change
|
|
289
|
-
press(
|
|
295
|
+
press('Edit')
|
|
290
296
|
wait_for_ajax
|
|
291
297
|
val = find_field(:results).value.lines
|
|
292
298
|
val[-1] += "\n"
|
|
293
299
|
newval = (val[1..-1] + val[0..0]).join
|
|
294
300
|
fill_in(:results, with: newval)
|
|
295
|
-
press(
|
|
301
|
+
press('OK')
|
|
296
302
|
wait_for_ajax
|
|
297
|
-
press(
|
|
303
|
+
press('Edit')
|
|
298
304
|
wait_for_ajax
|
|
299
|
-
val = find_field(:results).value+"\n"
|
|
305
|
+
val = find_field(:results).value + "\n"
|
|
300
306
|
expect(val).to eq(newval)
|
|
301
|
-
press(
|
|
307
|
+
press('OK')
|
|
302
308
|
wait_for_ajax
|
|
303
309
|
|
|
304
|
-
exp
|
|
310
|
+
exp = <<EOL
|
|
305
311
|
simple_result = "c value"
|
|
306
312
|
computed_value = if paramb
|
|
307
313
|
then param1 / (grid1_grid_result||1)
|
|
308
314
|
else (grid2_grid_result||1) / param1
|
|
309
315
|
EOL
|
|
310
316
|
names = mrv.get_col_vals(:name, 9, 0)
|
|
311
|
-
idx = names.index{|n|n=='Rule3'}+1
|
|
317
|
+
idx = names.index { |n| n == 'Rule3' } + 1
|
|
312
318
|
mrv.select_row(idx)
|
|
313
|
-
press(
|
|
319
|
+
press('Edit')
|
|
314
320
|
expect(find_field(:results).value).to eq(exp.chomp)
|
|
315
|
-
press(
|
|
321
|
+
press('OK')
|
|
316
322
|
wait_for_ajax
|
|
317
323
|
|
|
318
|
-
press(
|
|
319
|
-
netzke_find('Single Guard', 'combobox').select_values(
|
|
320
|
-
press(
|
|
324
|
+
press('Dup in form')
|
|
325
|
+
netzke_find('Single Guard', 'combobox').select_values('G2V3')
|
|
326
|
+
press('OK')
|
|
321
327
|
wait_for_ajax
|
|
322
328
|
expect(page).to have_content(/record must be unique/)
|
|
323
329
|
|
|
324
|
-
press(
|
|
330
|
+
press('Cancel')
|
|
325
331
|
# column sorting, etc
|
|
326
332
|
go_to_xyz_rules
|
|
327
|
-
xrv = netzke_find(
|
|
328
|
-
expect(page).to have_content(
|
|
329
|
-
expect(xrv.get_col_vals(:name, 5, 0)).to eq([
|
|
330
|
-
|
|
331
|
-
|
|
333
|
+
xrv = netzke_find('xyz_rule_view')
|
|
334
|
+
expect(page).to have_content('Rule type')
|
|
335
|
+
expect(xrv.get_col_vals(:name, 5, 0)).to eq(['ZRule1', 'ZRule2',
|
|
336
|
+
'ZRule3', 'ZRule4',
|
|
337
|
+
'ZRule5'])
|
|
332
338
|
xrv.select_row(1)
|
|
333
|
-
press(
|
|
334
|
-
fill_in(
|
|
335
|
-
fill_in(
|
|
336
|
-
press(
|
|
339
|
+
press('Edit')
|
|
340
|
+
fill_in('Range Guard 1', with: '[100,200)')
|
|
341
|
+
fill_in('Range Guard 2', with: '[30,40)')
|
|
342
|
+
press('OK')
|
|
337
343
|
wait_for_ajax
|
|
338
|
-
r = Gemini::XyzRule.get_matches('infinity', {},
|
|
339
|
-
|
|
344
|
+
r = Gemini::XyzRule.get_matches('infinity', {}, 'g_range1' => 150,
|
|
345
|
+
'g_range2' => 35)
|
|
340
346
|
|
|
341
347
|
expect(r.to_a.count).to eq(1)
|
|
342
|
-
exp = {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
{
|
|
359
|
-
|
|
348
|
+
exp = { 'user_id' => 1,
|
|
349
|
+
'o_user_id' => nil,
|
|
350
|
+
'name' => 'ZRule1',
|
|
351
|
+
'engine' => 'Gemini::XyzRuleScriptSet',
|
|
352
|
+
'rule_type' => 'ZRule',
|
|
353
|
+
'start_dt' => DateTime.parse('2017-1-1 08:01:00'),
|
|
354
|
+
'simple_guards' => { 'g_bool' => false,
|
|
355
|
+
'g_date' => '2017-1-1',
|
|
356
|
+
'g_range1' => '[100,200)',
|
|
357
|
+
'g_range2' => '[30,40)',
|
|
358
|
+
'g_string' => 'aaa',
|
|
359
|
+
'g_integer' => '5',
|
|
360
|
+
'g_datetime' => '2017-1-1 12:00:01' },
|
|
361
|
+
'computed_guards' => {},
|
|
362
|
+
'grids' => { 'grid1' => 'DataGrid1' },
|
|
363
|
+
'results' =>
|
|
364
|
+
{ 'bvlen' => 'base_value.length',
|
|
365
|
+
'bv' => 'base_value' } }
|
|
360
366
|
|
|
361
367
|
expect(r.first.as_json).to include(exp)
|
|
362
|
-
expect(xrv.get_col_vals(:g_string, 8, 0)).to eq([
|
|
363
|
-
|
|
364
|
-
click_column(xrv,
|
|
365
|
-
expect(xrv.get_col_vals(:g_string, 8, 0)).to eq([
|
|
366
|
-
|
|
367
|
-
column_filter(xrv,
|
|
368
|
+
expect(xrv.get_col_vals(:g_string, 8, 0)).to eq(['aaa', 'bbb', 'ccc', 'ddd',
|
|
369
|
+
'eee', 'eee', 'eee', 'eee'])
|
|
370
|
+
click_column(xrv, 'String list Guard')
|
|
371
|
+
expect(xrv.get_col_vals(:g_string, 8, 0)).to eq(['eee', 'eee', 'eee', 'eee',
|
|
372
|
+
'ddd', 'ccc', 'bbb', 'aaa'])
|
|
373
|
+
column_filter(xrv, 'String list Guard', 'eee')
|
|
368
374
|
rc = xrv.row_count
|
|
369
|
-
expect(xrv.get_col_vals(:g_string,rc,0)).to eq([
|
|
370
|
-
column_filter_toggle(xrv,
|
|
375
|
+
expect(xrv.get_col_vals(:g_string, rc, 0)).to eq(['eee', 'eee', 'eee', 'eee'])
|
|
376
|
+
column_filter_toggle(xrv, 'String list Guard')
|
|
371
377
|
rc = xrv.row_count
|
|
372
|
-
expect(xrv.get_col_vals(:g_string,rc,0)).to eq([
|
|
373
|
-
|
|
374
|
-
column_filter(xrv,
|
|
378
|
+
expect(xrv.get_col_vals(:g_string, rc, 0)).to eq(['eee', 'eee', 'eee', 'eee',
|
|
379
|
+
'ddd', 'ccc', 'bbb', 'aaa'])
|
|
380
|
+
column_filter(xrv, 'Grids', 'Grid1')
|
|
375
381
|
rc = xrv.row_count
|
|
376
382
|
# netzke reports jsonb as string
|
|
377
|
-
expect(xrv.get_col_vals(:grids,rc,0)).to eq([%Q({"grid1":"DataGrid1"}),
|
|
378
|
-
|
|
379
|
-
column_filter_toggle(xrv,
|
|
383
|
+
expect(xrv.get_col_vals(:grids, rc, 0)).to eq([%Q({"grid1":"DataGrid1"}),
|
|
384
|
+
%Q({"grid1":"DataGrid1"})])
|
|
385
|
+
column_filter_toggle(xrv, 'Grids')
|
|
380
386
|
rc = xrv.row_count
|
|
381
|
-
expect(xrv.get_col_vals(:grids,rc,0)).to eq([%Q({"grid1":"DataGrid3"}),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
press(
|
|
390
|
-
press(
|
|
391
|
-
dgv = netzke_find(
|
|
387
|
+
expect(xrv.get_col_vals(:grids, rc, 0)).to eq([%Q({"grid1":"DataGrid3"}),
|
|
388
|
+
%Q({"grid1":"DataGrid3"}),
|
|
389
|
+
%Q({"grid1":"DataGrid3"}),
|
|
390
|
+
%Q({"grid1":"DataGrid3"}),
|
|
391
|
+
%Q({"grid1":"DataGrid3"}),
|
|
392
|
+
%Q({"grid1":"DataGrid2"}),
|
|
393
|
+
%Q({"grid1":"DataGrid1"}),
|
|
394
|
+
%Q({"grid1":"DataGrid1"})])
|
|
395
|
+
press('Applications')
|
|
396
|
+
press('Data Grids')
|
|
397
|
+
dgv = netzke_find('data_grid_view')
|
|
392
398
|
cvs = dgv.get_col_vals(:name, 4, 0)
|
|
393
|
-
ind1 = cvs.index(
|
|
394
|
-
ind4 = cvs.index(
|
|
399
|
+
ind1 = cvs.index('DataGrid1') + 1
|
|
400
|
+
ind4 = cvs.index('DataGrid4') + 1
|
|
395
401
|
dgv.select_row(ind1)
|
|
396
|
-
press(
|
|
397
|
-
fill_in(
|
|
398
|
-
press(
|
|
402
|
+
press('Edit')
|
|
403
|
+
fill_in('Name', with: 'DataGrid1 new')
|
|
404
|
+
press('OK')
|
|
399
405
|
wait_for_ajax
|
|
400
406
|
dgv.select_row(ind4)
|
|
401
|
-
press(
|
|
402
|
-
fill_in(
|
|
403
|
-
press(
|
|
407
|
+
press('Edit')
|
|
408
|
+
fill_in('Name', with: 'DataGrid4 new')
|
|
409
|
+
press('OK')
|
|
404
410
|
wait_for_ajax
|
|
405
411
|
|
|
406
412
|
go_to_xyz_rules
|
|
@@ -408,9 +414,9 @@ EOL
|
|
|
408
414
|
|
|
409
415
|
names = xrv.get_col_vals(:name, 5, 0)
|
|
410
416
|
gvs = xrv.get_col_vals(:grids, 5, 0)
|
|
411
|
-
g1h = {
|
|
412
|
-
expect(JSON.parse(gvs[names.index(
|
|
413
|
-
expect(JSON.parse(gvs[names.index(
|
|
417
|
+
g1h = { 'grid1' => 'DataGrid1 new' }
|
|
418
|
+
expect(JSON.parse(gvs[names.index('ZRule1')])).to eq(g1h)
|
|
419
|
+
expect(JSON.parse(gvs[names.index('ZRule2')])).to eq(g1h)
|
|
414
420
|
|
|
415
421
|
go_to_my_rules
|
|
416
422
|
wait_for_ajax
|
|
@@ -420,9 +426,8 @@ EOL
|
|
|
420
426
|
rvs = mrv.get_col_vals(:results, 9, 0)
|
|
421
427
|
expect(JSON.parse(gvs[names.index('abc')])).to eq(g1h)
|
|
422
428
|
expect(JSON.parse(gvs[names.index('Rule2b')])).to eq(g1h +
|
|
423
|
-
{
|
|
424
|
-
expect(JSON.parse(rvs[names.index('Rule5')])[
|
|
425
|
-
|
|
426
|
-
|
|
429
|
+
{ 'grid2' => 'DataGrid2' })
|
|
430
|
+
expect(JSON.parse(rvs[names.index('Rule5')])['other_grid']).to eq(
|
|
431
|
+
'"DataGrid4 new"')
|
|
427
432
|
end
|
|
428
433
|
end
|