scoutui 2.0.5.1.1.pre → 2.0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -2
- data/README.md +0 -7
- data/examples/ex1/phantom.chrome.json +4 -0
- data/examples/ex1/run.sh +85 -0
- data/examples/ex1/simple.yml +13 -0
- data/examples/ex1/win10.chromebeta.json +6 -0
- data/lib/scoutui/appmodel/q_model.rb +5 -0
- data/lib/scoutui/base/assertions.rb +49 -11
- data/lib/scoutui/base/q_browser.rb +181 -15
- data/lib/scoutui/base/q_har_mgr.rb +63 -0
- data/lib/scoutui/base/test_data.rb +0 -2
- data/lib/scoutui/base/test_scout.rb +2 -1
- data/lib/scoutui/base/user_vars.rb +1 -1
- data/lib/scoutui/base/visual_test_framework.rb +78 -15
- data/lib/scoutui/commands/clauses/do_until.rb +25 -6
- data/lib/scoutui/commands/clauses/then_clause.rb +12 -0
- data/lib/scoutui/commands/click_object.rb +5 -2
- data/lib/scoutui/commands/commands.rb +85 -10
- data/lib/scoutui/commands/highlight.rb +72 -21
- data/lib/scoutui/commands/mouse_over.rb +4 -2
- data/lib/scoutui/commands/pause.rb +9 -2
- data/lib/scoutui/commands/strategy.rb +21 -2
- data/lib/scoutui/commands/type.rb +40 -5
- data/lib/scoutui/eyes/eye_scout.rb +2 -1
- data/lib/scoutui/utils/utils.rb +9 -0
- data/lib/scoutui/version.rb +1 -1
- data/scoutui.gemspec +2 -3
- metadata +15 -59
- data/bin/scoutui_driver +0 -1
- data/examples/benchmark/ex.rb +0 -16
- data/examples/capabilities/win10.chrome46.json +0 -6
- data/examples/carmax/appmodel/search_results.json +0 -27
- data/examples/carmax/commands/commands.yml +0 -63
- data/examples/cmdshell/commands/hello.yml +0 -22
- data/examples/converters/jsonupdate.rb +0 -31
- data/examples/ex2/appmodel/common.json +0 -51
- data/examples/ex2/appmodel/page_model.json +0 -106
- data/examples/ex2/appmodel/register.model.json +0 -42
- data/examples/ex2/commands/commands.basic.appmodel.yml +0 -8
- data/examples/ex2/commands/commands.yml +0 -115
- data/examples/ex2/commands/ex1.yml +0 -7
- data/examples/ex2/commands/ex1c.yml +0 -8
- data/examples/ex2/commands/ex1d.yml +0 -22
- data/examples/ex2/commands/ex2.hover.yml +0 -43
- data/examples/ex2/commands/ex2.yml +0 -24
- data/examples/ex2/data.json +0 -6
- data/examples/ex2/test-configs/test.config.basic.json +0 -12
- data/examples/ex2/test-configs/test.config.json +0 -31
- data/examples/ex2/tests/run-test.sh +0 -125
- data/examples/ex2/tests/test-basic-appmodel.sh +0 -14
- data/examples/ex2/tests/test-example.sh +0 -39
- data/examples/ex2/tests/test-example1a.sh +0 -16
- data/examples/ex2/tests/test-example1b.sh +0 -13
- data/examples/ex2/tests/test-example1c.sh +0 -15
- data/examples/ex2/tests/test-example1d.sh +0 -15
- data/examples/ex2/tests/test-example2.forms.eyes.sh +0 -40
- data/examples/ex2/tests/test-example2.hover.eyes.sh +0 -40
- data/examples/ex2/tests/test-example2.hover.sh +0 -26
- data/examples/ex2/tests/test-example2.sh +0 -43
- data/examples/ex2/tests/test-example3.sauce.sh +0 -77
- data/examples/ex2/tests/test-example3.sh +0 -41
- data/examples/headless/run.sh +0 -15
- data/examples/http/sendreq.rb +0 -29
@@ -27,6 +27,13 @@ module Scoutui::Commands
|
|
27
27
|
rc=Scoutui::Utils::TestUtils.instance.loadModel(f)
|
28
28
|
rescue => ex
|
29
29
|
rc=false
|
30
|
+
Scoutui::Logger::LogMgr.instance.fatal __FILE__ + (__LINE__).to_s + " loadModel(#{f}) => Failed"
|
31
|
+
end
|
32
|
+
|
33
|
+
Testmgr::TestReport.instance.getReq("ScoutUI").testcase('Setup').add(rc, "Verify load model #{f}.")
|
34
|
+
|
35
|
+
if !rc
|
36
|
+
Scoutui::Utils::TestUtils.instance.setState(:abort, "Failed to load model file #{f}.")
|
30
37
|
end
|
31
38
|
|
32
39
|
rc
|
@@ -115,8 +122,9 @@ module Scoutui::Commands
|
|
115
122
|
caps
|
116
123
|
end
|
117
124
|
|
118
|
-
def initialize()
|
125
|
+
def initialize(opts=nil)
|
119
126
|
|
127
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Scoutui::Commands.initialize(#{opts})"
|
120
128
|
@profile=nil
|
121
129
|
browserType = Scoutui::Base::UserVars.instance.getBrowserType()
|
122
130
|
caps = Scoutui::Utils::TestUtils.instance.getCapabilities()
|
@@ -296,11 +304,22 @@ module Scoutui::Commands
|
|
296
304
|
|
297
305
|
else
|
298
306
|
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Create WebDriver: #{browserType.to_s}"
|
299
|
-
|
307
|
+
|
308
|
+
if @profile.nil?
|
309
|
+
@drv=Selenium::WebDriver.for browserType.to_sym
|
310
|
+
else
|
311
|
+
@drv=Selenium::WebDriver.for browserType.to_sym, :profile => @profile
|
312
|
+
end
|
313
|
+
|
300
314
|
setViewport()
|
301
315
|
|
302
316
|
end
|
303
317
|
|
318
|
+
|
319
|
+
if opts.is_a?(Hash) && opts.has_key?(:loadModel).nil?
|
320
|
+
loadModel(opts[:loadModel])
|
321
|
+
end
|
322
|
+
|
304
323
|
end
|
305
324
|
|
306
325
|
end
|
@@ -5,6 +5,7 @@ module Scoutui::Commands
|
|
5
5
|
class Type < Command
|
6
6
|
|
7
7
|
KEYBOARD_CMDS={
|
8
|
+
'__DELETE__' => { :val => :delete },
|
8
9
|
'__DOWN__' => { :val => :arrow_down },
|
9
10
|
'__ENTER__' => { :val => :enter },
|
10
11
|
'__ESC__' => { :val => :escape },
|
@@ -12,7 +13,13 @@ module Scoutui::Commands
|
|
12
13
|
'__UP__' => { :val => :arrow_up },
|
13
14
|
'__LEFT__' => { :val => :arrow_left },
|
14
15
|
'__RIGHT__' => { :val => :arrow_right },
|
15
|
-
'__TAB__' => { :val => :tab }
|
16
|
+
'__TAB__' => { :val => :tab },
|
17
|
+
'__SHIFT_TAB__' => {:val => :custom,
|
18
|
+
:run => lambda { |drv|
|
19
|
+
puts __FILE__ + (__LINE__).to_s + " *** SHIFT_TAB ***"
|
20
|
+
drv.action.key_down(:shift).send_keys(:tab).perform;
|
21
|
+
drv.action.key_up(:shift).perform;
|
22
|
+
}}
|
16
23
|
}
|
17
24
|
|
18
25
|
KEYBOARD_LIST={
|
@@ -66,6 +73,7 @@ module Scoutui::Commands
|
|
66
73
|
|
67
74
|
_tm={:start => 0, :end => 0 }
|
68
75
|
|
76
|
+
_val=nil
|
69
77
|
_isKb=false
|
70
78
|
_rc=false
|
71
79
|
_req = Scoutui::Utils::TestUtils.instance.getReq()
|
@@ -75,13 +83,40 @@ module Scoutui::Commands
|
|
75
83
|
|
76
84
|
begin
|
77
85
|
|
78
|
-
if @cmd.match(/^type\(
|
86
|
+
if @cmd.match(/^type\(focused\s*,\s*.*\)\s*$/)
|
87
|
+
|
88
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Type into active element"
|
89
|
+
obj = @drv.switch_to.active_element
|
90
|
+
|
91
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " | active.Tag : " + obj.tag_name
|
92
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " | active.Class: " + obj.attribute('class').to_s
|
93
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " | active.ID : " + obj.attribute('id').to_s
|
94
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " | active.Name : " + obj.attribute('name').to_s
|
95
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " | active.Text : " + obj.text.to_s
|
96
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " | active.Value: " + obj.attribute('value').to_s
|
97
|
+
|
98
|
+
_val = @cmd.match(/^type\(focused\s*,\s*(.*)\)\s*$/)[1].to_s
|
99
|
+
|
100
|
+
if KEYBOARD_CMDS.has_key?(_val)
|
101
|
+
_val = KEYBOARD_CMDS[_val][:val]
|
102
|
+
end
|
103
|
+
|
104
|
+
_xpath="[focused]"
|
105
|
+
|
106
|
+
obj.send_keys(_val)
|
107
|
+
_rc=true
|
108
|
+
|
109
|
+
elsif @cmd.match(/^type\((#{KEYBOARD_CMDS.keys.join('|')})\)$/)
|
79
110
|
|
80
111
|
_tm[:start]=Time.now
|
81
112
|
|
82
|
-
_keyVal=@cmd.match(/^type\((#{KEYBOARD_CMDS.keys.join('|')})\)$/)[1]
|
113
|
+
_keyVal=@cmd.match(/^type\((#{KEYBOARD_CMDS.keys.join('|')})\)$/)[1].to_s
|
83
114
|
|
84
|
-
|
115
|
+
if KEYBOARD_CMDS[_keyVal][:val]==:custom
|
116
|
+
KEYBOARD_CMDS[_keyVal][:run].call(@drv)
|
117
|
+
else
|
118
|
+
@drv.action.send_keys(KEYBOARD_CMDS[_keyVal][:val]).perform
|
119
|
+
end
|
85
120
|
|
86
121
|
thenClause = Scoutui::Commands::ThenClause.new(@drv)
|
87
122
|
doUntil = Scoutui::Commands::DoUntil.new(@drv)
|
@@ -107,7 +142,7 @@ module Scoutui::Commands
|
|
107
142
|
_val = @cmd.match(/^\s*type[\!]*\((.*),\s*(.*)\s*\)\s*$/)[2]
|
108
143
|
end
|
109
144
|
|
110
|
-
Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + "Process TYPE #{_val} into #{_xpath}"
|
145
|
+
Scoutui::Logger::LogMgr.instance.commands.debug __FILE__ + (__LINE__).to_s + " Process TYPE #{_val} into #{_xpath}"
|
111
146
|
|
112
147
|
_tm[:start]=Time.now
|
113
148
|
|
@@ -308,7 +308,8 @@ module Scoutui::Eyes
|
|
308
308
|
end
|
309
309
|
|
310
310
|
rescue => ex
|
311
|
-
Scoutui::Logger::LogMgr.instance.warn ex.backtrace
|
311
|
+
# Scoutui::Logger::LogMgr.instance.warn ex.backtrace
|
312
|
+
Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
|
312
313
|
end
|
313
314
|
|
314
315
|
end
|
data/lib/scoutui/utils/utils.rb
CHANGED
@@ -242,6 +242,15 @@ module Scoutui::Utils
|
|
242
242
|
loadModel(@options[:pages])
|
243
243
|
end
|
244
244
|
|
245
|
+
opt.on('--var [Key:Value]') { |o|
|
246
|
+
if o.match(/(.+?):(.*)$/)
|
247
|
+
_result=o.match(/(.+)?:(.*)$/)
|
248
|
+
Scoutui::Base::UserVars.instance.setVar(_result[1].to_s, _result[2].to_s)
|
249
|
+
else
|
250
|
+
Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Invalid --var value : #{o}, should be <key>:<value>"
|
251
|
+
end
|
252
|
+
}
|
253
|
+
|
245
254
|
opt.on('--pagemodel [PageModel]') { |o|
|
246
255
|
@options[:page_model] = o
|
247
256
|
loadModel(@options[:page_model].to_s)
|
data/lib/scoutui/version.rb
CHANGED
data/scoutui.gemspec
CHANGED
@@ -32,9 +32,8 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency "json", ">= 1.8.3"
|
33
33
|
spec.add_development_dependency "faker"
|
34
34
|
spec.add_development_dependency "logging"
|
35
|
-
spec.add_development_dependency "sauce_whisk"
|
35
|
+
spec.add_development_dependency "sauce_whisk", "0.0.21"
|
36
36
|
spec.add_development_dependency "testmgr", ">= 0.3.2.pre"
|
37
|
-
spec.add_development_dependency "
|
38
|
-
spec.add_development_dependency "DataMgr", ">= 0.1.1.1.pre"
|
37
|
+
spec.add_development_dependency "DataMgr", ">=0.2.0"
|
39
38
|
spec.add_development_dependency "CmdShellMgr", ">= 0.1.1.2.pre"
|
40
39
|
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.5.
|
4
|
+
version: 2.0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Kim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -154,16 +154,16 @@ dependencies:
|
|
154
154
|
name: sauce_whisk
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - '='
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 0.0.21
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: 0.0.21
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: testmgr
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,34 +178,20 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: 0.3.2.pre
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: tiny_tds
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ">="
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '0'
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ">="
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '0'
|
195
181
|
- !ruby/object:Gem::Dependency
|
196
182
|
name: DataMgr
|
197
183
|
requirement: !ruby/object:Gem::Requirement
|
198
184
|
requirements:
|
199
185
|
- - ">="
|
200
186
|
- !ruby/object:Gem::Version
|
201
|
-
version: 0.
|
187
|
+
version: 0.2.0
|
202
188
|
type: :development
|
203
189
|
prerelease: false
|
204
190
|
version_requirements: !ruby/object:Gem::Requirement
|
205
191
|
requirements:
|
206
192
|
- - ">="
|
207
193
|
- !ruby/object:Gem::Version
|
208
|
-
version: 0.
|
194
|
+
version: 0.2.0
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
196
|
name: CmdShellMgr
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,47 +223,16 @@ files:
|
|
237
223
|
- README.md
|
238
224
|
- Rakefile
|
239
225
|
- bin/console
|
240
|
-
- bin/scoutui_driver
|
241
226
|
- bin/scoutui_driver.rb
|
242
227
|
- bin/setup
|
243
|
-
- examples/benchmark/ex.rb
|
244
|
-
- examples/capabilities/win10.chrome46.json
|
245
|
-
- examples/carmax/appmodel/search_results.json
|
246
|
-
- examples/carmax/commands/commands.yml
|
247
|
-
- examples/cmdshell/commands/hello.yml
|
248
|
-
- examples/converters/jsonupdate.rb
|
249
228
|
- examples/ex1/commands.holidays.yml
|
250
229
|
- examples/ex1/commands.yml
|
230
|
+
- examples/ex1/phantom.chrome.json
|
231
|
+
- examples/ex1/run.sh
|
232
|
+
- examples/ex1/simple.yml
|
251
233
|
- examples/ex1/test-example.sh
|
252
234
|
- examples/ex1/test.config.json
|
253
|
-
- examples/
|
254
|
-
- examples/ex2/appmodel/page_model.json
|
255
|
-
- examples/ex2/appmodel/register.model.json
|
256
|
-
- examples/ex2/commands/commands.basic.appmodel.yml
|
257
|
-
- examples/ex2/commands/commands.yml
|
258
|
-
- examples/ex2/commands/ex1.yml
|
259
|
-
- examples/ex2/commands/ex1c.yml
|
260
|
-
- examples/ex2/commands/ex1d.yml
|
261
|
-
- examples/ex2/commands/ex2.hover.yml
|
262
|
-
- examples/ex2/commands/ex2.yml
|
263
|
-
- examples/ex2/data.json
|
264
|
-
- examples/ex2/test-configs/test.config.basic.json
|
265
|
-
- examples/ex2/test-configs/test.config.json
|
266
|
-
- examples/ex2/tests/run-test.sh
|
267
|
-
- examples/ex2/tests/test-basic-appmodel.sh
|
268
|
-
- examples/ex2/tests/test-example.sh
|
269
|
-
- examples/ex2/tests/test-example1a.sh
|
270
|
-
- examples/ex2/tests/test-example1b.sh
|
271
|
-
- examples/ex2/tests/test-example1c.sh
|
272
|
-
- examples/ex2/tests/test-example1d.sh
|
273
|
-
- examples/ex2/tests/test-example2.forms.eyes.sh
|
274
|
-
- examples/ex2/tests/test-example2.hover.eyes.sh
|
275
|
-
- examples/ex2/tests/test-example2.hover.sh
|
276
|
-
- examples/ex2/tests/test-example2.sh
|
277
|
-
- examples/ex2/tests/test-example3.sauce.sh
|
278
|
-
- examples/ex2/tests/test-example3.sh
|
279
|
-
- examples/headless/run.sh
|
280
|
-
- examples/http/sendreq.rb
|
235
|
+
- examples/ex1/win10.chromebeta.json
|
281
236
|
- lib/scoutui.rb
|
282
237
|
- lib/scoutui/appmodel/q_model.rb
|
283
238
|
- lib/scoutui/base/assertions.rb
|
@@ -285,6 +240,7 @@ files:
|
|
285
240
|
- lib/scoutui/base/q_applitools.rb
|
286
241
|
- lib/scoutui/base/q_browser.rb
|
287
242
|
- lib/scoutui/base/q_form.rb
|
243
|
+
- lib/scoutui/base/q_har_mgr.rb
|
288
244
|
- lib/scoutui/base/requirements.rb
|
289
245
|
- lib/scoutui/base/test_context.rb
|
290
246
|
- lib/scoutui/base/test_data.rb
|
@@ -347,9 +303,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
347
303
|
version: '0'
|
348
304
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
349
305
|
requirements:
|
350
|
-
- - "
|
306
|
+
- - ">="
|
351
307
|
- !ruby/object:Gem::Version
|
352
|
-
version:
|
308
|
+
version: '0'
|
353
309
|
requirements: []
|
354
310
|
rubyforge_project:
|
355
311
|
rubygems_version: 2.6.2
|
data/bin/scoutui_driver
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
scoutui_driver.rb
|
data/examples/benchmark/ex.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
|
3
|
-
|
4
|
-
"search_results": {
|
5
|
-
|
6
|
-
|
7
|
-
"results": {
|
8
|
-
|
9
|
-
"header": {
|
10
|
-
"reqid": "REQ-HEADER",
|
11
|
-
"locator": "//span[text()='Applied filters']",
|
12
|
-
"visible_when": "title(Search Results)"
|
13
|
-
}
|
14
|
-
|
15
|
-
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
}
|
@@ -1,63 +0,0 @@
|
|
1
|
-
page:
|
2
|
-
name: Home
|
3
|
-
description: Navigate to a specified URL and wait until the expected elements are present
|
4
|
-
url: http://www.carmax.com
|
5
|
-
---
|
6
|
-
page:
|
7
|
-
name: Highlight Example
|
8
|
-
action: highlight(page(main).get(nav).get(findYourCar))
|
9
|
-
---
|
10
|
-
page:
|
11
|
-
timeout: 5
|
12
|
-
name: Click Find Your Car
|
13
|
-
action: click(page(main).get(nav).get(findYourCar))
|
14
|
-
expected:
|
15
|
-
wait1: //header//*[text()='Pricex']
|
16
|
-
---
|
17
|
-
page:
|
18
|
-
name: Basic Search
|
19
|
-
timeout: 5
|
20
|
-
action: click(page(main).get(nav).get(basic_search))
|
21
|
-
expected:
|
22
|
-
wait: page(basic_search).get(free_text)
|
23
|
-
assertions: [
|
24
|
-
elvis: {
|
25
|
-
"locator": "//button[@text()='Go']",
|
26
|
-
"visible_when": "visible(page(basic_search).get(free_text))"
|
27
|
-
},
|
28
|
-
better_assert: {
|
29
|
-
"locator": "page(basic_search)"
|
30
|
-
}
|
31
|
-
]
|
32
|
-
---
|
33
|
-
page:
|
34
|
-
name: Popup
|
35
|
-
timeout: 5
|
36
|
-
execute_when: visible(//area[@alt='no'])
|
37
|
-
action: click(//area[@alt='no'])
|
38
|
-
---
|
39
|
-
page:
|
40
|
-
name: Enter Porsche
|
41
|
-
action: type(page(basic_search).get(free_text), Porsche 911)
|
42
|
-
expected:
|
43
|
-
wait: //a[contains(@href, 'Porsche%20911')]
|
44
|
-
---
|
45
|
-
page:
|
46
|
-
action: highlight(//a[contains(@href, 'Porsche%20911')])
|
47
|
-
---
|
48
|
-
page:
|
49
|
-
action: mouseover(//a[contains(@href, 'Porsche%20911')])
|
50
|
-
---
|
51
|
-
page:
|
52
|
-
action: click(page(basic_search).get(go))
|
53
|
-
assertions: [
|
54
|
-
assert1: {
|
55
|
-
"locator": "page(search_results).get(results)"
|
56
|
-
}
|
57
|
-
]
|
58
|
-
---
|
59
|
-
page:
|
60
|
-
name: Pause after Nav.
|
61
|
-
action: pause
|
62
|
-
skipit: false
|
63
|
-
|
@@ -1,22 +0,0 @@
|
|
1
|
-
page:
|
2
|
-
name: Assign my vars
|
3
|
-
action: assignments
|
4
|
-
vars:
|
5
|
-
- assign(MyEntity, ScoutUI)
|
6
|
-
---
|
7
|
-
page:
|
8
|
-
name: Simple Cmd
|
9
|
-
id: MultiLs
|
10
|
-
action: defineCommand
|
11
|
-
commands: sed -e 's/domain/${MyEntity}/g' /tmp/userlist-v2.txt > /tmp/mydata.txt
|
12
|
-
---
|
13
|
-
page:
|
14
|
-
name: Run Multi
|
15
|
-
action: executeCommands
|
16
|
-
commands:
|
17
|
-
- id: MultiLs
|
18
|
-
---
|
19
|
-
page:
|
20
|
-
name: Pause afger MultiLs
|
21
|
-
action: pause
|
22
|
-
skip: false
|
@@ -1,31 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
def iterate(h)
|
4
|
-
h.each do |k, v|
|
5
|
-
if v.is_a?(Hash) || v.is_a?(Array)
|
6
|
-
iterate(v)
|
7
|
-
else
|
8
|
-
puts("k is #{k}, value is #{v}")
|
9
|
-
if v.match(/peter/i)
|
10
|
-
h[k]='Elvis'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
h={
|
18
|
-
'person': {
|
19
|
-
'first': 'Peter',
|
20
|
-
'last': 'Kim',
|
21
|
-
'address': {
|
22
|
-
'city': 'Manhattan peter',
|
23
|
-
'state': 'New York'
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
|
29
|
-
iterate(h)
|
30
|
-
|
31
|
-
puts "h => #{h}"
|
@@ -1,51 +0,0 @@
|
|
1
|
-
{
|
2
|
-
|
3
|
-
"basic_nav": {
|
4
|
-
|
5
|
-
"find_cars_for_sale": {
|
6
|
-
"locator": "//*[@id='header']//a[text()='Find Cars for Sale']",
|
7
|
-
"visible_when": "always"
|
8
|
-
},
|
9
|
-
|
10
|
-
"sell_us_your_car": {
|
11
|
-
"locator": "//*[@id='header']//a[text()='Sell Us Your Car']",
|
12
|
-
"visible_when": "title(Used Cars for Sale.*)"
|
13
|
-
},
|
14
|
-
|
15
|
-
"research": {
|
16
|
-
"locator": "//*[@id='header']//a[text()='Research']",
|
17
|
-
"when_hovered": [
|
18
|
-
{ "RSRCH": [
|
19
|
-
"visible(//*[@id='header']//a[text()='Ratings and Reviews'])",
|
20
|
-
"visible(//*[@id='header']//a[text()='Payment Calculators'])",
|
21
|
-
"visible(page(submenu3).get(fuel_econ))"
|
22
|
-
]
|
23
|
-
}
|
24
|
-
]
|
25
|
-
}
|
26
|
-
|
27
|
-
},
|
28
|
-
|
29
|
-
"find_cars_for_sale_sm": {
|
30
|
-
"description": "Example of observer-like pattern, where an element registers itself to another elements action.",
|
31
|
-
"locator": "//*[@id='header']//a[text()='Nationwide Transfers']",
|
32
|
-
"visible_when": "mouseover(page(basic_nav).get(find_cars_for_sale))"
|
33
|
-
},
|
34
|
-
|
35
|
-
"submenu2": {
|
36
|
-
|
37
|
-
"faq": {
|
38
|
-
"locator": "//*[@id='header']//a[text()='FAQ']",
|
39
|
-
"visible_when": "mouseover(page(basic_nav).get(sell_us_your_car))"
|
40
|
-
}
|
41
|
-
|
42
|
-
},
|
43
|
-
|
44
|
-
"submenu3": {
|
45
|
-
"fuel_econ": {
|
46
|
-
"locator": "//*[@id='header']//a[text()='Payment Calculators']"
|
47
|
-
}
|
48
|
-
}
|
49
|
-
|
50
|
-
|
51
|
-
}
|
@@ -1,106 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"home": {
|
3
|
-
"cars4sale": {
|
4
|
-
"locator": "//a[text()='Find Cars for Sale']",
|
5
|
-
"visible_when": "always",
|
6
|
-
"reqid": "REQ-Home"
|
7
|
-
},
|
8
|
-
"whyCarMax": {
|
9
|
-
"locator": "//*[@id='header']//a[text()='Why CarMax']",
|
10
|
-
"visible_when": "text(page(home).get(cars4sale))=Find Cars for Sale",
|
11
|
-
"reqid": "REQ-Home"
|
12
|
-
},
|
13
|
-
|
14
|
-
"sign_in": {
|
15
|
-
"locator": "//input[text()='Sign in']",
|
16
|
-
"visible_when": "title(/Carmax.*online/)",
|
17
|
-
"reqid": "REQ-Home"
|
18
|
-
},
|
19
|
-
|
20
|
-
"register": {
|
21
|
-
"locator": "//*[@id='register']",
|
22
|
-
"reqid": "REQ-register",
|
23
|
-
|
24
|
-
|
25
|
-
"when_clicked": [
|
26
|
-
{ "req-XYZ": "page(register_pg).get(firstname)" },
|
27
|
-
{ "req-XYZ": "visible(page(register_pg).get(firstname))"},
|
28
|
-
{
|
29
|
-
"REGIS-002": [
|
30
|
-
"title(Register for MyCarMax)",
|
31
|
-
"visible(css=#signInLink)"
|
32
|
-
]
|
33
|
-
}
|
34
|
-
],
|
35
|
-
|
36
|
-
|
37
|
-
"visible_when": [
|
38
|
-
{ "visible_when": "visible(page(home).get(sign_in))=true"},
|
39
|
-
{ "visible_when": "visible(page(home).get(cars4sale))=true"},
|
40
|
-
{ "visible_when": "visible(page(home).get(sign_in))=false"},
|
41
|
-
{ "visible_when": "title(Car[mM]ax.*online)"}
|
42
|
-
]
|
43
|
-
},
|
44
|
-
|
45
|
-
"mycarmax": {
|
46
|
-
"locator": "//*[@id='mycarmax']",
|
47
|
-
"visible_when": "title(CarMax - Browse used cars and new cars online)",
|
48
|
-
"reqid": "REQ-Home"
|
49
|
-
},
|
50
|
-
|
51
|
-
"logoff": {
|
52
|
-
"locator": "//*[text()='Log off']",
|
53
|
-
"visible_when": "never",
|
54
|
-
"reqid": "REQ-Home"
|
55
|
-
}
|
56
|
-
},
|
57
|
-
|
58
|
-
|
59
|
-
"register_pg": {
|
60
|
-
"firstname": {
|
61
|
-
"locator": "css=input#FirstName",
|
62
|
-
"visible_when": "title(Register for MyCarMax)"
|
63
|
-
},
|
64
|
-
|
65
|
-
"lastname": {
|
66
|
-
"locator": "//input[@id='LastName']",
|
67
|
-
"visible_when": "always"
|
68
|
-
}
|
69
|
-
},
|
70
|
-
|
71
|
-
"research": {
|
72
|
-
|
73
|
-
"fuel_economy": {
|
74
|
-
"locator": ""
|
75
|
-
}
|
76
|
-
|
77
|
-
},
|
78
|
-
|
79
|
-
"main_nav": {
|
80
|
-
"search_input": {
|
81
|
-
"locator": "//input[@id='search']",
|
82
|
-
"visible_when": "always"
|
83
|
-
},
|
84
|
-
"search_btn": {
|
85
|
-
"locator": "//a[@id='search-btn']",
|
86
|
-
"visible_when": "always"
|
87
|
-
}
|
88
|
-
},
|
89
|
-
|
90
|
-
"find_cars_by": {
|
91
|
-
"make": {
|
92
|
-
"locator": "//*[@id='bantab0']/a[contains(text(), 'Make')]",
|
93
|
-
"visible_when": "always"
|
94
|
-
},
|
95
|
-
|
96
|
-
"price_list": {
|
97
|
-
"locator": "//*[@id='minPriceFilter']",
|
98
|
-
"visible_when": "text(//*[@id='minPriceFilter'])=$0"
|
99
|
-
}
|
100
|
-
},
|
101
|
-
|
102
|
-
"search": {
|
103
|
-
"header": "//title"
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|