Class: LdsScreen
- Inherits:
-
Object
- Object
- LdsScreen
- Defined in:
- lib/TNR360/components/lds_screen.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#click ⇒ Object
LdsScreen Actions.
- #closeRootTab ⇒ Object
- #closeTab ⇒ Object
-
#getElement ⇒ Object
Getters.
- #getIdScreen ⇒ Object
- #getRootTitle ⇒ Object
- #getTitle ⇒ Object
- #getType ⇒ Object
-
#initialize(browser, idScreen) ⇒ LdsScreen
constructor
constructor.
- #isExist? ⇒ Boolean
- #isVisible? ⇒ Boolean
-
#refresh ⇒ Object
refresh object status from browser.
-
#to_s ⇒ Object
print object.
Constructor Details
Instance Method Details
#click ⇒ Object
LdsScreen Actions
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/TNR360/components/lds_screen.rb', line 146 def click success=false if(@current_element.present? && @current_element.visible?) @current_element.click sleep($small_wait_time) #wait for screen to become visible proc=Proc.new { @current_element.visible? } success=@exists=force_find_element(proc) else if(@parentRootTab!=nil && @parentRootTab.present?) @parentRootTab.click #wait for screen to become visible proc=Proc.new { @current_element.visible? } success=@exists=force_find_element(proc) @current_element.click success=@current_element.visible? end end success end |
#closeRootTab ⇒ Object
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/TNR360/components/lds_screen.rb', line 184 def closeRootTab @current_element.a(:class => 'x-tab-strip-close').click if(!@isRootTab) @parentRootTab.a(:class => 'x-tab-strip-close').click end done=false #make sure screen closed : Trigger Action => any action on it throws a not found error begin update rescue done=true ensure done end end |
#closeTab ⇒ Object
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/TNR360/components/lds_screen.rb', line 168 def closeTab @current_element.a(:class => 'x-tab-strip-close').click if(!@isRootTab) @parentRootTab.a(:class => 'x-tab-strip-close').click end done=false #make sure screen closed : Trigger Action => any action on it throws a not found error begin update rescue done=true ensure done end end |
#getElement ⇒ Object
Getters
201 202 203 |
# File 'lib/TNR360/components/lds_screen.rb', line 201 def getElement @current_element end |
#getIdScreen ⇒ Object
205 206 207 |
# File 'lib/TNR360/components/lds_screen.rb', line 205 def getIdScreen @idScreen end |
#getRootTitle ⇒ Object
213 214 215 |
# File 'lib/TNR360/components/lds_screen.rb', line 213 def getRootTitle @rootTitle end |
#getTitle ⇒ Object
209 210 211 |
# File 'lib/TNR360/components/lds_screen.rb', line 209 def getTitle @title end |
#getType ⇒ Object
216 217 218 |
# File 'lib/TNR360/components/lds_screen.rb', line 216 def getType @type end |
#isExist? ⇒ Boolean
224 225 226 |
# File 'lib/TNR360/components/lds_screen.rb', line 224 def isExist? @exists end |
#isVisible? ⇒ Boolean
220 221 222 |
# File 'lib/TNR360/components/lds_screen.rb', line 220 def isVisible? @visible end |
#refresh ⇒ Object
refresh object status from browser
28 29 30 31 32 33 34 |
# File 'lib/TNR360/components/lds_screen.rb', line 28 def refresh #Look for element in browser @current_element= findElement @idScreen #update other data update @exists end |
#to_s ⇒ Object
print object
131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/TNR360/components/lds_screen.rb', line 131 def to_s "\n***** Screen *****"+ "\nIdScreen : "+ no_null(@idScreen) + "\nTitle : "+ no_null(@title)+ "\nVisible : "+ bool_no_null(@visible.to_s)+ "\nExists : "+ bool_no_null(@exists.to_s)+ "\nType :"+ no_null(@type.to_s)+ "\nIsRootTab : "+ bool_no_null(@isRootTab.to_s)+ "\nRootTitle : "+ ((no_null(@rootTitle.to_s)=='')?(@title.to_s):(@rootTitle.to_s))+ "\nType :"+ no_null(@type.to_s)+ "\n**********" end |