scoutui 2.0.3.26.pre → 2.0.3.27.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: 7c6783826768bc5977a384aa09b0e27983ad1288
4
- data.tar.gz: 42feaae713b7d18c646bb03ae2a69a2486426868
3
+ metadata.gz: 37b1175369a59e9350230640e61d16c8e4b07157
4
+ data.tar.gz: 61c8e5e6f3881bd7e9ead889462350c9daefee7d
5
5
  SHA512:
6
- metadata.gz: 981d41edbbe8bc9d4b2139653eb30cdbb0b32adebe99962b41fff99cfaa99ba9a5149bd6ff8d12e68205f7c252dbde42cc33c925369cd6cf1ce32312f2f343f7
7
- data.tar.gz: faeb7c953e1eb6cfd5b83d12f2bcc5e12a14cb7749f213e0e31bbb54ee562eaa65c01f5685471a334208b4ce1415124f3662a93ac8c1ce61d27cad66085466bb
6
+ metadata.gz: f4eae3d81fe52c0dca46b80b4cb5fe7fae9327cf0347cf71bffbfd9909942355e7dd07cbf09de1fe19ab60ca044c3c09e60d084004be6b7405ba048fbb6dfecf
7
+ data.tar.gz: 27c90d5181e08d5cb8551ec3c962d26e0b6061a82d2ddf3e6520ef2c9af88af49e8d1d686a39a0ae7a350f687c3a7427d8ad87b602b11e156e923b43e4f44046
@@ -15,6 +15,26 @@ module Scoutui::Base
15
15
  @drv=_drv
16
16
  end
17
17
 
18
+ def isEnabledCmd?(_a)
19
+ _a.is_a?(String) && _a.match(/^\s*[!]*isEnabled\((.*)\)\s*$/i)
20
+ end
21
+
22
+ def isRoleCmd?(_a)
23
+ _a.is_a?(String) && _a.match(/^\s*(isrole|role)\(.*\)\s*/i)
24
+ end
25
+
26
+ def isSelectedCmd?(_a)
27
+ _a.is_a?(String) && _a.match(/^\s*[!]*(isSelected|selected)\((.*)\)\s*$/i)
28
+ end
29
+
30
+ def isValueCmd?(_a)
31
+ _a.is_a?(String) && _a.match(/^\s*(value|text)\s*\(.*\)\s*\=\s*(.*)/i)
32
+ end
33
+
34
+ def isVisibleCmd?(_a)
35
+ _a.is_a?(String) && _a.match(/^\s*[!]*visible\((.*)\)\s*$/i)
36
+ end
37
+
18
38
  def isValue?(my_driver, page_elt)
19
39
 
20
40
  rc = false
@@ -847,35 +847,35 @@ module Scoutui::Base
847
847
  _execute_when.each do |_a|
848
848
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " exeucute_when => #{_a}"
849
849
 
850
- if _a.is_a?(String) && _a.match(/^\s*[!]*isEnabled\((.*)\)\s*$/i)
850
+ if Scoutui::Base::Assertions.instance.isEnabledCmd?(_a)
851
851
  if !Scoutui::Base::Assertions.instance.isEnabled?(my_driver, _a)
852
852
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " isEnabled #{_e} : failed"
853
853
  _executeIt=false
854
854
  end
855
855
 
856
856
 
857
- elsif _a.is_a?(String) && _a.match(/^\s*(isrole|role)\(.*\)\s*/i)
857
+ elsif Scoutui::Base::Assertions.instance.isRoleCmd?(_a)
858
858
 
859
859
  if !Scoutui::Base::Assertions.instance.isRole?(_a)
860
860
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " isRole #{_a} : failed"
861
861
  _executeIt = false
862
862
  end
863
863
 
864
- elsif _a.is_a?(String) && _a.match(/^\s*[!]*visible\((.*)\)\s*$/i)
864
+ elsif Scoutui::Base::Assertions.instance.isVisibleCmd?(_a)
865
865
 
866
866
  if !Scoutui::Base::Assertions.instance.isVisible?(my_driver, _a)
867
867
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " visible #{_a} : failed"
868
868
  _executeIt = false
869
869
  end
870
870
 
871
- elsif _a.is_a?(String) && _a.match(/^\s*[!]*(isSelected|selected)\((.*)\)\s*$/i)
871
+ elsif Scoutui::Base::Assertions.instance.isSelectedCmd?(_a)
872
872
 
873
873
  if !Scoutui::Base::Assertions.instance.isSelected?(my_driver, _a)
874
874
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " isSelected => false"
875
875
  _executeIt=false
876
876
  end
877
877
 
878
- elsif _a.is_a?(String) && _a.match(/(value|text)\s*\(.*\)\s*\=\s*(.*)/i)
878
+ elsif Scoutui::Base::Assertions.instance.isValueCmd?(_a)
879
879
 
880
880
  if !Scoutui::Base::Assertions.instance.isValue?(my_driver, _a)
881
881
  Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " value doesnt match"
@@ -964,13 +964,23 @@ module Scoutui::Base
964
964
  Scoutui::Utils::TestUtils.instance.setState(:abort)
965
965
  return
966
966
  end
967
- Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Command #{_action} was already executed"
967
+ Scoutui::Logger::LogMgr.instance.warn __FILE__ + (__LINE__).to_s + " Command #{_action} was already executed in Strategy"
968
968
  end
969
969
 
970
970
  processExpected(my_driver, e)
971
971
 
972
972
  processAssertions(my_driver, e)
973
973
 
974
+ if e[STEP_KEY].has_key?('saveas')
975
+ # processSaveAs(e)
976
+
977
+ puts __FILE__ + (__LINE__).to_s + " == Process SaveAs =="
978
+ _saveAs = e[STEP_KEY]['saveas']['file'].to_s
979
+ _f=File.open(_saveAs, 'w')
980
+ _f.puts e[STEP_KEY]['saveas']['data'].to_json
981
+ _f.close
982
+ end
983
+
974
984
 
975
985
  if isSnapIt(e)
976
986
 
@@ -92,6 +92,7 @@ module Scoutui::Commands
92
92
  @drv.action.move_to(obj).perform
93
93
 
94
94
  bm=Benchmark.measure { obj.click }
95
+ setBenchmark(bm)
95
96
 
96
97
  _clicked=true
97
98
 
@@ -123,7 +124,7 @@ module Scoutui::Commands
123
124
  Testmgr::TestReport.instance.getReq(_req).testcase('click').add(!obj.nil?, "Verify object to click exists #{_locator} : #{obj.class.to_s}")
124
125
  Testmgr::TestReport.instance.getReq(_req).testcase('click').add(_clicked, "Verify clicked #{_locator}")
125
126
 
126
- setBenchmark(bm)
127
+
127
128
  setResult(_clicked)
128
129
  end
129
130
 
@@ -53,6 +53,10 @@ module Scoutui::Commands
53
53
  @locator
54
54
  end
55
55
 
56
+ def setBenchmark(b)
57
+ @bm=b
58
+ end
59
+
56
60
  def passed?
57
61
  !@executed_result.nil? && @executed_result
58
62
  end
@@ -48,6 +48,15 @@ module Scoutui::Commands
48
48
  '__DATE__' => lambda { Time.now().to_s },
49
49
  '__EMAIL__' => lambda { Faker::Internet.email.to_s},
50
50
  '__DDMMYY__' => lambda { Date.parse(Time.now.to_s).strftime("%d%m%Y") },
51
+ '__MMDDYY__' => lambda { Date.parse(Time.now.to_s).strftime("%m%d%y") },
52
+ '__MMDDYY\+\d+__' => lambda { |s|
53
+ puts __FILE__ + (__LINE__).to_s + " Process s => #{s}"
54
+ d=s.match(/__MMDDYY\+(\d+)__/)[1]
55
+ d=(Date.today + d.to_i).strftime("%m%d%y")
56
+ puts __FILE__ + (__LINE__).to_s + " new date: #{d}"
57
+ d
58
+ },
59
+ '__MMDDYYYY__' => lambda { Date.parse(Time.now.to_s).strftime("%m%d%Y") },
51
60
  '__PARAGRAPH__' => lambda { Faker::Lorem.paragraph.to_s },
52
61
  '__PASSWORD__' => lambda { Faker::Internet.password.to_s },
53
62
  '__PHONENUMBER__' => lambda { Faker::PhoneNumber.phone_number.to_s },
@@ -94,6 +103,9 @@ module Scoutui::Commands
94
103
  if _text_to_type.include?(_k.to_s)
95
104
  _dynamicStr = _v.call.to_s
96
105
  _text_to_type.gsub!(_k.to_s, _dynamicStr)
106
+ elsif _text_to_type.match(/#{_k.to_s}/)
107
+ _dynamicStr = _v.call(_text_to_type.to_s)
108
+ _text_to_type.gsub!(/#{_k.to_s}/, _dynamicStr)
97
109
  end
98
110
  end
99
111
 
@@ -1,3 +1,3 @@
1
1
  module Scoutui
2
- VERSION = "2.0.3.26.pre"
2
+ VERSION = "2.0.3.27.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.26.pre
4
+ version: 2.0.3.27.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-07-18 00:00:00.000000000 Z
11
+ date: 2016-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler