Class: LdsArea
- Inherits:
-
Object
- Object
- LdsArea
- Defined in:
- lib/TNR360/components/lds_area.rb
Instance Method Summary collapse
- #collapse ⇒ Object
- #expand ⇒ Object
-
#findElement(idElement) ⇒ Object
method locate current element.
-
#getElement ⇒ Object
Getters.
- #getIdArea ⇒ Object
- #getParentBloc ⇒ Object
- #getTitle ⇒ Object
-
#initialize(browser, idArea, block = nil) ⇒ LdsArea
constructor
constructor.
- #isCollapsed? ⇒ Boolean
- #isCollapsible? ⇒ Boolean
- #isExist? ⇒ Boolean
- #isVisible? ⇒ Boolean
-
#refresh ⇒ Object
refresh object status from browser.
-
#reverse_collapse ⇒ Object
LdsScreen Actions.
-
#to_s ⇒ Object
print object.
Constructor Details
Instance Method Details
#collapse ⇒ Object
117 118 119 120 121 122 |
# File 'lib/TNR360/components/lds_area.rb', line 117 def collapse if (@collapsible && !@collapsed) @current_element.legend(:index => 0).div(:index => 0).when_present.click end update end |
#expand ⇒ Object
124 125 126 127 128 129 |
# File 'lib/TNR360/components/lds_area.rb', line 124 def if (@collapsible && @collapsed) @current_element.legend(:index => 0).div(:index => 0).when_present.click end update end |
#findElement(idElement) ⇒ Object
method locate current element
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/TNR360/components/lds_area.rb', line 64 def findElement idElement begin #if element not yet available in screen, wait for some time if @parentBlock != nil @parentBlock.getElement.div(:index => 2).fieldset(:id, idElement).wait_until_present(10) @current_element=@parentBlock.getElement.div(:index => 2).fieldset(:id, idElement) end rescue raise "Element "+idElement+" Not Found" ensure #rien dans finally pour ce cas if @parentBlock == nil if @browser.fieldset(:id, idElement).wait_until_present(10) count=@browser.fieldsets(:id, idElement).length end if count==0 raise "Element "+idElement+" Not Found" else if count >1 raise "Several Elements with id "+idElement+" Found, specify block" end end @current_element=@browser.fieldset(:id, idElement).when_present end end @current_element end |
#getElement ⇒ Object
Getters
133 134 135 |
# File 'lib/TNR360/components/lds_area.rb', line 133 def getElement @current_element end |
#getIdArea ⇒ Object
137 138 139 |
# File 'lib/TNR360/components/lds_area.rb', line 137 def getIdArea @idArea end |
#getParentBloc ⇒ Object
141 142 143 |
# File 'lib/TNR360/components/lds_area.rb', line 141 def getParentBloc @parentBlock end |
#getTitle ⇒ Object
145 146 147 |
# File 'lib/TNR360/components/lds_area.rb', line 145 def getTitle @title end |
#isCollapsed? ⇒ Boolean
153 154 155 |
# File 'lib/TNR360/components/lds_area.rb', line 153 def isCollapsed? @collapsed end |
#isCollapsible? ⇒ Boolean
149 150 151 |
# File 'lib/TNR360/components/lds_area.rb', line 149 def isCollapsible? @collapsible end |
#isExist? ⇒ Boolean
161 162 163 |
# File 'lib/TNR360/components/lds_area.rb', line 161 def isExist? @exists end |
#isVisible? ⇒ Boolean
157 158 159 |
# File 'lib/TNR360/components/lds_area.rb', line 157 def isVisible? @visible end |
#refresh ⇒ Object
refresh object status from browser
27 28 29 30 31 32 33 |
# File 'lib/TNR360/components/lds_area.rb', line 27 def refresh #Look for element in browser @current_element= findElement @idArea #update other data update @exists end |
#reverse_collapse ⇒ Object
LdsScreen Actions
110 111 112 113 114 115 |
# File 'lib/TNR360/components/lds_area.rb', line 110 def reverse_collapse if (@collapsible) @current_element.legend(:index => 0).div(:index => 0).when_present.click end update end |
#to_s ⇒ Object
print object
96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/TNR360/components/lds_area.rb', line 96 def to_s "\n***** Area *****"+ "\nIdArea : "+ no_null(@idArea)+ "\nIdParentBlock : "+(no_null(@parentBlock)=="" ? "" : @parentBlock.getIdBlock)+ "\nTitle : "+ no_null(@title)+ "\nCollapsible :"+ bool_no_null(@collapsible.to_s)+ "\nCollapsed :"+ bool_no_null(@collapsed.to_s)+ "\nVisible : "+ bool_no_null(@visible.to_s)+ "\nExists : "+ bool_no_null(@exists.to_s)+ "\n**********" end |