scoutui 2.0.3.43.pre → 2.0.3.44.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: 6cf3942661d1fe07e101908d524e05f1c388897b
4
- data.tar.gz: d774623387644c2afdced96ed5d0ebaa920f1d6d
3
+ metadata.gz: 91a8993f5c845bd67a31b1781ffe9c9d8638974a
4
+ data.tar.gz: 7d40b45a17bf991aa6732305534356ebe944ef03
5
5
  SHA512:
6
- metadata.gz: 7f39521a4b9e5ea566ada4a894a4258ed0fc762e77f090f69afe1fca3d350e1d6f8c284720f2cfe8fc0562133df844e2075109e0ac1476d71cbe1e88160fd758
7
- data.tar.gz: 026c38f168d7826c1afd94f2f6d239b1daeff6d989e75a9cf73e81615d5c78c5acaf4d176f122a20f2d61a42b8967d88423319f45fb896c4f7778d506ef1fae9
6
+ metadata.gz: 3fb9559720831f36e8b8d583e6c98c2d80ce8670a7c2c32612802ef78a4ef1e0327c1670d7bcd42e270a3cf68d25a6810773f7f0ce417ace73a3978d47e7b862
7
+ data.tar.gz: 1f332172c1af3ce2f00d046b01f655619a0832b447323bd0761f8f27c2ed8112c385a69497bf8dc5a8d1a8d3408308caf9978ac2391d2d48c3b1a549adc92ec8
@@ -343,14 +343,6 @@ module Scoutui::Base
343
343
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " check if Enabled"
344
344
  end
345
345
 
346
- # puts __FILE__ + (__LINE__).to_s + " disabled: #{_obj.attribute("disabled")}"
347
- # puts __FILE__ + (__LINE__).to_s + " readonly: #{_obj.attribute("readonly")}"
348
- # puts __FILE__ + (__LINE__).to_s + " foo: #{_obj.attribute("foo")} isNil?: #{_obj.attribute("foo").nil?}"
349
- # puts __FILE__ + (__LINE__).to_s + " enabled: #{_obj.enabled?}"
350
-
351
- # _enabled = _obj.enabled? && !(_obj.attribute("disabled") || _obj.attribute("readonly") )
352
- # _enabled=false if _enabled.nil?
353
-
354
346
  _enabled = Scoutui::Base::QBrowser.isEnabled?(_obj, my_driver, _locator)
355
347
 
356
348
  puts __FILE__ + (__LINE__).to_s + " _obj.enabled? => #{_enabled}"
@@ -477,12 +469,7 @@ module Scoutui::Base
477
469
 
478
470
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " obj => #{_obj}"
479
471
 
480
- _state = false
481
- if !_obj.nil? && _obj.is_a?(Selenium::WebDriver::Element)
482
- wait = Selenium::WebDriver::Wait.new(:timeout => Scoutui::Commands::Utils.instance.getTimeout)
483
- _state = wait.until { _obj.displayed? }
484
- end
485
-
472
+ _state = Scoutui::Base::QBrowser.isDisplayed?(_obj)
486
473
 
487
474
  if !_enableAsserts
488
475
  _rc=false
@@ -742,13 +729,6 @@ module Scoutui::Base
742
729
  puts __FILE__ + (__LINE__).to_s + " Pause debug"; gets
743
730
  end
744
731
 
745
-
746
- # def isEnabled(my_driver, page_elt, _req=nil, _immediate=false)
747
- # Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " isEanbled(#{page_elt}"
748
- # end
749
-
750
-
751
-
752
732
  #
753
733
  # { reqid : <pageElt> }
754
734
  def isVisible(my_driver, page_elt, _req=nil, _immediate=false)
@@ -31,16 +31,33 @@ module Scoutui::Base
31
31
  end
32
32
 
33
33
  def self.wait_for_displayed(drv, locator, _timeout=30)
34
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " wait_for_displayed(#{xpath}"
34
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " wait_for_displayed(#{locator}"
35
35
  rc=nil
36
36
  begin
37
- Selenium::WebDriver::Wait.new(timeout: _timeout).until { rc=drv.find_element(:xpath => xpath).displayed? }
37
+ Selenium::WebDriver::Wait.new(timeout: _timeout).until { rc=drv.find_element(:xpath => locator).displayed? }
38
38
  rescue => ex
39
39
  ;
40
40
  end
41
41
  rc
42
42
  end
43
43
 
44
+ # Check if the object (not a String) is an Element that is displayed.
45
+ def self.isDisplayed?(_obj, _timeout=Scoutui::Commands::Utils.instance.getTimeout)
46
+ rc=false
47
+
48
+ if !_obj.nil? && _obj.is_a?(Selenium::WebDriver::Element)
49
+ begin
50
+ wait = Selenium::WebDriver::Wait.new(:timeout => _timeout)
51
+ rc = wait.until { _obj.displayed? }
52
+ rescue Selenium::WebDriver::Error::TimeOutError
53
+ ;
54
+ end
55
+
56
+ end
57
+
58
+ rc
59
+ end
60
+
44
61
  def self.wait_for_exist(drv, xpath, _timeout=30)
45
62
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " wait_for_exist(#{xpath}"
46
63
  rc=nil
@@ -581,7 +581,7 @@ module Scoutui::Base
581
581
  if !xpath.match(/^\s*!visible\(.*\)$/).nil?
582
582
  _rc = false
583
583
  _e=nil
584
- _timeout=10
584
+ _timeout=12
585
585
 
586
586
  if xpath.match(/^\s*!visible\((.*,\s*\d+\s*)\)$/)
587
587
  _e = xpath.match(/^\s*!visible\((.*),\s*\d+\s*\)$/)[1].to_s.strip
@@ -1110,19 +1110,26 @@ module Scoutui::Base
1110
1110
 
1111
1111
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " == Process SaveAs #{_saveAs}=="
1112
1112
 
1113
- _f=File.open(_saveAs, 'w')
1113
+ begin
1114
+ _f=File.open(_saveAs, 'w')
1114
1115
 
1115
- if _saveAs.match(/.*\.json\s*$/)
1116
- _f.puts Scoutui::Utils::TestUtils.instance.expandVars(e[STEP_KEY]['saveas']['data']).to_json
1116
+ if _saveAs.match(/.*\.json\s*$/)
1117
+ _f.puts Scoutui::Utils::TestUtils.instance.expandVars(e[STEP_KEY]['saveas']['data']).to_json
1117
1118
 
1118
- elsif _saveAs.match(/.*\.(yml|yaml)\s*$/i)
1119
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Generate a YAML file"
1120
- _f.write(Scoutui::Utils::TestUtils.instance.expandVars(e[STEP_KEY]['saveas']['data'].to_yaml))
1121
- else
1122
- Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Unknown file extension."
1119
+ elsif _saveAs.match(/.*\.(yml|yaml)\s*$/i)
1120
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Generate a YAML file"
1121
+ _f.write(Scoutui::Utils::TestUtils.instance.expandVars(e[STEP_KEY]['saveas']['data'].to_yaml))
1122
+ else
1123
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Unknown file extension."
1124
+ end
1125
+
1126
+ rescue => ex
1127
+ puts __FILE__ + (__LINE__).to_s + " #{ex}"
1128
+ puts ex.backtrace
1129
+ ensure
1130
+ _f.close
1123
1131
  end
1124
1132
 
1125
- _f.close
1126
1133
  end
1127
1134
 
1128
1135
 
@@ -151,15 +151,14 @@ module Scoutui::Commands
151
151
  _clicked=true
152
152
 
153
153
  rescue Selenium::WebDriver::Error::UnknownError
154
- puts __FILE__ + (__LINE__).to_s + " Selenium::WebDriver::Error::UnknownError"
154
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Retry #{_i} - Selenium::WebDriver::Error::UnknownError"
155
155
  _retry=true
156
156
  end
157
157
 
158
158
  break if !_retry
159
159
  end
160
160
 
161
-
162
-
161
+ Scoutui::Logger::LogMgr.instance.debug + " clicked(#{_locator}): #{_clicked}"
163
162
 
164
163
  page_elt = Scoutui::Utils::TestUtils.instance.getPageElement(_locator)
165
164
 
@@ -27,7 +27,7 @@ module Scoutui::Commands
27
27
  rc=true
28
28
  _req = Scoutui::Utils::TestUtils.instance.getReq()
29
29
 
30
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Highlight.execute(#{@cmd})"
30
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Highlight.execute(#{@cmd}), req:#{_req}"
31
31
 
32
32
  @drv=drv if !drv.nil?
33
33
 
@@ -66,12 +66,16 @@ module Scoutui::Commands
66
66
 
67
67
  _rc = _highlight(obj, e)
68
68
 
69
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " highlight(#{e}) : #{_rc}"
70
+
69
71
  if q.has_key?('frame')
70
72
  @drv.switch_to.default_content
71
73
  Scoutui::Commands::Utils.instance.resetFrameSearch
72
74
  end
73
75
 
74
- rc &&= _rc
76
+ rc = rc && _rc
77
+
78
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ||| assert? => #{assert?.to_s} : _rc:#{_rc} rc:#{rc}"
75
79
 
76
80
  if assert?
77
81
  Testmgr::TestReport.instance.getReq(_req).testcase('highlight').add(!obj.nil?, "Verify object #{elt} to highlight exists : #{obj.class.to_s}")
@@ -80,6 +84,9 @@ module Scoutui::Commands
80
84
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " highlight(#{elt} : #{obj.class.to_s}"
81
85
  end
82
86
 
87
+
88
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " highlight(#{elt.to_s} : #{_rc}"
89
+
83
90
  end
84
91
 
85
92
  rescue => ex
@@ -87,6 +94,7 @@ module Scoutui::Commands
87
94
  Scoutui::Logger::LogMgr.instance.warn "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
88
95
  end
89
96
 
97
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " highlight.rc ==> #{rc}"
90
98
  setResult(rc)
91
99
  end
92
100
 
@@ -127,6 +127,9 @@ module Scoutui::Commands
127
127
 
128
128
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " expandMacro(#{_text_to_type})"
129
129
 
130
+ if _text_to_type.nil? || _text_to_type.empty?
131
+ return ""
132
+ end
130
133
 
131
134
  @transList.each_pair do |_k, _v|
132
135
 
@@ -1,3 +1,3 @@
1
1
  module Scoutui
2
- VERSION = "2.0.3.43.pre"
2
+ VERSION = "2.0.3.44.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.43.pre
4
+ version: 2.0.3.44.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-22 00:00:00.000000000 Z
11
+ date: 2016-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler