lib/scoutui/commands/utils.rb in scoutui-2.0.3.31.pre vs lib/scoutui/commands/utils.rb in scoutui-2.0.3.32.pre
- old
+ new
@@ -13,22 +13,25 @@
attr_accessor :useFrameSearch
def initialize
@command_list=['pause',
'assignvar',
+ 'assignments',
'existsAlert',
'clickJsAlert',
'fillform',
'frame',
'highlight',
'submitform',
'type',
'click',
+ 'loadrequirements',
'mouseover',
'navigate',
'select',
'select_window',
+ 'uploadfiles',
'verifyelt',
'verifyelement',
'verifyform']
@totalCommands={}
@timeout=30
@@ -130,11 +133,11 @@
_dynamicStr = _v.call(_text_to_type.to_s)
_text_to_type.gsub!(/#{_k.to_s}/, _dynamicStr)
end
end
- puts __FILE__ + (__LINE__).to_s + " Text to type : #{_text_to_type}"
+ puts __FILE__ + (__LINE__).to_s + " expandMacro : #{_text_to_type}"
_text_to_type.to_s
end
@@ -210,10 +213,13 @@
def getTimeout()
@timeout.to_i
end
+ def isAssignments?(_action)
+ !_action.match(/^\s*(assignments)\s*$/).nil?
+ end
def isAssignVar?(_action)
!_action.match(/assign\(([\w]+)\s*\,(.*)\)\s*$/i).nil?
end
@@ -248,10 +254,14 @@
def isFillForm?(_action)
!_action.match(/fillform\(/i).nil?
end
+ def isLoadRequirements?(_action)
+ !_action.match(/^\s*loadrequirements\s*$/i).nil?
+ end
+
def isMouseOver?(_action)
!_action.match(/mouseover\(/).nil?
end
def isType?(_action)
@@ -272,10 +282,14 @@
def isSelect?(_action)
!_action.nil? && _action.match(/^\s*select\s*\(/i)
end
+ def isUploadFiles?(_action)
+ !_action.nil? && _action.match(/^\s*uploadfiles\s*$/i)
+ end
+
def isNavigate?(_action)
!_action.nil? && _action.match(/(navigate|url)\(/i)
end
def isValid?(cmd)
@@ -284,10 +298,12 @@
if isPause?(cmd)
@totalCommands['pause']+=1
elsif isAssignVar?(cmd)
@totalCommands['assignvar']+=1
+ elsif isAssignments?(cmd)
+ @totalCommands['assignments']+=1
elsif isExistsAlert?(cmd)
@totalCommands['existsAlert']+=1
elsif isFrame?(cmd)
@totalCommands['frame']+=1
elsif isGetAlert?(cmd)
@@ -306,15 +322,19 @@
@totalCommands['type']+=1
elsif isClick?(cmd)
@totalCommands['click']+=1
elsif isMouseOver?(cmd)
@totalCommands['mouseover']+=1
+ elsif isLoadRequirements?(cmd)
+ @totalCommands['loadrequirements']+=1
elsif isSelect?(cmd)
@totalCommands['select']+=1
elsif isNavigate?(cmd)
@totalCommands['navigate']+=1
elsif isSelectWindow?(cmd)
@totalCommands['select_window']+=1
+ elsif isUploadFiles?(cmd)
+ @totalCommands['uploadfiles']+=1
else
rc=false
end
rc