scoutui 2.0.3.1.pre → 2.0.3.2.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/scoutui/base/q_browser.rb +11 -2
- data/lib/scoutui/base/user_vars.rb +24 -0
- data/lib/scoutui/commands/commands.rb +4 -0
- data/lib/scoutui/commands/utils.rb +15 -2
- data/lib/scoutui/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 581f39c253c65fff0b56a14aeba3aadfc08e787a
|
4
|
+
data.tar.gz: 491f1a5fa80b9d7fd09a91ff4f4f226ce4ad99df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7b691217037929862031144decdc1cc042392a6fbb0b84c80bc5659b02c74a381050f35cd9a8eef8885658150cb471012bc68a3f200bde0ab6349a45741652e
|
7
|
+
data.tar.gz: e8b76ed7ddd9fc00004211cd9961e5af3b8406ba1c14d3919b12db93b2f4bd4b35ce8ba72137fad57f4319b2be195dcea12af8482cad394fda978677923c4941
|
data/README.md
CHANGED
@@ -13,6 +13,17 @@ This project is still in beta, but working - the version '1.0.0' will be the fir
|
|
13
13
|
b. Functional Testing
|
14
14
|
|
15
15
|
|
16
|
+
## Development Notes
|
17
|
+
|
18
|
+
1. Adding a new command
|
19
|
+
a. commands/utils.rb
|
20
|
+
- add in '''initialize()'''
|
21
|
+
- create new functon '''is<CMD>'''
|
22
|
+
b. commands/commands.rb
|
23
|
+
- add '''if stmt''' checking for the command
|
24
|
+
- create then call the new command objects' fcn
|
25
|
+
|
26
|
+
|
16
27
|
## Helpful Links
|
17
28
|
YouTube
|
18
29
|
|
@@ -93,7 +93,7 @@ module Scoutui::Base
|
|
93
93
|
|
94
94
|
|
95
95
|
# e : Hash : Command stanza from YML
|
96
|
-
def self.
|
96
|
+
def self.switch_frame(drv, e)
|
97
97
|
if e.is_a?(Hash) && e.has_key?('page') && e['page'].has_key?('frames')
|
98
98
|
puts __FILE__ + (__LINE__).to_s + " frames => #{e['page']['frames']}";
|
99
99
|
|
@@ -117,7 +117,16 @@ module Scoutui::Base
|
|
117
117
|
|
118
118
|
def self.findElement(drv, _locator, _frames, _timeout=nil)
|
119
119
|
|
120
|
-
|
120
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " findElement(#{_locator}, #{Scoutui::Commands::Utils.instance.getFrameSearch})"
|
121
|
+
|
122
|
+
if Scoutui::Commands::Utils.instance.isSwitchFrame?()
|
123
|
+
|
124
|
+
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " FrameSwitch"
|
125
|
+
e={ 'page' => { 'frames' => Scoutui::Commands::Utils.instance.getFrameSearch() } }
|
126
|
+
switch_frame(drv, e)
|
127
|
+
obj = Scoutui::Base::QBrowser.getObject(drv, _locator, _timeout)
|
128
|
+
|
129
|
+
elsif Scoutui::Commands::Utils.instance.isFrameSearch?
|
121
130
|
hits = Scoutui::Base::QBrowser.frame_getObject(drv, _locator, _timeout)
|
122
131
|
|
123
132
|
puts __FILE__ + (__LINE__).to_s + " hits => #{hits.class} : #{hits}"
|
@@ -7,8 +7,10 @@ module Scoutui::Base
|
|
7
7
|
include Singleton
|
8
8
|
|
9
9
|
attr_accessor :globals
|
10
|
+
attr_accessor :userVars
|
10
11
|
|
11
12
|
def initialize
|
13
|
+
@userVars={}
|
12
14
|
@globals={
|
13
15
|
:accounts => '/tmp/qa/accounts.yaml',
|
14
16
|
:browser => 'chrome',
|
@@ -113,6 +115,26 @@ module Scoutui::Base
|
|
113
115
|
v
|
114
116
|
end
|
115
117
|
|
118
|
+
def assignUserVar(_k, _v)
|
119
|
+
@userVars[_k] = _v
|
120
|
+
end
|
121
|
+
|
122
|
+
def getUserVar(_k)
|
123
|
+
rc=nil
|
124
|
+
if @userVars.has_key?(_k)
|
125
|
+
rc=@userVars[_k]
|
126
|
+
end
|
127
|
+
|
128
|
+
rc
|
129
|
+
end
|
130
|
+
|
131
|
+
def removeUserVar(_k)
|
132
|
+
if @userVars.has_key?(_k)
|
133
|
+
@userVars.delete(_k)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
|
116
138
|
def set(k, v)
|
117
139
|
setVar(k, v)
|
118
140
|
v
|
@@ -122,6 +144,8 @@ module Scoutui::Base
|
|
122
144
|
@globals[k].to_s
|
123
145
|
end
|
124
146
|
|
147
|
+
|
148
|
+
|
125
149
|
def setVar(k, v)
|
126
150
|
@globals[k]=v
|
127
151
|
v
|
@@ -45,6 +45,10 @@ module Scoutui::Commands
|
|
45
45
|
_cmd='pause'
|
46
46
|
_c = Scoutui::Commands::Pause.new(nil)
|
47
47
|
_c.execute(e);
|
48
|
+
elsif Scoutui::Commands::Utils.instance.isAssignVar?(_action)
|
49
|
+
_cmd='assignvar'
|
50
|
+
_c = Scoutui::Commands::AssignVar.new(_action)
|
51
|
+
_c.execute(my_driver, e)
|
48
52
|
elsif Scoutui::Commands::Utils.instance.isSelectWindow?(_action)
|
49
53
|
_cmd='SelectWindow'
|
50
54
|
_c = Scoutui::Commands::SelectWindow.new(_action)
|
@@ -14,6 +14,7 @@ module Scoutui::Commands
|
|
14
14
|
|
15
15
|
def initialize
|
16
16
|
@command_list=['pause',
|
17
|
+
'assignvar',
|
17
18
|
'existsAlert',
|
18
19
|
'clickJsAlert',
|
19
20
|
'fillform',
|
@@ -47,7 +48,8 @@ module Scoutui::Commands
|
|
47
48
|
if stanza.is_a?(Hash) && stanza.has_key?('page') && stanza['page'].has_key?('frames')
|
48
49
|
puts __FILE__ + (__LINE__).to_s + " frames => #{stanza['page']['frames']}";
|
49
50
|
|
50
|
-
setEnableFrameSearch(
|
51
|
+
setEnableFrameSearch(stanza['page']['frames'])
|
52
|
+
# setEnableFrameSearch(!stanza['page']['frames'].to_s.match(/true/i).nil?)
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
@@ -64,13 +66,17 @@ module Scoutui::Commands
|
|
64
66
|
@userFrameSearch
|
65
67
|
end
|
66
68
|
|
69
|
+
def isSwitchFrame?()
|
70
|
+
@userFrameSearch.is_a?(String) && @userFrameSearch.match(/^\s*frame\s*\(/i)
|
71
|
+
end
|
72
|
+
|
67
73
|
def enableFrameSearch()
|
68
74
|
Scoutui::Logger::LogMgr.instance.debug "EnableFrameSearch(true)"
|
69
75
|
setEnableFrameSearch(true)
|
70
76
|
end
|
71
77
|
|
72
78
|
def isFrameSearch?()
|
73
|
-
@userFrameSearch
|
79
|
+
@userFrameSearch.is_a?(TrueClass) || (@userFrameSearch.is_a?(String) && @userFrameSearch.match(/true/i))
|
74
80
|
end
|
75
81
|
|
76
82
|
def isCSS(_locator)
|
@@ -108,6 +114,11 @@ module Scoutui::Commands
|
|
108
114
|
@timeout.to_i
|
109
115
|
end
|
110
116
|
|
117
|
+
|
118
|
+
def isAssignVar?(_action)
|
119
|
+
!_action.match(/assign\(([\w]+)\s*\,(.*)\)\s*$/i).nil?
|
120
|
+
end
|
121
|
+
|
111
122
|
def isSelectWindow?(_action)
|
112
123
|
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " isSelectWindow?(#{_action})"
|
113
124
|
!_action.match(/select_window/i).nil?
|
@@ -171,6 +182,8 @@ module Scoutui::Commands
|
|
171
182
|
|
172
183
|
if isPause?(cmd)
|
173
184
|
@totalCommands['pause']+=1
|
185
|
+
elsif isAssignVar?(cmd)
|
186
|
+
@totalCommands['assignvar']+=1
|
174
187
|
elsif isExistsAlert?(cmd)
|
175
188
|
@totalCommands['existsAlert']+=1
|
176
189
|
elsif isFrame?(cmd)
|
data/lib/scoutui/version.rb
CHANGED
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.
|
4
|
+
version: 2.0.3.2.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-
|
12
|
+
date: 2016-05-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|