scoutui 2.0.3.52.pre → 2.0.3.53.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa5ebb44b58d0fd1eb73d96c9a2b522833c4accc
4
- data.tar.gz: fa634ef22871fd4bc3968945ea234d32d8798462
3
+ metadata.gz: 4a35cafbcb1c807f7c74106dfbb18ce92d02cfaf
4
+ data.tar.gz: 774436f7c2c9a79de802682092d2620b02fa5409
5
5
  SHA512:
6
- metadata.gz: bf786bed73a483ef5d89eb9718772571cbd742d89a17c711274510092412d6763174a53d85ab91392b553bbba61e9ad89da6b992e546494e10887d00476e2ecd
7
- data.tar.gz: 9ee8d83cc685f41229d71256a6b0fc0bad3a1634d749fe80db12bbc4271f2ad046bebd97ec7974065c8ca6d9a4d7459cbaedf62502b098a057f5ea88e8d28570
6
+ metadata.gz: 3f133eba7e0505ff2fb452bb02588a02124cc5f8f25332b068fccb8682b8483611671ced48199f68ee5a81ca49f9b219a36371d63c98408438179f4489b17e8f
7
+ data.tar.gz: eba9ad266f74277f6d584386af782751a2dcf485dec0c96b1aa145620abaddb9345791907b5fd39b6175a910279429972cf72672d6d776b6e06c79e3ea6ac0a2
@@ -11,12 +11,26 @@ module Scoutui::Base
11
11
  attr_accessor :testware
12
12
  attr_accessor :dblist
13
13
  attr_accessor :dut
14
+ attr_accessor :jsList
14
15
 
15
16
  def initialize
16
17
  @testware={}
17
18
  @dblist={}
19
+ @jsList={}
18
20
  end
19
21
 
22
+ def addJS(_id, _content)
23
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " addJS(#{_id}, #{_content})"
24
+ @jsList[_id]=_content
25
+ @jsList[_id]
26
+ end
27
+
28
+ def getJS(_id)
29
+ @jsList[_id]
30
+ end
31
+
32
+
33
+
20
34
  def add(_id, _f)
21
35
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " add(#{_id}, #{_f})"
22
36
  @testware[_id]=DataMgr::DataModel.new(_f)
@@ -1168,21 +1168,75 @@ module Scoutui::Base
1168
1168
  # 5150
1169
1169
  if e[STEP_KEY].has_key?('executejs')
1170
1170
 
1171
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ExecuteJS"
1171
+ fcnId = e[STEP_KEY]['id'].to_s
1172
1172
 
1173
- e[STEP_KEY]['executejs'].each_key do |k|
1174
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " => #{k}"
1173
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ExecuteJS(#{fcnId})"
1175
1174
 
1175
+ _jsContent = Scoutui::Base::TestData.instance.getJS(fcnId)
1176
+
1177
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " RUN #{fcnId} => #{_jsContent}"
1178
+
1179
+ if _jsContent
1180
+ my_driver.execute_script(_jsContent)
1181
+ end
1182
+
1183
+ e[STEP_KEY]['executejs'].each_key do |fcnToCall|
1184
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " => #{fcnToCall}"
1185
+
1186
+
1187
+ _args=[]
1188
+
1189
+ e[STEP_KEY]['executejs'][fcnToCall].each do |arg|
1190
+ puts __FILE__ + (__LINE__).to_s + " ||| arg: #{arg}"
1191
+
1192
+ if arg.match(/^\s*\//)
1193
+ _args << Scoutui::Base::QBrowser.getObject(my_driver, arg, Scoutui::Commands::Utils.instance.getTimeout)
1194
+ else
1195
+ _args << arg
1196
+ end
1197
+
1198
+ end
1199
+
1200
+ argString=""
1201
+
1202
+ if e[STEP_KEY]['executejs'][fcnToCall].length > 1
1203
+ e[STEP_KEY]['executejs'][fcnToCall].length.times { |_t|
1204
+
1205
+ argString+="arguments[#{_t}], "
1206
+ }
1207
+ else
1208
+ argString="arguments[0]"
1209
+ end
1210
+
1211
+
1212
+ puts __FILE__ + (__LINE__).to_s + " Execute => #{fcnToCall}(#{argString})"
1213
+
1214
+ # _obj = Scoutui::Base::QBrowser.getObject(my_driver, '//body', Scoutui::Commands::Utils.instance.getTimeout)
1215
+
1216
+ # my_driver.execute_script("return #{fcnToCall}(arguments[0]);", _args[0])
1217
+ if _args.length==0
1218
+ my_driver.execute_script("#{_jsContent}; return #{fcnToCall}(arguments[0]);")
1219
+ elsif _args.length == 1
1220
+ my_driver.execute_script("#{_jsContent}; return #{fcnToCall}(arguments[0]);", _args[0])
1221
+ elsif _args.length==2
1222
+ my_driver.execute_script("#{_jsContent}; return #{fcnToCall}(arguments[0], arguments[1]);", _args[0], _args[1])
1223
+ elsif _args.length==3
1224
+ my_driver.execute_script("#{_jsContent}; return #{fcnToCall}(arguments[0], arguments[1], arguments[2]);", _args[0], _args[1], _args[2])
1225
+ elsif _args.length==4
1226
+ my_driver.execute_script("#{_jsContent}; return #{fcnToCall}(arguments[0], arguments[1], arguments[2], arguments[3]);", _args[0], _args[1], _args[2], _args[3])
1227
+ end
1228
+
1229
+ # my_driver.execute_script("hlt = function(c) { c.style.border='solid 5px rgb(233, 16, 16)'; }; return hlt(arguments[0]);", _obj)
1176
1230
 
1177
1231
  # page:
1178
1232
  # name: LoadJS
1179
1233
  # action: loadjs
1180
1234
  # files:
1181
- # - "../commands/general.js"
1182
- _cmd='loadjs'
1183
- _pg={"page" => { "action" => "loadjs", "files" => ["../commands/general.js"] } }
1184
- _c = Scoutui::Commands::LoadJs.new(_pg)
1185
- _c.run(driver: my_driver, dut: _pg)
1235
+ ## - "../commands/general.js"
1236
+ #_cmd='loadjs'
1237
+ #_pg={"page" => { "action" => "loadjs", "files" => ["../commands/general.js"] } }
1238
+ #_c = Scoutui::Commands::LoadJs.new(_pg)
1239
+ #_c.run(driver: my_driver, dut: _pg)
1186
1240
 
1187
1241
 
1188
1242
  # page:
@@ -31,6 +31,10 @@ module Scoutui::Commands
31
31
 
32
32
  end
33
33
 
34
+ if e['page'].has_key?('id')
35
+ Scoutui::Base::TestData.instance.addJS(e['page']['id'].to_s, js)
36
+ end
37
+
34
38
  rc=true
35
39
 
36
40
  rescue => ex
@@ -43,10 +47,6 @@ module Scoutui::Commands
43
47
  Testmgr::TestReport.instance.getReq(_req).testcase('click').add(rc, "Verify requirements command passed")
44
48
  end
45
49
 
46
- if rc
47
- puts __FILE__ + (__LINE__).to_s + " JS => #{js}"
48
- end
49
-
50
50
  setResult(rc)
51
51
  end
52
52
 
@@ -125,7 +125,7 @@ module Scoutui::Commands
125
125
  caps = {
126
126
  :platform => "Mac OS X 10.9",
127
127
  :browserName => "chrome",
128
- :version => "31",
128
+ :version => "beta",
129
129
  :full_description => 'Rover Test'
130
130
  }
131
131
 
@@ -7,6 +7,8 @@ module Scoutui::Commands
7
7
 
8
8
  KEYBOARD_LIST={
9
9
  '__DOWN__' => lambda { |obj| obj.send_keys(:arrow_down) },
10
+ '__ESC__' => lambda { |obj| obj.send_keys(:escape) },
11
+ '__ESCAPE__' => lambda { |obj| obj.send_keys(:escape) },
10
12
  '__TAB__' => lambda { |obj| obj.send_keys(:tab) },
11
13
  '__CLEAR__' => lambda { |obj| obj.clear }
12
14
  }
@@ -73,6 +75,10 @@ module Scoutui::Commands
73
75
  @drv.action.send_keys(:enter).perform
74
76
  _rc=true
75
77
  _isKb=true
78
+ elsif @cmd.strip.match(/^\s*type\s*\(\s*(__ESC__|__ESCAPE__)\s*\)\s*$/)
79
+ @drv.action.send_keys(:escape).perform
80
+ _rc=true
81
+ _isKb=true
76
82
  else
77
83
 
78
84
  if @cmd.match(/^\s*type[\!]*\((.*),\s*'(.*)\s*'\)\s*$/)
@@ -1,3 +1,3 @@
1
1
  module Scoutui
2
- VERSION = "2.0.3.52.pre"
2
+ VERSION = "2.0.3.53.pre"
3
3
  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.52.pre
4
+ version: 2.0.3.53.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-10-26 00:00:00.000000000 Z
11
+ date: 2016-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler