Class: LdsVue360

Inherits:
Object
  • Object
show all
Defined in:
lib/TNR360/components/lds_vue360.rb

Instance Method Summary collapse

Constructor Details

#initialize(browser, idNode) ⇒ LdsVue360

constructor



19
20
21
22
23
24
# File 'lib/TNR360/components/lds_vue360.rb', line 19

def initialize(browser, idNode)
  @browser =browser
  @idNode=idNode
  update
  @exists
end

Instance Method Details

#clickObject

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_vue360.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

#closeRootTabObject



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/TNR360/components/lds_vue360.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

#closeTabObject



168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
# File 'lib/TNR360/components/lds_vue360.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

#getElementObject

Getters



201
202
203
# File 'lib/TNR360/components/lds_vue360.rb', line 201

def getElement
  @current_element
end

#getIdScreenObject



205
206
207
# File 'lib/TNR360/components/lds_vue360.rb', line 205

def getIdScreen
  @idScreen
end

#getRootTitleObject



213
214
215
# File 'lib/TNR360/components/lds_vue360.rb', line 213

def getRootTitle
  @rootTitle
end

#getTitleObject



209
210
211
# File 'lib/TNR360/components/lds_vue360.rb', line 209

def getTitle
  @title
end

#getTypeObject



216
217
218
# File 'lib/TNR360/components/lds_vue360.rb', line 216

def getType
  @type
end

#isExist?Boolean

Returns:

  • (Boolean)


224
225
226
# File 'lib/TNR360/components/lds_vue360.rb', line 224

def isExist?
  @exists
end

#isVisible?Boolean

Returns:

  • (Boolean)


220
221
222
# File 'lib/TNR360/components/lds_vue360.rb', line 220

def isVisible?
  @visible
end

#refreshObject

refresh object status from browser



28
29
30
31
32
33
34
# File 'lib/TNR360/components/lds_vue360.rb', line 28

def refresh
  #Look for element in browser
  @current_element= findElement @idNode
  #update other data
  update
  @exists
end

#to_sObject

print object



131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/TNR360/components/lds_vue360.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