lib/scoutui/commands/utils.rb in scoutui-2.0.3.1.pre vs lib/scoutui/commands/utils.rb in scoutui-2.0.3.2.pre
- old
+ new
@@ -12,10 +12,11 @@
attr_accessor :hwnds
attr_accessor :useFrameSearch
def initialize
@command_list=['pause',
+ 'assignvar',
'existsAlert',
'clickJsAlert',
'fillform',
'frame',
'submitform',
@@ -45,11 +46,12 @@
setEnableFrameSearch(false)
if stanza.is_a?(Hash) && stanza.has_key?('page') && stanza['page'].has_key?('frames')
puts __FILE__ + (__LINE__).to_s + " frames => #{stanza['page']['frames']}";
- setEnableFrameSearch(!stanza['page']['frames'].to_s.match(/true/i).nil?)
+ setEnableFrameSearch(stanza['page']['frames'])
+# setEnableFrameSearch(!stanza['page']['frames'].to_s.match(/true/i).nil?)
end
end
def resetFrameSearch()
setEnableFrameSearch(false)
@@ -62,17 +64,21 @@
def getFrameSearch()
@userFrameSearch
end
+ def isSwitchFrame?()
+ @userFrameSearch.is_a?(String) && @userFrameSearch.match(/^\s*frame\s*\(/i)
+ end
+
def enableFrameSearch()
Scoutui::Logger::LogMgr.instance.debug "EnableFrameSearch(true)"
setEnableFrameSearch(true)
end
def isFrameSearch?()
- @userFrameSearch
+ @userFrameSearch.is_a?(TrueClass) || (@userFrameSearch.is_a?(String) && @userFrameSearch.match(/true/i))
end
def isCSS(_locator)
rc=nil
@@ -106,10 +112,15 @@
def getTimeout()
@timeout.to_i
end
+
+ def isAssignVar?(_action)
+ !_action.match(/assign\(([\w]+)\s*\,(.*)\)\s*$/i).nil?
+ end
+
def isSelectWindow?(_action)
Scoutui::Logger::LogMgr.instance.debug __FILE__ + (__LINE__).to_s + " isSelectWindow?(#{_action})"
!_action.match(/select_window/i).nil?
end
@@ -169,9 +180,11 @@
rc=true
if isPause?(cmd)
@totalCommands['pause']+=1
+ elsif isAssignVar?(cmd)
+ @totalCommands['assignvar']+=1
elsif isExistsAlert?(cmd)
@totalCommands['existsAlert']+=1
elsif isFrame?(cmd)
@totalCommands['frame']+=1
elsif isGetAlert?(cmd)