scoutui 2.0.3.33.pre → 2.0.3.34.pre

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24a7f5d5dc6cde4149df39553481839d53597a5d
4
- data.tar.gz: 1c8c4612957678cb4d8692bb8f9e28eaa7916c05
3
+ metadata.gz: 95773cc48b9ff71ee1e809d4c334cc78e58f793e
4
+ data.tar.gz: f2253aef2a5f532c1196bdd75bb77f5ed84aea1c
5
5
  SHA512:
6
- metadata.gz: 3de9394d074a30af45c17cc4298cd555097aede4289b5c834f1bde052a49e1ddc741a569f6698b601b4ad9a8a7ba5fc4de255406c4f3d48d31921673d711f769
7
- data.tar.gz: 307130cbb3665bcd5362e1fe2281ca74d13d60e1e5b463396dd903f3597905dcb1bd241e78cd94a172fdec6d2baf2a5fc9b50ed4f32ee9caa5f785b76fcf0e01
6
+ metadata.gz: e08d1f3d7e100eec17e598c4858d17a171e0419eca1d66a32808c2dfa50625ffac0d579be11de2be288d4600f4d9dfdfcfc099579aabda4731f20b6cd27fd7c6
7
+ data.tar.gz: a69dee7b822be4f69f6f7b9efcaa37a21f285abda72dbb482357d415b267522855716f8787c24032c2e3621c266715b4866ee8a0cb8a03d2e12fd5d71ecd39e1
@@ -0,0 +1,42 @@
1
+
2
+
3
+ require 'singleton'
4
+ require 'DataMgr'
5
+
6
+ module Scoutui::Base
7
+
8
+ class TestData
9
+ include Singleton
10
+
11
+ attr_accessor :testware
12
+ attr_accessor :dut
13
+
14
+ def initialize
15
+ @testware={}
16
+ end
17
+
18
+ def add(_id, _f)
19
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " add(#{_id}, #{_f})"
20
+ @testware[_id]=DataMgr::DataModel.new(_f)
21
+
22
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " => #{@testware[_id]}"
23
+ end
24
+
25
+ def addx(_id, _reqs)
26
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " add(#{_id}, #{_reqs}"
27
+ @requirements[_id]=_reqs
28
+ end
29
+
30
+ def get(_id, _locator)
31
+ rc=@testware[_id].getDataElement(_locator)
32
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " get(#{_id}, #{_locator}) : #{rc}"
33
+ rc
34
+ end
35
+
36
+ end
37
+
38
+
39
+
40
+
41
+
42
+ end
@@ -101,6 +101,7 @@ module Scoutui::Base
101
101
  teardown()
102
102
 
103
103
  rescue => ex
104
+ Scoutui::Utils::TestUtils.instance.setState(:abort, __FILE__ + (__LINE__).to_s + " : #{ex.class.to_s}: #{ex}")
104
105
  Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " #{ex.class.to_s} Error during processing: #{ex}"
105
106
  Scoutui::Logger::LogMgr.instance.warn ex.backtrace
106
107
  ensure
@@ -94,6 +94,8 @@ module Scoutui::Base
94
94
  k=:lang
95
95
  elsif k=='${browser}' || k=='__BROWSER__'
96
96
  k=:browser
97
+ elsif k=='${role}' || k=='__ROLE__'
98
+ k=:role
97
99
  elsif k.is_a?(Symbol)
98
100
  foundKey=true
99
101
  elsif k=='__random_email__'
@@ -115,7 +117,7 @@ module Scoutui::Base
115
117
  foundKey=false
116
118
  end
117
119
 
118
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " get(#{k}) => #{@globals.has_key?(k)}" if Scoutui::Utils::TestUtils.instance.isDebug?
120
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " get(#{k}) => #{@globals.has_key?(k)}"
119
121
 
120
122
  if @globals.has_key?(k) && foundKey
121
123
  v=@globals[k]
@@ -830,9 +830,9 @@ module Scoutui::Base
830
830
 
831
831
  totalWindows = my_driver.window_handles.length
832
832
 
833
- Scoutui::Logger::LogMgr.instance.info '-' * 72 if Scoutui::Utils::TestUtils.instance.isDebug?
834
- Scoutui::Logger::LogMgr.instance.info " [Pre-cmd]: Total Windows : #{totalWindows.to_s}"
835
- Scoutui::Logger::LogMgr.instance.info "#{i.to_s}. Processing #{e.inspect}" if Scoutui::Utils::TestUtils.instance.isDebug?
833
+ Scoutui::Logger::LogMgr.instance.debug '-' * 72
834
+ Scoutui::Logger::LogMgr.instance.debug " [Pre-cmd]: Total Windows : #{totalWindows.to_s}"
835
+ Scoutui::Logger::LogMgr.instance.debug "#{i.to_s}. Processing #{e.inspect}"
836
836
  i+=1
837
837
 
838
838
  Scoutui::Utils::TestUtils.instance.setReq('UI')
@@ -1076,6 +1076,30 @@ module Scoutui::Base
1076
1076
 
1077
1077
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " ====== assertResults : #{_assertResult}"
1078
1078
 
1079
+
1080
+
1081
+ if e[STEP_KEY].has_key?("highlight") && e[STEP_KEY]["highlight"].has_key?("locators")
1082
+ _cmd="Highlight"
1083
+
1084
+ begin
1085
+ _c = Scoutui::Commands::Highlight.new('highlight')
1086
+
1087
+ if e[STEP_KEY]["highlight"].has_key?("assert") && e[STEP_KEY]["highlight"]["assert"].to_s.match(/\s*true\s*$/)
1088
+ _c.enableAsserts()
1089
+ else
1090
+ _c.disableAsserts()
1091
+ end
1092
+
1093
+ _pg={"page" => { "locators" => e[STEP_KEY]["highlight"]["locators"]} }
1094
+ _c.run(driver: my_driver, dut: _pg)
1095
+
1096
+ rescue => ex
1097
+ puts __FILE__ + (__LINE__).to_s + " #{ex.class}"
1098
+ Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
1099
+ end
1100
+
1101
+ end
1102
+
1079
1103
  if !_assertResult && Scoutui::Utils::TestUtils.instance.isFailFast?
1080
1104
  Scoutui::Utils::TestUtils.instance.setState(:abort, 'Failed assertion with failfast enabled.')
1081
1105
  return
@@ -1165,7 +1189,13 @@ module Scoutui::Base
1165
1189
  processExpected(my_driver, e)
1166
1190
  processAssertions(my_driver, e)
1167
1191
 
1168
- if !_region.nil?
1192
+ if e[STEP_KEY].has_key?("highlight") && e[STEP_KEY]["highlight"].has_key?("locators")
1193
+ _cmd="Highlight"
1194
+ _c = Scoutui::Commands::Highlight.new('highlight')
1195
+ _c.run(driver: my_driver, dut: e[STEP_KEY])
1196
+ end
1197
+
1198
+ if !_region.nil?
1169
1199
  eyeScout.check_window(_name, Scoutui::Base::UserVars.instance.normalize(_region))
1170
1200
  else
1171
1201
  eyeScout.check_window(_name)
@@ -12,10 +12,12 @@ module Scoutui::Commands
12
12
  attr_accessor :executed_result
13
13
  attr_accessor :stanza
14
14
  attr_accessor :bm
15
+ attr_accessor :enableAssert
15
16
 
16
17
  def initialize(_cmd, _drv=nil)
17
18
  Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " Command.init: #{_cmd.to_s}"
18
19
 
20
+ @enableAssert=true
19
21
  @bm=nil
20
22
  @cmd=_cmd
21
23
 
@@ -31,6 +33,24 @@ module Scoutui::Commands
31
33
  @executed_result=nil
32
34
  end
33
35
 
36
+ def assert?
37
+ @enableAssert
38
+ end
39
+
40
+ def enableAssert()
41
+ enableAsserts()
42
+ end
43
+ def enableAsserts()
44
+ @enableAssert=true
45
+ end
46
+ def disableAssert()
47
+ disableAsserts
48
+ end
49
+
50
+ def disableAsserts()
51
+ @enableAssert=false
52
+ end
53
+
34
54
  def setResult(r)
35
55
  Scoutui::Logger::LogMgr.instance.commands.debug " #{@cmd.to_s} : setResult(#{r.to_s})"
36
56
  @executed=true
@@ -51,6 +51,11 @@ module Scoutui::Commands
51
51
  _c = Scoutui::Commands::Pause.new(nil)
52
52
  _c.execute(e);
53
53
 
54
+ elsif Scoutui::Commands::Utils.instance.isLoadData?(_action)
55
+ _cmd='loaddata'
56
+ _c = Scoutui::Commands::LoadData.new(e)
57
+ _c.run(driver: my_driver, dut: e)
58
+
54
59
  elsif Scoutui::Commands::Utils.instance.isLoadRequirements?(_action)
55
60
  _cmd='loadrequirements'
56
61
  _c = Scoutui::Commands::LoadRequirements.new(e)
@@ -50,14 +50,11 @@ module Scoutui::Commands
50
50
  if q.has_key?('frame')
51
51
  Scoutui::Commands::Utils.instance.setEnableFrameSearch(q['frame'])
52
52
  elt = q['locator']
53
-
54
- # puts __FILE__ + (__LINE__).to_s + " highlight with frame #{q['frame']} with locator #{q['locator']} - PAUSE"
55
53
  end
56
54
 
57
55
 
58
56
  _loc = Scoutui::Base::UserVars.instance.normalize(elt)
59
57
 
60
- # obj = Scoutui::Base::QBrowser.getObject(@drv, loc, Scoutui::Commands::Utils.instance.getTimeout)
61
58
  obj = Scoutui::Base::QBrowser.findElement(@drv,
62
59
  _loc,
63
60
  Scoutui::Commands::Utils.instance.getFrameSearch(),
@@ -76,8 +73,12 @@ module Scoutui::Commands
76
73
 
77
74
  rc &&= _rc
78
75
 
79
- Testmgr::TestReport.instance.getReq(_req).testcase('highlight').add(!obj.nil?, "Verify object #{_locator} to highlight exists : #{obj.class.to_s}")
80
- Testmgr::TestReport.instance.getReq(_req).testcase('highlight').add(_rc, "Verify highlight #{_rc} performed for #{_locator}")
76
+ if assert?
77
+ Testmgr::TestReport.instance.getReq(_req).testcase('highlight').add(!obj.nil?, "Verify object #{elt} to highlight exists : #{obj.class.to_s}")
78
+ Testmgr::TestReport.instance.getReq(_req).testcase('highlight').add(_rc, "Verify highlight #{_rc} performed for #{elt}")
79
+ else
80
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " highlight(#{elt} : #{obj.class.to_s}"
81
+ end
81
82
 
82
83
  end
83
84
 
@@ -31,7 +31,7 @@ module Scoutui::Commands
31
31
  rc=true
32
32
  rescue => ex
33
33
  Scoutui::Logger::LogMgr.instance.warn "Error during processing: #{$!}"
34
- Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{e.backtrace.join("\n\t")}"
34
+ Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
35
35
  end
36
36
 
37
37
  rc
@@ -113,19 +113,34 @@ module Scoutui::Commands
113
113
  obj.send_keys("")
114
114
  @drv.action.send_keys(:enter).perform
115
115
  else
116
- _uservars = _val.scan(/\$\{(.*?)\}/)
117
116
 
118
- _v2 = _val
119
- for i in 0 .. (_uservars.size - 1)
117
+ if _val.match(/^\s*TestData\(.*\)\.getData\(.*\)\s*$/)
120
118
 
121
- _t = Scoutui::Base::UserVars.instance.get(_uservars[i][0])
122
- puts __FILE__ + (__LINE__).to_s + " translate(#{_uservars[i][0]}) => #{_t}"
119
+ _dataID=_val.match(/^\s*TestData\((.*)\)\.getData\(.*\)\s*$/)[1].to_s
120
+ _getter=_val.match(/^\s*TestData\((.*)\)\.(getData\(.*\))\s*$/)[2].to_s
123
121
 
124
- if !_t.nil? && _uservars[i][0]!=_t
125
- _v2.gsub!("\$\{#{_uservars[i][0]}\}", _t)
126
- end
122
+ # _v2=_val
123
+
124
+ _v2=Scoutui::Base::TestData.instance.get(_dataID, _getter)
125
+
126
+ puts __FILE__ + (__LINE__).to_s + " getData ==> #{_v2}"
127
+ else
128
+
129
+ _uservars = _val.scan(/\$\{(.*?)\}/)
130
+
131
+ _v2 = _val
132
+ for i in 0 .. (_uservars.size - 1)
127
133
 
128
- puts __FILE__ + (__LINE__).to_s + " value => #{_v2}"
134
+ _t = Scoutui::Base::UserVars.instance.get(_uservars[i][0])
135
+ puts __FILE__ + (__LINE__).to_s + " translate(#{_uservars[i][0]}) => #{_t}"
136
+
137
+ if !_t.nil? && _uservars[i][0]!=_t
138
+ _v2.gsub!("\$\{#{_uservars[i][0]}\}", _t)
139
+ end
140
+
141
+ puts __FILE__ + (__LINE__).to_s + " value => #{_v2}"
142
+
143
+ end
129
144
 
130
145
  end
131
146
 
@@ -24,6 +24,7 @@ module Scoutui::Commands
24
24
  'submitform',
25
25
  'type',
26
26
  'click',
27
+ 'loaddata',
27
28
  'loadrequirements',
28
29
  'mouseover',
29
30
  'navigate',
@@ -256,6 +257,11 @@ module Scoutui::Commands
256
257
  !_action.match(/fillform\(/i).nil?
257
258
  end
258
259
 
260
+ def isLoadData?(_action)
261
+ !_action.match(/^\s*loaddata\s*$/i).nil?
262
+ end
263
+
264
+
259
265
  def isLoadRequirements?(_action)
260
266
  !_action.match(/^\s*loadrequirements\s*$/i).nil?
261
267
  end
@@ -324,6 +330,8 @@ module Scoutui::Commands
324
330
  @totalCommands['click']+=1
325
331
  elsif isMouseOver?(cmd)
326
332
  @totalCommands['mouseover']+=1
333
+ elsif isLoadData?(cmd)
334
+ @totalCommands['loaddata']+=1
327
335
  elsif isLoadRequirements?(cmd)
328
336
  @totalCommands['loadrequirements']+=1
329
337
  elsif isSelect?(cmd)
@@ -34,7 +34,7 @@ module Scoutui::Utils
34
34
  @currentTest={:reqid => 'UI', :testcase => '00' }
35
35
 
36
36
  [:accounts, :browser, :capabilities, :diffs_dir, :test_file, :host, :loc, :title, :viewport,
37
- :userid, :password, :json_config_file, :page_model, :test_config,
37
+ :userid, :password, :role, :json_config_file, :page_model, :test_config,
38
38
  :debug].each do |o|
39
39
  @options[o]=nil
40
40
  end
@@ -251,7 +251,9 @@ module Scoutui::Utils
251
251
  opt.on('--eyes:viewport [resolution]') { |o| @options[:viewport] = o }
252
252
 
253
253
 
254
- opt.on('--role ROLE') { |o| @options[:role]=o }
254
+ opt.on('--role ROLE') { |o|
255
+ @options[:role]=o
256
+ }
255
257
 
256
258
  opt.on('-s', '--sauce', "Toggle SauceLabs") {
257
259
  @options[:enable_sauce]=true
@@ -284,6 +286,7 @@ module Scoutui::Utils
284
286
  Scoutui::Logger::LogMgr.instance.info "Browser => #{@options[:browser]}"
285
287
  Scoutui::Logger::LogMgr.instance.info "UserID => #{@options[:userid]}"
286
288
  Scoutui::Logger::LogMgr.instance.info "Password => #{@options[:password]}"
289
+ Scoutui::Logger::LogMgr.instance.info "Role => #{@options[:role]}"
287
290
  Scoutui::Logger::LogMgr.instance.info "Eyes => #{@options[:enable_eyes]}"
288
291
  Scoutui::Logger::LogMgr.instance.info "Test Cfg => #{@options[:json_config_file]}"
289
292
  Scoutui::Logger::LogMgr.instance.info "Match Level => #{@options[:match_level]}"
@@ -410,7 +413,7 @@ module Scoutui::Utils
410
413
 
411
414
  Scoutui::Logger::LogMgr.instance.setLevel(@options[:log_level])
412
415
 
413
- [:accounts, :browser, :dut, :host, :userid, :password].each do |k|
416
+ [:accounts, :browser, :dut, :host, :role, :userid, :password].each do |k|
414
417
 
415
418
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " opt[test_config].has_key(#{k.to_s}) => #{@options[:test_config].has_key?(k.to_s)}" if Scoutui::Utils::TestUtils.instance.isDebug?
416
419
 
@@ -1,3 +1,3 @@
1
1
  module Scoutui
2
- VERSION = "2.0.3.33.pre"
2
+ VERSION = "2.0.3.34.pre"
3
3
  end
data/scoutui.gemspec CHANGED
@@ -33,4 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "logging"
34
34
  spec.add_development_dependency "sauce_whisk"
35
35
  spec.add_development_dependency "testmgr", "0.3.2.pre"
36
+ spec.add_development_dependency "tiny_tds"
37
+ spec.add_development_dependency "DataMgr", ">= 0.1.1.1.pre"
36
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scoutui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3.33.pre
4
+ version: 2.0.3.34.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Kim
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2016-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,6 +164,34 @@ dependencies:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.3.2.pre
167
+ - !ruby/object:Gem::Dependency
168
+ name: tiny_tds
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: DataMgr
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: 0.1.1.1.pre
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: 0.1.1.1.pre
167
195
  description: Leverage a fully functional e2e framework that's integrated with Applitool's
168
196
  Eyes and Sauce Labs!
169
197
  email:
@@ -239,6 +267,7 @@ files:
239
267
  - lib/scoutui/base/q_browser.rb
240
268
  - lib/scoutui/base/q_form.rb
241
269
  - lib/scoutui/base/requirements.rb
270
+ - lib/scoutui/base/test_data.rb
242
271
  - lib/scoutui/base/test_scout.rb
243
272
  - lib/scoutui/base/test_settings.rb
244
273
  - lib/scoutui/base/user_vars.rb