scoutui 2.0.3.56.pre → 2.0.3.57.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: fa1e9da4168ffb5edf8cccd10c20832fd90f3ae3
4
- data.tar.gz: 428e25bade5b679e32b2c36d5a4bfcf62278e6d8
3
+ metadata.gz: 1e7e0c96bd8d139c2267806a2c7859c98de00141
4
+ data.tar.gz: 8ff1e669ca8791686138a75b996addca919ecf5e
5
5
  SHA512:
6
- metadata.gz: 84e1d7e9188db85a547bb649be2c35a90431ffee43f9af6e2b1be505494f4c0c35ee11c5b07a8c699c205dc0485732405d57bf1ae31527d1603eb0ab3b8d5150
7
- data.tar.gz: eb36b018fe40f0cae6920dc14b78b17465783f94d11f8e5128146b4a9027b30d1fe299f858dea6691f2ce61dd0f0da17f622b9599d55215bc5e6b3b95bf0024f
6
+ metadata.gz: 539d55d57c15b8b6cd5b52f9bff5ae105bdc4911ec780b26b48a4247f37d8b26649da83b3e81bbb9ca376a3b7ab649b7f30fce1561a464872942acce68464b37
7
+ data.tar.gz: cda66bb0d63614c4c1760df13ed9e233cc588d864792d1e8c2a75e1c16baa224ea40e3846053f3ccb982492e61fd212b24a8509c2ddf00e112687e70348483e1
@@ -0,0 +1 @@
1
+ scoutui_driver.rb
@@ -296,9 +296,23 @@ module Scoutui::Base
296
296
  def self.isSnapIt(e)
297
297
  _snapit=false
298
298
 
299
- if e[STEP_KEY].has_key?("snapit")
300
- _snapit = !(e[STEP_KEY]["snapit"].to_s.match(/true/i).nil?)
299
+ begin
300
+
301
+ if e[STEP_KEY].has_key?("snapit")
302
+
303
+ if e[STEP_KEY]["snapit"].is_a?(String)
304
+ _snapit = !(e[STEP_KEY]["snapit"].to_s.match(/\s*(true|yes|y)\s*$/i).nil?)
305
+ elsif e[STEP_KEY]["snapit"].is_a?(TrueClass)
306
+ _snapit = e[STEP_KEY]["snapit"]
307
+ end
308
+
309
+ end
310
+
311
+ rescue => ex
312
+ Scoutui::Logger::LogMgr.instance.warn "Error during processing: #{ex}"
313
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
301
314
  end
315
+
302
316
  _snapit
303
317
  end
304
318
 
@@ -426,23 +440,28 @@ module Scoutui::Base
426
440
  elsif _a.match(/^\s*(focused\.[Tt]ext\((.*)\))\s*$/)
427
441
 
428
442
  _targetTxt = _a.match(/^\s*(focused.[Tt]ext\((.*)\))\s*$/)[2].to_s
443
+ _activeElt=nil
429
444
 
430
- _activeElt = my_driver.switch_to.active_element
445
+ _bm=Benchmark.measure {
446
+ _activeElt = my_driver.switch_to.active_element
447
+
448
+ if !_activeElt.nil?
449
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " target.text : |#{_targetTxt}|"
450
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " activeElt.text : |#{_activeElt.text.to_s}|"
431
451
 
432
- if !_activeElt.nil?
433
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " target.text : |#{_targetTxt}|"
434
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " activeElt.text : |#{_activeElt.text.to_s}|"
452
+ if _activeElt.attribute('value')
453
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " activeElt.value : |#{_activeElt.attribute('value').to_s}|"
454
+ end
435
455
 
436
- if _activeElt.attribute('value')
437
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " activeElt.value : |#{_activeElt.attribute('value').to_s}|"
456
+ _rc=!(_activeElt.text.to_s.match(/#{_targetTxt}/).nil?)
457
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " FocusedText : #{_activeElt.text} => #{_rc}"
438
458
  end
459
+ }
439
460
 
440
- _rc=!(_activeElt.text.to_s.match(/#{_targetTxt}/).nil?)
441
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " FocusedText : #{_activeElt.text} => #{_rc}"
461
+ if _activeElt.is_a?(Selenium::WebDriver::Element)
462
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ASSERT: focusTxt: #{_targetTxt} vs #{_activeElt.text} => #{_rc}"
442
463
  end
443
464
 
444
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " ASSERT: focusTxt: #{_targetTxt} vs #{_activeElt.text} => #{_rc}"
445
-
446
465
  elsif _a.match(/^\s*(req|requirement)\s*\((.*)\)\s*$/i)
447
466
 
448
467
  _reqID=_a.match(/^\s*(req|requirement)\s*\((.*)\)\s*$/i)[2].to_s
@@ -962,10 +981,14 @@ module Scoutui::Base
962
981
  _testcase = e[STEP_KEY]["testcase"]
963
982
  _execute_when = e[STEP_KEY]["execute_when"]
964
983
  _use_frames = e[STEP_KEY]["frames"]
984
+ _snapit = e[STEP_KEY]["snapit"]
985
+
965
986
 
966
987
 
967
988
  Scoutui::Commands::Utils.instance.reset(e)
968
989
 
990
+ puts __FILE__ + (__LINE__).to_s + " page => #{e}"
991
+
969
992
  if e[STEP_KEY].has_key?("timeout")
970
993
  Scoutui::Commands::Utils.instance.setTimeout(e[STEP_KEY]["timeout"])
971
994
  end
@@ -975,6 +998,7 @@ module Scoutui::Base
975
998
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " name: #{_name}"
976
999
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " url : #{_url}"
977
1000
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " skip: #{_skip}"
1001
+ Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " snapit: #{_snapit}"
978
1002
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " region: #{_region}"
979
1003
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + " reqid: #{_reqid}"
980
1004
  end
@@ -1429,6 +1453,11 @@ module Scoutui::Base
1429
1453
 
1430
1454
  rescue => ex
1431
1455
  "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
1456
+
1457
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " abort processing."
1458
+ Scoutui::Logger::LogMgr.instance.warn "Error during processing: #{ex}"
1459
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + "Backtrace:\n\t#{ex.backtrace.join("\n\t")}"
1460
+
1432
1461
  end
1433
1462
 
1434
1463
  next
@@ -94,6 +94,10 @@ module Scoutui::Commands
94
94
  if untilList.is_a?(Array) && untilList.size==1 && untilList[0]==true
95
95
  _expected=false
96
96
  _alwaystrue=true
97
+ elsif untilList.is_a?(Array) && untilList.size==1 && untilList[0]==false
98
+ _loop=false
99
+ _bUntil=true
100
+ _alwaystrue=true
97
101
  else
98
102
  _expected=Scoutui::Base::VisualTestFramework::processAsserts(@drv, untilList, false)
99
103
  end
@@ -154,11 +154,12 @@ module Scoutui::Commands
154
154
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " clicked(#{_locator}): #{_clicked}"
155
155
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " o isWebDriverElement : #{obj.is_a?(Selenium::WebDriver::Element)}"
156
156
 
157
- isEnabled = obj.enabled? if obj.is_a?(Selenium::WebDriver::Element)
157
+ # isEnabled = obj.enabled? if obj.is_a?(Selenium::WebDriver::Element)
158
158
 
159
159
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " o enabled : #{isEnabled}"
160
160
 
161
- if obj.is_a?(Selenium::WebDriver::Element) && !obj.enabled?
161
+ # if obj.is_a?(Selenium::WebDriver::Element) && !obj.enabled?
162
+ if !isEnabled.nil? && !isEnabled
162
163
  Scoutui::Logger::LogMgr.instance.info __FILE__ + (__LINE__).to_s + "o Attemping to click a disabled element : #{_locator}"
163
164
  end
164
165
 
@@ -1,3 +1,3 @@
1
1
  module Scoutui
2
- VERSION = "2.0.3.56.pre"
2
+ VERSION = "2.0.3.57.pre"
3
3
  end
data/scoutui.gemspec CHANGED
@@ -25,8 +25,9 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "bundler"
26
26
  spec.add_development_dependency "rake"
27
27
  spec.add_development_dependency "rspec"
28
+ spec.add_development_dependency "nokogiri", "1.6.7.2"
28
29
  spec.add_development_dependency "eyes_selenium", ">= 2.33"
29
- spec.add_development_dependency "selenium-webdriver", ">= 2.53.4"
30
+ spec.add_development_dependency "selenium-webdriver", "2.53.4"
30
31
  spec.add_development_dependency "httparty", ">=0.13.7"
31
32
  spec.add_development_dependency "json", ">= 1.8.3"
32
33
  spec.add_development_dependency "faker"
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.56.pre
4
+ version: 2.0.3.57.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-12-02 00:00:00.000000000 Z
11
+ date: 2016-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: nokogiri
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.6.7.2
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 1.6.7.2
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: eyes_selenium
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -70,14 +84,14 @@ dependencies:
70
84
  name: selenium-webdriver
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - ">="
87
+ - - '='
74
88
  - !ruby/object:Gem::Version
75
89
  version: 2.53.4
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - ">="
94
+ - - '='
81
95
  - !ruby/object:Gem::Version
82
96
  version: 2.53.4
83
97
  - !ruby/object:Gem::Dependency
@@ -223,25 +237,15 @@ files:
223
237
  - README.md
224
238
  - Rakefile
225
239
  - bin/console
240
+ - bin/scoutui_driver
226
241
  - bin/scoutui_driver.rb
227
242
  - bin/setup
228
243
  - examples/benchmark/ex.rb
229
- - examples/benchmark/ex_benchmark.rb
230
244
  - examples/capabilities/win10.chrome46.json
231
- - examples/carmax/appmodel/main.nav.json
232
245
  - examples/carmax/appmodel/search_results.json
233
246
  - examples/carmax/commands/commands.yml
234
- - examples/carmax/tests/test-carmax.sh
235
- - examples/ci_reporter/ci_example.rb
236
- - examples/cmdshell/commands/cmd.yml
237
- - examples/cmdshell/commands/hello.sh
238
247
  - examples/cmdshell/commands/hello.yml
239
248
  - examples/converters/jsonupdate.rb
240
- - examples/converters/jsony.rb
241
- - examples/data_driven/data/queries.yml
242
- - examples/data_driven/data/requirements.yml
243
- - examples/db/sqlclient.rb
244
- - examples/enums/my_enum.rb
245
249
  - examples/ex1/commands.holidays.yml
246
250
  - examples/ex1/commands.yml
247
251
  - examples/ex1/test-example.sh
@@ -272,17 +276,6 @@ files:
272
276
  - examples/ex2/tests/test-example2.sh
273
277
  - examples/ex2/tests/test-example3.sauce.sh
274
278
  - examples/ex2/tests/test-example3.sh
275
- - examples/ex6/appmodel/model.json
276
- - examples/ex6/tests/test.sh
277
- - examples/eyes/diff.rb
278
- - examples/eyes/ex1.spec.rb
279
- - examples/eyes/ex2.rb
280
- - examples/eyes_results/response.json
281
- - examples/screenshot/fullshot.rb
282
- - examples/shell/run_shell.rb
283
- - examples/shell/runit.sh
284
- - examples/yaml/dut.yml
285
- - examples/yaml/ex_yaml.rb
286
279
  - lib/scoutui.rb
287
280
  - lib/scoutui/appmodel/q_model.rb
288
281
  - lib/scoutui/base/assertions.rb
@@ -1,16 +0,0 @@
1
-
2
-
3
- require 'benchmark'
4
-
5
-
6
-
7
- x=Benchmark.measure { "a"*1_000_000_000 }
8
-
9
-
10
- x=Benchmark.measure { sleep 1 }
11
-
12
- puts x.class.to_s
13
-
14
- puts x
15
-
16
- puts x.real
@@ -1,48 +0,0 @@
1
- {
2
-
3
-
4
- "main": {
5
-
6
-
7
- "nav": {
8
-
9
- "home": {
10
- "locator": "css=.page-header--logo",
11
- "visible_when": "always"
12
- },
13
-
14
-
15
- "findYourCar": {
16
- "locator": "//a[text()='Find Your Car']",
17
- "visible_when": "always"
18
- },
19
-
20
- "basic_search": {
21
- "locator": "//nav//a[@href='/search']",
22
- "visible_when": "always"
23
- }
24
-
25
-
26
-
27
- }
28
-
29
-
30
-
31
- },
32
-
33
-
34
- "basic_search": {
35
- "free_text": {
36
- "locator": "//input[@name='FreeText']",
37
- "visible_when": "always"
38
- },
39
-
40
- "go": {
41
- "locator": "//button[text()='Go']",
42
- "visible_when": "always"
43
- }
44
- }
45
-
46
-
47
-
48
- }
@@ -1,104 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
-
4
- ##
5
- # Pre-req - Sauce Connect is running
6
- ##
7
-
8
- setup()
9
- {
10
- HOST="https://www.carmax.com"
11
- CAPS="--capabilities ../../common/capabilities/win10.chrome50.json"
12
- CAPS="--capabilities ../capabilities/win10.ff46.json"
13
- # CAPS=
14
- # CAPS="--sauce:browser chrome --sauce:platform \"Windows 10\" --sauce:version 46.0 --sauce:resolution 1024x768"
15
-
16
- USER_ID="terrybrown@commasavvy.com"
17
- PASSWORD="password1"
18
- TESTCFG=../testconfig/test.config.json
19
-
20
-
21
- TITLE="CARMAX"
22
- VIEWPORT="1024x768"
23
-
24
- MODEL="../appmodel/main.nav.json,../appmodel/search_results.json"
25
-
26
- EYES="--eyes --app ${TITLE} --title ${TITLE} --match layout2"
27
- EYES=
28
-
29
- SAUCE="--sauce --sauce_name ${TITLE}"
30
- # SAUCE="--browser chrome"
31
-
32
- CMD="../commands/commands.yml"
33
- CMD="../commands/basic_search.yml"
34
-
35
- CMD="../commands/home.commands.yml"
36
-
37
- }
38
-
39
-
40
-
41
- run1()
42
- {
43
-
44
- EYES=
45
- EYES="--eyes --app ${TITLE}.1280 --title ${TITLE} --match layout2"
46
- VIEWPORT="--viewport 1024x670"
47
- # VIEWPORT="--viewport 1024x722"
48
- VIEWPORT=
49
- # --sauce:platform "Windows 10" --sauce:build SmokeEx --sauce:name Smokes --sauce:browsername "MicrosoftEdge" --sauce:browser "MS Edge 13.10586" --sauce:version "13.10586" --sauce:resolution "1280x1024" \
50
-
51
- ruby $SCOUTUI_BIN \
52
- --config ${TESTCFG} \
53
- --user "expense.admin@scoutui.com" --password password1 \
54
- ${EYES} ${VIEWPORT} \
55
- --diff /tmp/vt \
56
- --eyes:run true \
57
- --eyes:viewport 1024x670 \
58
- --eyes:app "CarMaxTestApp" \
59
- --eyes:title "CarMaxTitle" \
60
- --sauce:run false \
61
- --sauce:platform "Windows 10" \
62
- --sauce:build SmokeEx \
63
- --sauce:name Smokes \
64
- --sauce:browser "chrome" \
65
- --sauce:version "beta" \
66
- --sauce:resolution "1280x1024" \
67
- --host ${HOST} \
68
- --pages ${MODEL} \
69
- --debug \
70
- --dut "${CMD}"
71
-
72
- }
73
-
74
- run2()
75
- {
76
-
77
- CAPS="--capabilities ../capabilities/win10.ff46.json"
78
-
79
- ruby $SCOUTUI_BIN \
80
- --config ${TESTCFG} \
81
- --user "expense.admin@scoutui.com" --password password1 \
82
- ${EYES} \
83
- --diff /tmp/vt \
84
- --viewport ${VIEWPORT} \
85
- ${SAUCE} \
86
- ${CAPS} \
87
- --sauce:platform PETER.0 \
88
- --host ${HOST} \
89
- --pages ${MODEL} \
90
- --debug \
91
- --dut "${CMD}"
92
-
93
- }
94
-
95
- # --sauce:browser chrome --sauce:platform "Windows 10" \
96
-
97
- setup
98
-
99
- mkdir -p /tmp/vt
100
- run1
101
-
102
-
103
-
104
-
@@ -1,46 +0,0 @@
1
- require 'nokogiri'
2
- # http://stackoverflow.com/questions/10300095/how-to-add-child-nodes-in-nodeset-using-nokogiri
3
-
4
- def addSkipped(node, doc)
5
- skipped = Nokogiri::XML::Node.new('skipped', doc)
6
- node.add_child skipped
7
- end
8
-
9
- xml=Nokogiri::XML::Builder.new
10
-
11
-
12
-
13
- doc = Nokogiri::XML("<testsuites></testsuites>")
14
-
15
- xml.testsuites=doc
16
-
17
- ## Add a node
18
- ts = Nokogiri::XML::Node.new('testcase', doc)
19
-
20
- #ts.content='pass'
21
- ts.set_attribute('name', 'my testcase')
22
- ts.set_attribute('classname', 'scoutui.assert')
23
- ts.set_attribute('time', 29)
24
-
25
- #skipped = Nokogiri::XML::Node.new('skipped', doc)
26
- #ts.add_child skipped
27
- addSkipped(ts, doc)
28
- doc.root.add_child ts
29
-
30
-
31
- node_set = Nokogiri::XML::NodeSet.new(doc)
32
-
33
-
34
- sys_out = Nokogiri::XML::Node.new('system-out', doc)
35
- sys_out.content='my STDOUT dump'
36
- doc.root.add_child(sys_out)
37
-
38
- sys_err = Nokogiri::XML::Node.new('system-err', doc)
39
- sys_err.content='my STDERR dump'
40
- doc.root.add_child(sys_err)
41
-
42
- puts doc.to_s
43
-
44
- puts '-' * 72
45
- puts xml.to_xml
46
-
@@ -1,92 +0,0 @@
1
- page:
2
- name: Define ls command
3
- description: Define a command and assign it an identifier
4
- action: defineCommand
5
- id: LS
6
- commands: "/tmp/hello.sh"
7
- ---
8
- page:
9
- name: Exeucte a defined command
10
- description: Execute a command(s) by referencing its id.
11
- comment: yml[n]['page']['commands'][n]['id']
12
- action: executeCommands
13
- commands:
14
- - id: LS
15
- asserts:
16
- - /Peter/
17
- - /ScoutUI
18
- ---
19
- page:
20
- name: GetExit
21
- description: GetExit
22
- action: getExitStatus
23
- id: LS
24
- ---
25
- page:
26
- name: Retrieve results for LS
27
- getResults:
28
- id: LS
29
- ---
30
- page:
31
- name: Extract specific values from results
32
- getResults:
33
- id: LS
34
- capture: /(World)/
35
- assignto: myHit
36
- ---
37
- page:
38
- name: Type
39
- action: type(//*[@id='uh-search-box'], ${myHit})
40
- ---
41
- page:
42
- name: Pause after LS
43
- action: pause
44
- skip: false
45
- ---
46
- page:
47
- name: Load command with action
48
- action: defineCommand
49
- id: findTmp
50
- commands: whoami
51
- ---
52
- page:
53
- name: Define command with multiple cmds
54
- action: defineCommand
55
- id: MultiLs
56
- commands:
57
- - ls
58
- - echo "ScoutUI"
59
- ---
60
- page:
61
- name: Execute cmd with multple commands
62
- command:
63
- id: MultiLs
64
- ---
65
- page:
66
- name: Retrieve results
67
- getResults:
68
- id: MultiLs
69
- ---
70
- page:
71
- name: Execute
72
- command:
73
- id: findTmp
74
- ---
75
- page:
76
- name: Retrieve findTmp
77
- getResults:
78
- id: findTmp
79
- ---
80
- page:
81
- name: Pause after findTmp
82
- action: pause
83
- skip: false
84
- ---
85
- page:
86
- name: Retrieve
87
- getResults:
88
- id: LS
89
- ---
90
- page:
91
- action: pause
92
- skip: false
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- ToWhom=$1
4
-
5
- echo "HELLO ${ToWhom}" > /tmp/sayhello.out
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'yaml'
4
- require 'json'
5
- require 'optparse'
6
- require 'ostruct'
7
- require 'fileutils'
8
-
9
- #quit unless our script gets two command line arguments
10
- unless ARGV.length == 3
11
- puts "Dude, not the right number of arguments."
12
- puts "Usage: ruby YJ_Convert.rb [-j][-y] json_file.json yaml_file.yaml\n"
13
- exit
14
- end
15
-
16
- $json_file = ARGV[1]
17
- $yaml_file = ARGV[2]
18
-
19
- options = OpenStruct.new
20
- OptionParser.new do |opt|
21
- opt.on('-j', '--json', 'Convert to JSON') { |o| options.json = o }
22
- opt.on('-y', '--yaml', 'Convert to YAML') { |o| options.yaml = o }
23
- end.parse!
24
-
25
- case
26
- when options.yaml == true
27
- y_file = File.open("#{$yaml_file}", 'a')
28
- y_file.write(YAML.dump(JSON.parse(IO.read($json_file))))
29
- y_file.close
30
- puts "Converted to YAML. Output file is #{$yaml_file}"
31
-
32
- when options.json == true
33
- j_file = YAML.load_file(File.open("#{$yaml_file}", 'r'))
34
- File.write "#{$json_file}", JSON.pretty_generate(j_file)
35
- puts "Converted to JSON. Output file is #{$json_file}"
36
- end
@@ -1,10 +0,0 @@
1
- CT_Jobs_Run:
2
- name: CTE Query I
3
- description: SQL Query used for Invoice
4
- query1: use p0170036ou8o_000 select JR_KEY, JD_KEY, STATUS_CODE FROM CT_JOB_RUN WHERE START_TIME > '2013-09-17' AND END_TIME < '2013-10-17'
5
- query2: use p0170036ou8o_000 select JR_KEY, JD_KEY, STATUS_CODE FROM CT_JOB_RUN WHERE START_TIME > '2013-09-17' AND END_TIME < '2013-10-17'
6
- ---
7
- CT_All:
8
- name: CTE Query I
9
- description: SQL Query used for Invoice all 2016
10
- query: use p0170036ou8o_000 select JR_KEY, JD_KEY, STATUS_CODE FROM CT_JOB_RUN WHERE START_TIME > '2016-01-01' AND END_TIME < '2016-0817'
@@ -1,8 +0,0 @@
1
- requirement:
2
- name: JIRA-1234
3
- description: GEneral purpose assertions
4
- assertions:
5
- - isTitle(Playground)
6
- - value(//*[@id='userid'])=Elvis
7
- - isValue(//*[@id='userid'])=Elvis
8
- - isValue(frame(elements), //input[@value='male'])=^(female|male)$
@@ -1,39 +0,0 @@
1
-
2
- require 'tiny_tds'
3
- require 'yaml'
4
-
5
- # http://stackoverflow.com/questions/22579000/convert-array-hash-to-yaml-in-ruby-on-rails
6
- def run(q)
7
- begin
8
- client = TinyTds::Client.new username: 'sa', password: '4wg', host: 'rqa3-sql02', port: 2080
9
- rc=nil
10
-
11
- if client.active?
12
- rc=client.execute(q)
13
-
14
- puts "rc : #{rc.class} : #{rc}"
15
-
16
- h={}
17
-
18
- if rc.is_a?(TinyTds::Result)
19
- rc.each_with_index do |row, i|
20
-
21
- h[i]=row
22
-
23
- puts "#{i}. #{row.class} : #{row}"
24
- end
25
- end
26
-
27
- puts h.to_yaml
28
-
29
- end
30
-
31
- rescue => ex
32
- ;
33
- ensure
34
- client.close
35
- end
36
- end
37
-
38
- q="use p0170036ou8o_000 select JR_KEY, JD_KEY, STATUS_CODE FROM CT_JOB_RUN WHERE START_TIME > '2013-09-17' AND END_TIME < '2013-10-17'"
39
- run(q)