scoutui 2.0.3.5.pre → 2.0.3.6.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: 72d63f27b4ad75996c75b6f0dee10a171fc8c253
4
- data.tar.gz: da5188f0b749627620d8c503feaa6ae5fe571a7c
3
+ metadata.gz: 096cfa3809706ec4eeec2030cc803f6d8cd171e6
4
+ data.tar.gz: 32a508794bd4e1dd4d8963e0059ecccd04528377
5
5
  SHA512:
6
- metadata.gz: 654175f6640baf9a7ba3c67f5a86f6d03af6c200d7956c4fb266494d379cc06f8361721f45b63f12e6100897ce755cbb7a014c8992930f171316e7b3a74e4461
7
- data.tar.gz: 8fe1826a4bbf267a92ae9dc40408cc301f3c84a3b91e32336bef117ba2a60f3ae7ee613950c131b8bb1cee3d955d4e01c4609f02188f4504dad16b0587f31564
6
+ metadata.gz: 1df2a115ace9a8c1f3ad84009a79c44003fb624c3e3be5eb3f0861f6aeaaebc7a15c261e2c462b1e285b4b83a65899b981673d9a501d09119c5a55864f1d3608
7
+ data.tar.gz: 4c27ccb3f63394650c0c38e44fd731a8515746f35b18eb254bdd476e10e5b9183c9cda2d5fa3564ef01763c54ea2ec3428f891b205dfa1910cbb1bc26a4c4374
@@ -69,7 +69,7 @@ module Scoutui::Base
69
69
 
70
70
  if _v.is_a?(String)
71
71
  puts __FILE__ + (__LINE__).to_s + " #{_v} is a string - next"
72
- puts __FILE__ + (__LINE__).to_S + " Pause", gets
72
+ puts __FILE__ + (__LINE__).to_S + " TBD" # Pause", gets
73
73
  next
74
74
  end
75
75
 
@@ -120,7 +120,7 @@ module Scoutui::Base
120
120
 
121
121
 
122
122
  elsif assertPageElement(_k, _v, _obj, my_driver, _req)
123
- puts __FILE__ + (__LINE__).to_s + " Processed assertPageElement(#{_k}, #{_v})"; # gets
123
+ puts __FILE__ + (__LINE__).to_s + " Processed assertPageElement(#{_k}, #{_v})";
124
124
  ;
125
125
  # elsif visible_when_title(_k, _v, _obj, my_driver, _req)
126
126
  # ;
@@ -186,6 +186,11 @@ module Scoutui::Base
186
186
  puts __FILE__ + (__LINE__).to_s + " Pause debug"; gets
187
187
  end
188
188
 
189
+
190
+ def isEanbled(my_driver, page_elt, _req=nil, _immediate=false)
191
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " isEanbled(#{page_elt}"
192
+ end
193
+
189
194
  #
190
195
  # { reqid : <pageElt> }
191
196
  def isVisible(my_driver, page_elt, _req=nil, _immediate=false)
@@ -106,7 +106,7 @@ module Scoutui::Base
106
106
  puts __FILE__ + (__LINE__).to_s + " swtich on Chrome browser"
107
107
  bframes = drv.find_elements(:xpath, '//iframe')
108
108
 
109
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " //iframe : #{bframes.size}"
109
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " //iframe : size #{bframes.size}"
110
110
 
111
111
  if bframes.size == 0
112
112
  bframes = drv.find_elements(:xpath, '//frame')
@@ -124,7 +124,7 @@ module Scoutui::Base
124
124
  end
125
125
 
126
126
 
127
- puts __FILE__ + (__LINE__).to_s + " <tag, id> :: <#{_tag}, #{id} >"
127
+ puts __FILE__ + (__LINE__).to_s + "[switch_into_frame.chrome]: <tag, id> :: <#{_tag}, #{id} >"
128
128
 
129
129
  if !_tag.empty? && id==_tag
130
130
 
@@ -144,6 +144,8 @@ module Scoutui::Base
144
144
 
145
145
  else
146
146
  # Firefox, IE
147
+ puts __FILE__ + (__LINE__).to_s + " [switch_into_frame]: drv.switch_to.frame(#{id.to_s}";
148
+
147
149
  hit = drv.switch_to.frame(id.to_s.strip)
148
150
  end
149
151
 
@@ -157,6 +159,7 @@ module Scoutui::Base
157
159
  # format: frame(<string>)[.frame(<string>)]*
158
160
  def self.switch_frame(drv, e)
159
161
 
162
+ puts __FILE__ + (__LINE__).to_s + "\n\n== self.switch_frame(#{e}) =="
160
163
  frames=nil
161
164
  if e.is_a?(Hash) && e.has_key?('page') && e['page'].has_key?('frames')
162
165
  puts __FILE__ + (__LINE__).to_s + " frames => #{e['page']['frames']}";
@@ -168,24 +171,49 @@ module Scoutui::Base
168
171
 
169
172
 
170
173
  if !frames.nil?
171
- puts __FILE__ + (__LINE__).to_s + " frames => #{frames}";
174
+ puts __FILE__ + (__LINE__).to_s + " [self.switch_frame]: frames => #{frames}";
172
175
 
173
176
  frame_list=frames.split(/(frame\(.*\))\.(?=[\w])/)
174
177
 
175
178
  frame_list.each do |_f|
176
-
179
+ puts __FILE__ + (__LINE__).to_s + " processing #{_f}"
177
180
 
178
181
  if !_f.empty?
179
182
  _id = _f.match(/frame\((.*)\)/)[1]
180
183
 
181
- puts __FILE__ + (__LINE__).to_s + " switch_to.frame #{_id}"
184
+ puts __FILE__ + (__LINE__).to_s + " [self.switch_frame]: switch_to.frame #{_id}"
182
185
 
183
186
  # Swtich based on browser type
184
187
 
188
+ if isChrome?(drv)
185
189
  if switch_into_frame(drv, _id).nil?
186
190
  Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Frame with name/id #{_id} not found"
187
191
  break
192
+ else
193
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Sucessfully switched frame into #{_id}"
188
194
  end
195
+ else
196
+ puts __FILE__ + (__LINE__).to_s + " [firefox]: switch_to.frame #{_id}"
197
+ drv.switch_to.frame _id
198
+ end
199
+
200
+ if false
201
+
202
+ if drv.browser.to_s.match(/firefox/i)
203
+ puts __FILE__ + (__LINE__).to_s + " [firefox]: switch_to.frame #{_id}"
204
+ drv.switch_to.frame _id
205
+ else
206
+
207
+ if switch_into_frame(drv, _id).nil?
208
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Frame with name/id #{_id} not found"
209
+ break
210
+ else
211
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Sucessfully switched frame into #{_id}"
212
+ end
213
+ end
214
+
215
+ end
216
+
189
217
 
190
218
  end
191
219
 
@@ -227,7 +255,7 @@ module Scoutui::Base
227
255
 
228
256
  def self.frame_getObject(drv, _locator, _timeout=nil)
229
257
 
230
- puts __FILE__ + (__LINE__).to_s + " frame_getObject : #{_locator}"
258
+ puts __FILE__ + (__LINE__).to_s + " [enter]:frame_getObject : #{_locator}"
231
259
 
232
260
  rc = Array.new()
233
261
 
@@ -249,6 +277,8 @@ module Scoutui::Base
249
277
 
250
278
  for i in 0 .. (frames.size - 1)
251
279
 
280
+ _madeSwitch=false
281
+
252
282
  begin
253
283
 
254
284
  _tag = frames[i].attribute('name')
@@ -268,10 +298,14 @@ module Scoutui::Base
268
298
  if drv.browser.to_s.match(/chrome/)
269
299
  drv.switch_to.frame frames[i]
270
300
  else
301
+
302
+ puts __FILE__ + (__LINE__).to_s + " switch_to.frame #{_tag}"
271
303
  drv.switch_to.frame _tag
272
304
  end
273
305
 
306
+ _madeSwitch=true
274
307
 
308
+ # Recurse into sub-frames
275
309
  _hits = frame_getObject(drv, _locator, 3)
276
310
  rescue => ex
277
311
  Scoutui::Logger::LogMgr.instance.debug "Error during processing: #{$!}"
@@ -289,7 +323,8 @@ module Scoutui::Base
289
323
  break
290
324
  end
291
325
 
292
- drv.switch_to.parent_frame
326
+ puts __FILE__ + (__LINE__).to_s + " switch_to.parent_frame()"
327
+ drv.switch_to.parent_frame if _madeSwitch
293
328
 
294
329
  end
295
330
 
@@ -190,7 +190,6 @@ module Scoutui::Base
190
190
  Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " | location : #{_o.location}"
191
191
  Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " | selected :#{_o.selected?}"
192
192
  Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " | methods:#{_o.methods.sort.to_s}" # ", #{_o.text.to_s}, selected: #{_o.to_s}"
193
- # Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " PAUSE"; gets()
194
193
  end
195
194
  end
196
195
 
@@ -355,10 +355,15 @@ module Scoutui::Base
355
355
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " Temp req #{_req} for assertion"
356
356
  end
357
357
 
358
+ if _v.has_key?('locator') && _v['locator'].is_a?(String) && _v.has_key?('enabled_when')
358
359
 
359
- if _v.has_key?('locator') && _v['locator'].is_a?(String) && !_v.has_key?('visible_when')
360
+ Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " Process pageObject #{_v} for enabled_when - PAUSE"; gets;
361
+ isVisible=Scoutui::Base::Assertions.instance.isEnabled(my_driver, _v, _req)
362
+
363
+ elsif _v.has_key?('locator') && _v['locator'].is_a?(String) && !_v.has_key?('visible_when')
360
364
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " Process pageObject #{_v}"
361
365
  isVisible=Scoutui::Base::Assertions.instance.isVisible(my_driver, _v['locator'], _req)
366
+
362
367
  elsif _v.has_key?('locator')
363
368
  _locator = _v['locator'].to_s
364
369
 
@@ -712,14 +717,10 @@ module Scoutui::Base
712
717
 
713
718
  if _execute_when.is_a?(String) && _execute_when.match(/^\s*(existsalert|existsalert|exists\(alert\))/i)
714
719
 
715
- # puts __FILE__ + (__LINE__).to_s + " DEBUG - pause"; gets;
716
720
 
717
721
  if QBrowser.existsAlert?(my_driver)
718
722
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Execution continues - alert IS present #{e[STEP_KEY]}"
719
723
 
720
- # puts __FILE__ + (__LINE__).to_s + " DEBUG - pause2"; gets;
721
-
722
-
723
724
  else
724
725
  # puts __FILE__ + (__LINE__).to_s + " + Execution skipped - alert is NOT present";; gets()
725
726
  next;
@@ -749,8 +750,6 @@ module Scoutui::Base
749
750
  end
750
751
 
751
752
 
752
-
753
-
754
753
  if !isRun(e).nil?
755
754
 
756
755
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ========> RUN <================="
@@ -788,6 +787,8 @@ module Scoutui::Base
788
787
  # if !eyeScout.getStrategy().processCommand(_action, e)
789
788
  if !_command.wasExecuted?
790
789
  processCommand(_action, e, my_driver)
790
+ else
791
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Command #{_action} was not executed"
791
792
  end
792
793
 
793
794
  processExpected(my_driver, e)
@@ -211,7 +211,7 @@ module Scoutui::Commands
211
211
  sauce_endpoint = "http://#{ENV['SAUCE_USERNAME']}:#{ENV['SAUCE_ACCESS_KEY']}@ondemand.saucelabs.com:80/wd/hub"
212
212
 
213
213
  caps[:name]=Scoutui::Utils::TestUtils.instance.getSauceName()
214
- caps[:tags]=["Concur QE", "ScoutUI"]
214
+ caps[:tags]=[caps[:name], "ScoutUI"]
215
215
 
216
216
  begin
217
217
  if client.nil?
@@ -225,6 +225,10 @@ module Scoutui::Commands
225
225
  Scoutui::Logger::LogMgr.instance.debug "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
226
226
  end
227
227
 
228
+ # The following print to STDOUT is useful when running on JENKINS with SauceLabs plugin
229
+ # Reference:
230
+ # https://wiki.saucelabs.com/display/DOCS/Setting+Up+Reporting+between+Sauce+Labs+and+Jenkins
231
+ puts "SauceOnDemandSessionID=#{@drv.session_id} job-name=#{caps[:name]}"
228
232
 
229
233
  else
230
234
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Create WebDriver: #{browserType.to_s}"
@@ -1,3 +1,3 @@
1
1
  module Scoutui
2
- VERSION = "2.0.3.5.pre"
2
+ VERSION = "2.0.3.6.pre"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scoutui
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3.5.pre
4
+ version: 2.0.3.6.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Kim
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-05-09 00:00:00.000000000 Z
12
+ date: 2016-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler