scoutui 2.0.3.50.pre → 2.0.3.51.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: 1237be740903254cf628d515e266f53506c6c049
4
- data.tar.gz: ea0fa6fb2485aa500af51535acc3a5b46759e44f
3
+ metadata.gz: 6c5cc805fe6fbfbc8493fbba16daf30ce96ed97a
4
+ data.tar.gz: 6713d51d7c4dda1a06c7ed3da8be5ab87d08eee2
5
5
  SHA512:
6
- metadata.gz: 8b00bb35b19f173fe117525d9451a7f063275998c614acd58111712c5cccda67b36b18c2bb2f795ab4ae73ed7fa0288cc1f58f5c4bdbc67f9bfc6ebb012355b6
7
- data.tar.gz: 31914dccf00ff3df9193732fc6c96e48f970cba2f8877acf378581c1a7f15c1cd4f271f9ce0198a5adab95ad5c8ba37d30112a55d011a6d3f5dbadf032d72b88
6
+ metadata.gz: 9c185fb0012d0fa6176d1112f58a41cbccadc92535803a74bf57cae78aa267656baaaf158e2165d4d574e2652ce60c5a57c88db3d9466849839663f74d70bb8a
7
+ data.tar.gz: 47cf0a7f0360242c67f9dadb5c36c671e4e530831f08335021356b0c14411c3a68d5ffe126f7ad18a833e664d50d008a54cf513c333fd0169ac0e8551363a648
@@ -71,9 +71,16 @@ module Scoutui::ApplicationModel
71
71
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " -- process page --" if Scoutui::Utils::TestUtils.instance.isDebug?
72
72
  hit=@app_model[_obj]
73
73
  elsif getter.downcase=='get'
74
- hit=hit[_obj]
74
+
75
+ if !hit.nil? && hit.has_key?(_obj)
76
+ hit=hit[_obj]
77
+ else
78
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Missing getter : #{_obj.to_s}"
79
+ return nil
80
+ end
81
+
75
82
  else
76
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " getter : #{getter} is unknown."
83
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " getter : #{getter} is unknown."
77
84
  return nil
78
85
  end
79
86
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " HIT => #{hit}" if Scoutui::Utils::TestUtils.instance.isDebug?
@@ -184,7 +184,16 @@ module Scoutui::Base
184
184
  end
185
185
 
186
186
  def isVisibleCmd?(_a)
187
- _a.is_a?(String) && _a.match(/^\s*[!]*visible\((.*)\)\s*$/i)
187
+ _a.is_a?(String) &&
188
+ ( _a.match(/^\s*[!]*visible\((.*)\)\s*$/i) ||
189
+ _a.match(/^\s*[!]*visible\((.*)?,\s*(\d+)\s*\)$/) )
190
+
191
+
192
+ # if xpath.match(/^\s*!visible\((.*,\s*\d+\s*)\)$/)
193
+ # _e = xpath.match(/^\s*!visible\((.*),\s*\d+\s*\)$/)[1].to_s.strip
194
+ # _timeout=xpath.match(/^\s*!visible\((.*),\s*(\d+)\s*\)$/)[2].to_i
195
+ # end
196
+
188
197
  end
189
198
 
190
199
 
@@ -438,6 +447,8 @@ module Scoutui::Base
438
447
  def isVisible?(my_driver, _execute_when, _enableAsserts=true)
439
448
  rc=true
440
449
 
450
+ _tm = Scoutui::Commands::Utils.instance.getTimeout
451
+
441
452
  begin
442
453
 
443
454
  _t = isVisibleFrameCmd?(_execute_when)
@@ -454,7 +465,13 @@ module Scoutui::Base
454
465
  end
455
466
 
456
467
  elsif isVisibleCmd?(_execute_when)
468
+
469
+ if _execute_when.match(/^\s*[!]*visible\((.*)?,\s*(\d+)\s*\)$/)
470
+ _locator = _execute_when.match(/^\s*[!]*visible\((.*)?,\s*(\d+)\s*\)$/)[1].to_s
471
+ _tm = _execute_when.match(/^\s*[!]*visible\((.*)?,\s*(\d+)\s*\)$/)[2].to_i
472
+ else
457
473
  _locator = _execute_when.match(/^\s*[!]*visible\((.*)\)\s*$/i)[1].to_s
474
+ end
458
475
 
459
476
 
460
477
  _locator = Scoutui::Base::UserVars.instance.normalize(_locator)
@@ -465,7 +482,7 @@ module Scoutui::Base
465
482
 
466
483
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " visible => #{_locator}"
467
484
 
468
- _obj = Scoutui::Base::QBrowser.findElement(my_driver, _locator, Scoutui::Commands::Utils.instance.getFrameSearch(), Scoutui::Commands::Utils.instance.getTimeout)
485
+ _obj = Scoutui::Base::QBrowser.findElement(my_driver, _locator, Scoutui::Commands::Utils.instance.getFrameSearch(), _tm) # Scoutui::Commands::Utils.instance.getTimeout)
469
486
 
470
487
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " obj => #{_obj}"
471
488
 
@@ -19,10 +19,7 @@ module Scoutui::Base
19
19
  begin
20
20
  Selenium::WebDriver::Wait.new(timeout: _timeout).until {
21
21
  rc=drv.find_element(:xpath => xpath).displayed?
22
-
23
22
  obj=getObject(drv, obj, _timeout=nil)
24
-
25
-
26
23
  }
27
24
  rescue => ex
28
25
  ;
@@ -423,6 +420,124 @@ module Scoutui::Base
423
420
  obj
424
421
  end
425
422
 
423
+
424
+ # 5150
425
+ def self.findElements(opts)
426
+ puts __FILE__ + (__LINE__).to_s + " findElements(#{opts})"
427
+ driver=opts[:driver]
428
+ locator=opts[:locator]
429
+ locateBy=:xpath
430
+ hits=nil
431
+
432
+
433
+ if locator.match(/^\s*css\s*\=\s*/i)
434
+ locateBy = :css
435
+ locator = locator.match(/css\s*\=\s*(.*)/i)[1].to_s
436
+ elsif locator.match(/^#/i)
437
+ locateBy = :css
438
+ end
439
+
440
+ puts __FILE__ + (__LINE__).to_s + " driver : #{driver.class}"
441
+ puts __FILE__ + (__LINE__).to_s + " locator : #{locator}"
442
+
443
+ begin
444
+ _timeout=Scoutui::Commands::Utils.instance.getTimeout
445
+ Selenium::WebDriver::Wait.new(timeout: _timeout).until { hits=driver.find_elements( locateBy => locator) }
446
+
447
+ rescue => ex
448
+ puts __FILE__ + (__LINE__).to_s + " #{ex.class}"
449
+ puts ex.backtrace
450
+
451
+ end
452
+ hits
453
+ end
454
+
455
+ def self.hasParent?(element, parent_xpath)
456
+
457
+ parent=nil
458
+ if element.is_a?(Selenium::WebDriver::Element)
459
+ begin
460
+ parent = element.find_element(:xpath, parent_xpath)
461
+ rescue Selenium::WebDriver::Error::NoSuchElementError
462
+ ;
463
+ end
464
+
465
+ end
466
+
467
+ parent
468
+ end
469
+
470
+ # 5150
471
+ # http://stackoverflow.com/questions/14288917/selenium-webdriver-get-attributes-after-finding-an-element
472
+ def self.isAccessible(opts)
473
+
474
+ puts __FILE__ + (__LINE__).to_s + " == isAccessible(#{opts}) =="
475
+ hits = Scoutui::Base::QBrowser.findElements(opts)
476
+
477
+ puts __FILE__ + (__LINE__).to_s + " HITS => #{hits.length}"
478
+
479
+
480
+ i=0
481
+ begin
482
+ hits.each do | obj |
483
+ if obj.displayed?
484
+ puts __FILE__ + (__LINE__).to_s + " #{i}. #{obj.tag_name}"
485
+
486
+ tagName=obj.tag_name.to_s.strip
487
+
488
+ ## Verify labels are present for user input elements
489
+ if tagName.match(/(textarea|input)/) && obj.attribute('id')
490
+ id=obj['id'].to_s
491
+
492
+ # parent_li = obj.find_element(:xpath, './../label')
493
+ parent_li = Scoutui::Base::QBrowser.hasParent?(obj, "./../label[@for='#{id}']")
494
+
495
+ Testmgr::TestReport.instance.getReq('WCAG').testcase(tagName).add(!parent_li.nil?, "Verify matching label (id=#{id.to_s}) exists for #{tagName}.")
496
+
497
+ if parent_li
498
+ forId = parent_li['for']
499
+ puts __FILE__ + (__LINE__).to_s + " parent: #{parent_li.tag_name}"
500
+ puts __FILE__ + (__LINE__).to_s + " assert <id, for>: #{id}, #{forId}"
501
+
502
+ Testmgr::TestReport.instance.getReq('WCAG').testcase(tagName).add(id==forId, "Verify matching label for #{tagName} has same id (#{id}) and for (#{forId}) values")
503
+ else
504
+ puts __FILE__ + (__LINE__).to_s + " => Missing associated label for #{tagName}"
505
+ end
506
+
507
+
508
+ #---------------------------------------------------#
509
+
510
+ elsif tagName.match(/(img)/)
511
+
512
+ src=obj.attribute('src')
513
+ alt=obj.attribute('alt')
514
+ longdesc=obj.attribute('longdesc')
515
+
516
+ puts __FILE__ + (__LINE__).to_s + " ** #{i}. process #{tagName} <alt, longdesc>::<#{alt.nil?}, #{longdesc.nil?}, #{src}> **"
517
+
518
+ Testmgr::TestReport.instance.getReq('WCAG').testcase(tagName).add(!(alt.nil? && longdesc.nil?), "Verify alt/longdesc (#{alt.to_s} exists for img[#{i}] (#{src})")
519
+
520
+
521
+ else
522
+ puts __FILE__ + (__LINE__).to_s + " == #{tagName} out of scope for Acccessibility"
523
+
524
+ end
525
+
526
+
527
+
528
+ i+=1
529
+ end
530
+ end
531
+
532
+ rescue => ex
533
+ puts __FILE__ + (__LINE__).to_s + " #{ex.class}"
534
+ puts ex.backtrace
535
+ end
536
+
537
+
538
+ end
539
+
540
+
426
541
  def self.findElement(drv, _locator, _frames, _timeout=nil)
427
542
 
428
543
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " findElement(#{_locator}, #{Scoutui::Commands::Utils.instance.getFrameSearch})"
@@ -621,6 +736,7 @@ module Scoutui::Base
621
736
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " By => #{locateBy.to_s}"
622
737
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Locator => #{locator}"
623
738
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Visible_When => #{visible_when}"
739
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Timeout => #{_timeout}"
624
740
 
625
741
  Selenium::WebDriver::Wait.new(timeout: _timeout).until { rc=drv.find_element( locateBy => locator) }
626
742
 
@@ -57,6 +57,10 @@ module Scoutui::Base
57
57
 
58
58
  Scoutui::Base::Assertions.instance.assertPageElement(k, page_elt, _obj, my_driver, _req)
59
59
 
60
+ if page_elt.has_key?('asserts')
61
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ** process Asserts #{page_elt['asserts']} **"
62
+ STDIN.gets
63
+ end
60
64
 
61
65
 
62
66
  elsif sub_elts > 0
@@ -108,6 +112,7 @@ module Scoutui::Base
108
112
 
109
113
  if _v.has_key?('reqid')
110
114
  _req=_v['reqid'].to_s
115
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " temporary update REQID to #{_req}"
111
116
  end
112
117
 
113
118
  if _v.has_key?('locator')
@@ -118,7 +123,25 @@ module Scoutui::Base
118
123
 
119
124
  _obj = Scoutui::Base::QBrowser.getFirstObject(my_driver, _locator, Scoutui::Commands::Utils.instance.getTimeout())
120
125
 
121
- Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " HIT #{_locator} => #{(!_obj.nil?).to_s}" # if Scoutui::Utils::TestUtils.instance.isDebug?
126
+ Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " HIT #{_locator} => #{(!_obj.nil?).to_s}"
127
+ end
128
+
129
+
130
+ if _v.has_key?('asserts')
131
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ** process Asserts **"
132
+ _v['asserts'].each do | _ass|
133
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " => #{_ass}"
134
+ end
135
+
136
+
137
+ # Should be refactored (TBD)
138
+ _backupReq = Scoutui::Utils::TestUtils.instance.getReq()
139
+ Scoutui::Utils::TestUtils.instance.setReq(_req) if !_req.nil?
140
+
141
+ _assertResult=processAsserts(my_driver, _v["asserts"])
142
+
143
+ Scoutui::Utils::TestUtils.instance.setReq(_backupReq) if !_req.nil?
144
+
122
145
  end
123
146
 
124
147
  if Scoutui::Base::Assertions.instance.visible_when_always(_k, _v, _obj, _req)
@@ -153,9 +176,13 @@ module Scoutui::Base
153
176
 
154
177
 
155
178
  end
179
+
180
+ else
181
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Unknown: #{_k} : #{_v}"
156
182
  end
157
183
 
158
184
 
185
+
159
186
  rescue => ex
160
187
  Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Error during processing: #{ex}"
161
188
  Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
@@ -186,6 +213,11 @@ module Scoutui::Base
186
213
  end
187
214
 
188
215
  # next
216
+
217
+ elsif page_elt.is_a?(Hash) && page_elt.has_key?('asserts')
218
+ # 5150
219
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ** asserts from PageElement verification **"
220
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " =============="; STDIN.gets
189
221
  end
190
222
 
191
223
 
@@ -319,6 +351,7 @@ module Scoutui::Base
319
351
  processConditions(my_driver, e, 'assertions')
320
352
  end
321
353
 
354
+ # recsult=processAsserts(my_driver, e[STEP_KEY]["asserts"])
322
355
  def self.processAsserts(my_driver, _execute_when, _enableAsserts=true)
323
356
 
324
357
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " processAsserts#{_execute_when}"
@@ -334,34 +367,60 @@ module Scoutui::Base
334
367
 
335
368
  _rc=nil
336
369
 
370
+ _bm=nil
337
371
 
338
372
  _assertType=Scoutui::Base::Assertions.instance.isValidAssertType(_a)
339
373
 
340
- if !_assertType.nil?
374
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " assertType : #{_assertType}"
341
375
 
376
+ if !_assertType.nil?
342
377
 
343
378
  if _assertType[:cmd].match(/^\s*isEnabled\s*$/i) # Scoutui::Base::Assertions.instance.isEnabledCmd?(_a)
344
- _rc=Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a, _enableAsserts)
379
+
380
+ _bm=Benchmark.measure {
381
+ _rc=Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a, _enableAsserts)
382
+ }
383
+
345
384
  elsif _assertType[:cmd]=='visible'
346
- _rc=Scoutui::Base::Assertions.instance.isVisible?(my_driver, _a, _enableAsserts)
385
+
386
+ _bm=Benchmark.measure {
387
+ _rc=Scoutui::Base::Assertions.instance.isVisible?(my_driver, _a, _enableAsserts)
388
+ }
389
+
347
390
  elsif _assertType[:cmd]=='isSelected'
348
- _rc=Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a)
391
+ _bm=Benchmark.measure {
392
+ _rc=Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a)
393
+ }
394
+
349
395
  elsif _assertType[:cmd]=='isText'
350
- _rc=Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a)
396
+ _bm=Benchmark.measure {
397
+ _rc=Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a)
398
+ }
399
+
351
400
  elsif _assertType[:cmd]=='isValue'
352
- _rc=Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a)
401
+ _bm=Benchmark.measure {
402
+ _rc=Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a)
403
+ }
353
404
  end
354
405
 
355
406
  elsif Scoutui::Base::Assertions.instance.isRoleCmd?(_a)
356
- _rc=Scoutui::Base::Assertions.instance.isRole?(_a)
407
+ _bm=Benchmark.measure {
408
+ _rc=Scoutui::Base::Assertions.instance.isRole?(_a)
409
+ }
357
410
  # elsif Scoutui::Base::Assertions.instance.isVisibleCmd?(_a)
358
411
  # _rc=Scoutui::Base::Assertions.instance.isVisible?(my_driver, _a)
359
412
  elsif Scoutui::Base::Assertions.instance.isSelectedCmd?(_a)
360
- _rc=Scoutui::Base::Assertions.instance.isSelected?(my_driver, _a)
413
+ _bm=Benchmark.measure {
414
+ _rc=Scoutui::Base::Assertions.instance.isSelected?(my_driver, _a)
415
+ }
361
416
  elsif Scoutui::Base::Assertions.instance.isValueCmd?(_a)
362
- _rc=Scoutui::Base::Assertions.instance.isValue?(my_driver, _a)
417
+ _bm=Benchmark.measure {
418
+ _rc=Scoutui::Base::Assertions.instance.isValue?(my_driver, _a)
419
+ }
363
420
  elsif Scoutui::Base::Assertions.instance.isTitleCmd?(_a)
364
- _rc=Scoutui::Base::Assertions.instance.isTitle(my_driver, _a)
421
+ _bm=Benchmark.measure {
422
+ _rc=Scoutui::Base::Assertions.instance.isTitle(my_driver, _a)
423
+ }
365
424
  elsif _a.match(/^\s*(req|requirement)\s*\((.*)\)\s*$/i)
366
425
 
367
426
  _reqID=_a.match(/^\s*(req|requirement)\s*\((.*)\)\s*$/i)[2].to_s
@@ -371,15 +430,45 @@ module Scoutui::Base
371
430
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " => #{_reqAsserts}"
372
431
 
373
432
  _req = Scoutui::Utils::TestUtils.instance.setReq(_reqID)
374
- _rc=processAsserts(my_driver, _reqAsserts, _enableAsserts)
433
+
434
+ _bm=Benchmark.measure {
435
+ _rc=processAsserts(my_driver, _reqAsserts, _enableAsserts)
436
+ }
437
+
375
438
  Scoutui::Utils::TestUtils.instance.setReq(_req)
439
+
440
+
441
+ elsif !_a.match(/^page\([\w\d]+\)/).nil?
442
+
443
+ puts __FILE__ + (__LINE__).to_s + "\n\n=== Validate Page ==="
444
+
445
+ _obj = processPageElement(my_driver, nil, _a)
446
+
447
+ # 5150
448
+ puts __FILE__ + (__LINE__).to_s + " *** WHAT type of assertion => #{_obj}"; STDIN.gets
449
+
450
+ elsif !_a.match(/^\s*accessibility\s*$/).nil?
451
+ puts __FILE__ + (__LINE__).to_s + " *** Accessibility ***"
452
+
453
+
454
+ # 5150
455
+ # Get all displayed textareas
456
+ ['//textarea', '//img'].each do |elt_wcag|
457
+ Scoutui::Base::QBrowser.isAccessible({ :driver => my_driver, :locator => elt_wcag })
458
+ end
459
+
460
+ # textAreas = Scoutui::Base::QBrowser.getObjects( { :driver => my_driver, :locator => '//textarea' })
376
461
  end
377
462
 
378
463
  if !_rc.nil?
379
464
 
380
465
  if _enableAsserts
381
466
  Scoutui::Logger::LogMgr.instance.asserts.info __FILE__ + (__LINE__).to_s + " Verify #{_a} - #{_rc}"
382
- Testmgr::TestReport.instance.getReq(_req).get_child('visible_when').add(_rc, "Verify #{_a}")
467
+
468
+
469
+ _testcase = Scoutui::Utils::TestUtils.instance.getTC() || "visible_when"
470
+
471
+ Testmgr::TestReport.instance.getReq(_req).get_child(_testcase).add(_rc, "Assert #{_a}", _bm.real)
383
472
  end
384
473
 
385
474
  Scoutui::Commands::Utils.instance.resetFrameSearch()
@@ -847,6 +936,7 @@ module Scoutui::Base
847
936
  _skip = e[STEP_KEY]["skip"]
848
937
  _region = e[STEP_KEY]["region"]
849
938
  _reqid = e[STEP_KEY]["reqid"]
939
+ _testcase = e[STEP_KEY]["testcase"]
850
940
  _execute_when = e[STEP_KEY]["execute_when"]
851
941
  _use_frames = e[STEP_KEY]["frames"]
852
942
 
@@ -873,6 +963,10 @@ module Scoutui::Base
873
963
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " REQID was not provided"
874
964
  end
875
965
 
966
+ if !(_testcase.nil? || _testcase.empty?)
967
+ Scoutui::Utils::TestUtils.instance.setTC(_testcase)
968
+ end
969
+
876
970
 
877
971
  if !_execute_when.nil? && !_execute_when.to_s.empty?
878
972
 
@@ -1233,6 +1327,12 @@ module Scoutui::Base
1233
1327
  processExpected(my_driver, e)
1234
1328
  processAssertions(my_driver, e)
1235
1329
  _assertResult=processAsserts(my_driver, e[STEP_KEY]["asserts"]) # 5150
1330
+
1331
+ if e[STEP_KEY].has_key?('accessible') && e[STEP_KEY]['accessible'].to_s.match(/true/)
1332
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ** Accessibility **"
1333
+ STDIN.gets
1334
+ end
1335
+
1236
1336
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " ====== assertResults : #{_assertResult}"
1237
1337
 
1238
1338
  if e[STEP_KEY].has_key?("highlight") && e[STEP_KEY]["highlight"].has_key?("locators")
@@ -102,7 +102,9 @@ module Scoutui::Commands
102
102
  _caborted=true
103
103
  end
104
104
 
105
- Testmgr::TestReport.instance.getReq(_req).get_child(_cmd.downcase).add(!_caborted, "Verify command assign did not abort")
105
+ _testcase = Scoutui::Utils::TestUtils.instance.getTC() || _cmd.downcase
106
+
107
+ Testmgr::TestReport.instance.getReq(_req).get_child(_testcase).add(!_caborted, "Assert command assign did not abort")
106
108
  end
107
109
  end
108
110
 
@@ -8,6 +8,8 @@ module Scoutui::Commands
8
8
 
9
9
  def execute(drv, e=nil)
10
10
 
11
+ _seekTime={ :start => 0, :end => 0 }
12
+
11
13
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " SelectObject.execute(#{e})"
12
14
  @drv=drv if !drv.nil?
13
15
 
@@ -30,7 +32,9 @@ module Scoutui::Commands
30
32
  puts __FILE__ + (__LINE__).to_s + " frames => #{e['page']['frames']}";
31
33
  end
32
34
 
35
+ _seekTime[:start]=Time.now
33
36
  obj = Scoutui::Base::QBrowser.findElement(@drv, _xpath, Scoutui::Commands::Utils.instance.getFrameSearch(), Scoutui::Commands::Utils.instance.getTimeout)
37
+ _seekTime[:end]=Time.now
34
38
 
35
39
 
36
40
  if !obj.nil? && obj.tag_name.downcase.match(/(select)/)
@@ -57,8 +61,8 @@ module Scoutui::Commands
57
61
  Scoutui::Logger::LogMgr.instance.debug "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
58
62
  end
59
63
 
60
- Testmgr::TestReport.instance.getReq(_req).testcase('select').add(!obj.nil?, "Verify object to select exists #{_xpath} : #{obj.class.to_s}")
61
- Testmgr::TestReport.instance.getReq(_req).testcase('select').add(_rc, "Verify selected text #{_val}")
64
+ Testmgr::TestReport.instance.getReq(_req).testcase('select').add(!obj.nil?, Scoutui::Base::UserVars.instance.normalize("Verify object to select exists #{_xpath} : #{obj.class.to_s}"), _seekTime[:end] - _seekTime[:start])
65
+ Testmgr::TestReport.instance.getReq(_req).testcase('select').add(_rc, Scoutui::Base::UserVars.instance.normalize("Verify selected text #{_val}"))
62
66
  setResult(_rc)
63
67
 
64
68
  end
@@ -52,6 +52,8 @@ module Scoutui::Commands
52
52
  def execute(drv=nil, pageElt=nil)
53
53
  @drv=drv if !drv.nil?
54
54
 
55
+ _tm={:start => 0, :end => 0 }
56
+
55
57
  _isKb=false
56
58
  _rc=false
57
59
  _req = Scoutui::Utils::TestUtils.instance.getReq()
@@ -83,8 +85,12 @@ module Scoutui::Commands
83
85
 
84
86
  Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + "Process TYPE #{_val} into #{_xpath}"
85
87
 
88
+ _tm[:start]=Time.now
89
+
86
90
  obj = Scoutui::Base::QBrowser.getElement(@drv, _xpath, Scoutui::Commands::Utils.instance.getFrameSearch(), Scoutui::Commands::Utils.instance.getTimeout)
87
91
 
92
+ _tm[:end]=Time.now
93
+
88
94
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " type(#{_val})"
89
95
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " tag : #{obj.tag_name}" if obj.is_a?(Selenium::WebDriver::Element)
90
96
 
@@ -107,6 +113,9 @@ module Scoutui::Commands
107
113
  end
108
114
  true if obj.displayed?
109
115
  }
116
+
117
+ _tm[:end]=Time.now
118
+
110
119
  rescue Selenium::WebDriver::Error::TimeOutError => ex
111
120
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Timeout waiting for display?: #{_xpath}"
112
121
  end
@@ -119,6 +128,7 @@ module Scoutui::Commands
119
128
  (0..3).each do |j|
120
129
  if Scoutui::Base::QBrowser.isStale?(obj)
121
130
  obj = Scoutui::Base::QBrowser.getElement(@drv, _xpath, Scoutui::Commands::Utils.instance.getFrameSearch(), Scoutui::Commands::Utils.instance.getTimeout)
131
+ _tm[:end]=Time.now
122
132
  else
123
133
  break
124
134
  end
@@ -181,12 +191,14 @@ module Scoutui::Commands
181
191
  _inRow=0
182
192
  sleep 0.5
183
193
  obj = Scoutui::Base::QBrowser.getElement(@drv, _xpath, Scoutui::Commands::Utils.instance.getFrameSearch(), Scoutui::Commands::Utils.instance.getTimeout)
194
+ _tm[:end]=Time.now
184
195
  else
185
196
  _inRow+=1
186
197
 
187
198
  break if _inRow >= 3
188
199
 
189
200
  obj = Scoutui::Base::QBrowser.getElement(@drv, _xpath, Scoutui::Commands::Utils.instance.getFrameSearch(), Scoutui::Commands::Utils.instance.getTimeout)
201
+ _tm[:end]=Time.now
190
202
  end
191
203
 
192
204
  end
@@ -242,8 +254,8 @@ module Scoutui::Commands
242
254
 
243
255
 
244
256
  if !_isKb
245
- Testmgr::TestReport.instance.getReq(_req).testcase('type').add(!obj.nil?, "Verify object #{_xpath} to type #{_val} exists : #{obj.class.to_s}")
246
- Testmgr::TestReport.instance.getReq(_req).testcase('type').add(_rc, "Verify typed data #{_rc}", (_endTime - _startTime))
257
+ Testmgr::TestReport.instance.getReq(_req).testcase('type').add(!obj.nil?, Scoutui::Base::UserVars.instance.normalize("Verify object #{_xpath} to type #{_val} exists : #{obj.class.to_s}"), _tm[:end]-_tm[:start])
258
+ Testmgr::TestReport.instance.getReq(_req).testcase('type').add(_rc, Scoutui::Base::UserVars.instance.normalize("Verify typed data #{_rc}"), (_endTime - _startTime))
247
259
  end
248
260
 
249
261
  setResult(_rc)
@@ -6,6 +6,8 @@ module Scoutui::Commands
6
6
  def execute(drv, _e=nil)
7
7
  @drv=drv if !drv.nil?
8
8
 
9
+ _duration=nil
10
+
9
11
  _req = Scoutui::Utils::TestUtils.instance.getReq()
10
12
 
11
13
  baseUrl = Scoutui::Base::UserVars.instance.getHost()
@@ -48,6 +50,11 @@ module Scoutui::Commands
48
50
  end
49
51
 
50
52
 
53
+ _testcase = Scoutui::Utils::TestUtils.instance.getTC() || "navigate"
54
+
55
+ Testmgr::TestReport.instance.getReq(_req).testcase(_testcase).add(_rc, Scoutui::Base::UserVars.instance.normalize("Verify navigate to url #{normUrl}"), _duration)
56
+
57
+
51
58
  setResult(_rc)
52
59
 
53
60
  end
@@ -153,6 +153,8 @@ module Scoutui::Commands
153
153
 
154
154
  def reset(stanza=nil)
155
155
 
156
+ Scoutui::Utils::TestUtils.instance.setTC(nil)
157
+
156
158
  setEnableFrameSearch(false)
157
159
 
158
160
  if stanza.is_a?(Hash) && stanza.has_key?('page') && stanza['page'].has_key?('frames')
@@ -111,10 +111,18 @@ module Scoutui::Utils
111
111
  @currentTest[:reqid]
112
112
  end
113
113
 
114
+ def getTC()
115
+ @currentTest[:testcase]
116
+ end
117
+
114
118
  def setReq(_r='UI')
115
119
  @currentTest[:reqid]=_r
116
120
  end
117
121
 
122
+ def setTC(_tc=nil)
123
+ @currentTest[:testcase]=_tc
124
+ end
125
+
118
126
  def loadModel(f=nil)
119
127
  if f.nil?
120
128
  return nil
@@ -1,3 +1,3 @@
1
1
  module Scoutui
2
- VERSION = "2.0.3.50.pre"
2
+ VERSION = "2.0.3.51.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.50.pre
4
+ version: 2.0.3.51.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-01 00:00:00.000000000 Z
11
+ date: 2016-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler