scoutui 2.0.3.36.pre → 2.0.3.37.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: 16709b29bd10eddb83a219bde91ab2defc56528a
4
- data.tar.gz: ba91491b649bc492162e4e1d705ced251a12fdce
3
+ metadata.gz: bccb778f6c1b5132a7de7e26c912b36fd7d3b6d6
4
+ data.tar.gz: 0ded00f5a8bb2bbfed6b0d2b3dd8959cd6789e93
5
5
  SHA512:
6
- metadata.gz: 4c1e08dbcc6b0b288bbdd2b3c755ef659fb9b9f0d136a7a3eb7dddec3de27910d5bf830e5e041b6c40bca840cb65490d659d653cfc35c785f49f67c8b93e0da2
7
- data.tar.gz: 2b78ef3c738b8d9b0cfe7a76c6122effbf09ecc709ab30281c59ae0b867a3668993a1944addbe6e2698a15e39f9ad6bc4019d724de9e51c06ab67b951eca24b8
6
+ metadata.gz: fa4668a15b157811671450760732138a2d4aa6293ad90dbf4cc85794c2bd57635300a9eaa5102677cf5a32e3d22f5a6b3af2c5e878fda2bc3831bfbdf8b05e37
7
+ data.tar.gz: 814bacecda4afc188f2d656376a40827c9dd65f90f9ca952b957a11165bb00bbf01b9a70130d732ea10c801387ab7cf5f63a850446d04467297cc980ad23f904
@@ -0,0 +1,8 @@
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)$
@@ -51,7 +51,35 @@ module Scoutui::Base
51
51
  @globals[:host].to_s
52
52
  end
53
53
 
54
+ def isTestReport?(_val)
55
+ # _val.match(/^\s*TestData\(.*\)\.getReport\(.*\)\s*$/)
56
+ _val.match(/^\s*TestData\(.*?\)\.getReport\(.*?\)((\.get\(.*?\))*)\s*$/)
57
+ end
58
+
59
+ def getTestReportGetter(_val)
60
+ _m = isTestReport?(_val)
61
+ if _m
62
+ return _m[1]
63
+ end
64
+
65
+ nil
66
+ end
67
+
68
+ def isTestData?(_val)
69
+ _val.match(/^\s*TestData\(.*\)\.getData\(.*\)\s*$/)
70
+ end
71
+
72
+
54
73
  def normalize(s)
74
+
75
+ if isTestData?(s)
76
+
77
+ _dataID=s.match(/^\s*TestData\((.*)\)\.getData\(.*\)\s*$/)[1].to_s
78
+ _getter=s.match(/^\s*TestData\((.*)\)\.(getData\(.*\))\s*$/)[2].to_s
79
+
80
+ return Scoutui::Base::TestData.instance.get(_dataID, _getter)
81
+ end
82
+
55
83
  _vars = s.scan(/(\$\{.*?\})/)
56
84
  _vars.each do | _v|
57
85
  if _v.length==1
@@ -29,16 +29,44 @@ module Scoutui::Commands
29
29
 
30
30
  _val = _condition
31
31
 
32
- if _val.match(/^\s*TestData\(.*\)\.getData\(.*\)\s*$/)
32
+ if Scoutui::Base::UserVars.instance.isTestData?(_val)
33
+ _v2=Scoutui::Base::UserVars.instance.normalize(_val)
34
+ _condition=_v2
35
+ elsif Scoutui::Base::UserVars.instance.isTestReport?(_val)
36
+ _connectID = _val.match(/^\s*TestData\((.*?)\)\.getReport\(.*?\)\s*$/)[1].to_s
37
+ _reportName = _val.match(/^\s*TestData\((.*?)\)\.getReport\((.*?)\)/)[2].to_s
33
38
 
34
- _dataID=_val.match(/^\s*TestData\((.*)\)\.getData\(.*\)\s*$/)[1].to_s
35
- _getter=_val.match(/^\s*TestData\((.*)\)\.(getData\(.*\))\s*$/)[2].to_s
39
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " connectID : #{_connectID}"
40
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " repName : #{_reportName}"
36
41
 
37
- _v2=Scoutui::Base::TestData.instance.get(_dataID, _getter)
42
+ result=DataMgr::DB.instance.getResult(id: _connectID, report: _reportName)
43
+ _getters = Scoutui::Base::UserVars.instance.getTestReportGetter(_val)
38
44
 
39
- puts __FILE__ + (__LINE__).to_s + " getData ==> #{_v2}"
45
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " _getters => #{_getters}"
46
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " result #{result.class} => #{result}"
40
47
 
41
- _condition=_v2
48
+ _hit=result
49
+
50
+ if _getters
51
+ _getters.split(/\.get\(\s*(.*)\s*\)/).each do |p|
52
+
53
+ if !p.empty?
54
+ if p.match(/\d+$/) && _hit.has_key?(p.to_i)
55
+ _hit=_hit[p.to_i]
56
+ elsif _hit.has_key?(p)
57
+ _hit=_hit[_p]
58
+ else
59
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " key #{p} doesn't exist."
60
+ end
61
+ end
62
+ end
63
+ end
64
+
65
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Retrive.DB.Results(#{_connectID}.#{_reportName} => #{result}"
66
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " _getters : #{_getters}"
67
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " HIT : #{_hit}"
68
+
69
+ _condition=_hit.to_s
42
70
  end
43
71
 
44
72
  Scoutui::Base::UserVars.instance.setVar(_uservar, Scoutui::Commands::Utils.instance.expandMacro(_condition))
@@ -76,7 +76,7 @@ module Scoutui::Commands
76
76
  true if obj.displayed?
77
77
  }
78
78
  rescue Selenium::WebDriver::Error::TimeOutError => ex
79
- Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Timeout waiting for display?: #{_xpath}"
79
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " Timeout waiting for display?: #{_locator}"
80
80
  end
81
81
 
82
82
 
@@ -32,34 +32,24 @@ module Scoutui::Commands
32
32
  Testmgr::TestReport.instance.getReq('DB').testcase('DB').add(isConnected, "Verify connected to DB #{e['page']['to'].to_s}")
33
33
  end
34
34
 
35
- puts __FILE__ + (__LINE__).to_s + " isConnected : #{isConnected}"
35
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " isConnected : #{isConnected}"
36
36
 
37
37
  _val = hasQuery(e)
38
38
  if isConnected && !_val.nil?
39
39
 
40
40
  _q=_val.to_s
41
- _v2=nil
42
-
43
- if _val.match(/^\s*TestData\(.*\)\.getData\(.*\)\s*$/)
44
-
45
- _dataID=_val.match(/^\s*TestData\((.*)\)\.getData\(.*\)\s*$/)[1].to_s
46
- _getter=_val.match(/^\s*TestData\((.*)\)\.(getData\(.*\))\s*$/)[2].to_s
47
-
48
- _v2=Scoutui::Base::TestData.instance.get(_dataID, _getter)
49
- else
50
- _v2=Scoutui::Base::TestData.instance.normalize(_val)
51
- end
41
+ _v2=Scoutui::Base::UserVars.instance.normalize(_val)
52
42
 
53
43
  if !_v2.nil?
54
- puts __FILE__ + (__LINE__).to_s + " getData ==> #{_v2}"
44
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " getData ==> #{_v2}"
55
45
 
56
- DataMgr::DB.instance.run(id: e['page']['to'], query: _v2, report: 'ReportI')
57
-
58
- result=DataMgr::DB.instance.getResult(id: e['page']['to'], report: 'ReportI')
59
- puts "*** RESULT : #{result} ***"
60
- end
46
+ reportName=e['page']['execute']['report'] || 'SCOUTUI'
61
47
 
48
+ DataMgr::DB.instance.run(id: e['page']['to'], query: _v2, report: reportName)
62
49
 
50
+ result=DataMgr::DB.instance.getResult(id: e['page']['to'], report: reportName)
51
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " *** RESULT : #{result.class.to_s} : #{result} ***"
52
+ end
63
53
 
64
54
  end
65
55
 
@@ -114,16 +114,11 @@ module Scoutui::Commands
114
114
  @drv.action.send_keys(:enter).perform
115
115
  else
116
116
 
117
- if _val.match(/^\s*TestData\(.*\)\.getData\(.*\)\s*$/)
117
+ if Scoutui::Base::UserVars.instance.isTestData?(_val)
118
118
 
119
- _dataID=_val.match(/^\s*TestData\((.*)\)\.getData\(.*\)\s*$/)[1].to_s
120
- _getter=_val.match(/^\s*TestData\((.*)\)\.(getData\(.*\))\s*$/)[2].to_s
119
+ _v2=Scoutui::Base::TestData.instance.normalize(_val)
121
120
 
122
- # _v2=_val
123
-
124
- _v2=Scoutui::Base::TestData.instance.get(_dataID, _getter)
125
-
126
- puts __FILE__ + (__LINE__).to_s + " getData ==> #{_v2}"
121
+ Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " getData ==> #{_v2}"
127
122
  else
128
123
 
129
124
  _uservars = _val.scan(/\$\{(.*?)\}/)
@@ -1,3 +1,3 @@
1
1
  module Scoutui
2
- VERSION = "2.0.3.36.pre"
2
+ VERSION = "2.0.3.37.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.36.pre
4
+ version: 2.0.3.37.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-05 00:00:00.000000000 Z
11
+ date: 2016-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -222,6 +222,7 @@ files:
222
222
  - examples/converters/jsonupdate.rb
223
223
  - examples/converters/jsony.rb
224
224
  - examples/data_driven/data/queries.yml
225
+ - examples/data_driven/data/requirements.yml
225
226
  - examples/db/sqlclient.rb
226
227
  - examples/ex1/commands.holidays.yml
227
228
  - examples/ex1/commands.yml