Module: MobyBehaviour::QT::Application

Defined in:
lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb

Overview

description

Application specific behaviours

behaviour

QtApplication

requires

testability-driver-qt-sut-plugin

input_type

touch

sut_type

qt

sut_version

*

objects

Application

Constant Summary collapse

@@__multitouch_operation =
false

Instance Method Summary collapse

Instance Method Details

#change_orientation(direction = nil) ⇒ Object

direction

Symbol
 description: For future support
 example: -

returns

NilClass

description: -
example: -


264
265
266
267
268
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb', line 264

def change_orientation( direction = nil )

	fixture('qt','change_orientation')

end

#multi_touch(&block) ⇒ Object

&block

Proc
 description: code block containing the operations to perform.
 example: {@app.ScribbleArea.tap_object(400,50)
           @app.ScribbleArea.gesture(:Right, 1, 50)}

returns

NilClass

description: -
example: -


241
242
243
244
245
246
247
248
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb', line 241

def multi_touch(&block)
   begin 
     @@__multitouch_operation = true
     multitouch_operation( &block )
   ensure
     @@__multitouch_operation = false
   end
end

#multitouch_ongoing?Boolean

exceptions

Returns:

  • (Boolean)


66
67
68
69
70
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb', line 66

def multitouch_ongoing?

  @@__multitouch_operation

end

#tap_down_objects(objects) ⇒ Object

ArgumentError

description: objects is not an array

Raises:

  • (ArgumentError)


185
186
187
188
189
190
191
192
193
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb', line 185

def tap_down_objects(objects)

 raise ArgumentError, 'Nothing to tap' unless objects.kind_of?( Array )

 multitouch_operation{
   objects.each { |o| o.tap_down }
 }
		
end

#tap_objects(objects) ⇒ Object

ArgumentError

description: objects is not an array

Raises:

  • (ArgumentError)


157
158
159
160
161
162
163
164
165
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb', line 157

def tap_objects(objects)

 raise ArgumentError.new("Nothing to tap") unless objects.kind_of?(Array)

 multitouch_operation{
   objects.each { |o| o.tap }
 }
		
end

#tap_up_objects(objects) ⇒ Object

ArgumentError

description: objects is not an array

Raises:

  • (ArgumentError)


214
215
216
217
218
219
220
221
222
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb', line 214

def tap_up_objects(objects)

 raise ArgumentError, 'Nothing to tap' unless objects.kind_of?( Array )

 multitouch_operation{
   objects.each { |o| o.tap_up }
 }
		
end

#track_popup(class_name, wait_time = 1) ⇒ Object

class_name

String
 description: Name of the popup implementation class. Base class name can also be used.
 example: PopupClass

wait_time

Integer
 description: How long to wait for the popup to appear
 example: 5

returns

NilClass

description: -
example: -


94
95
96
97
98
99
100
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb', line 94

def track_popup( class_name, wait_time = 1 )

 wait_time = wait_time * 1000

 fixture( 'popup', 'waitPopup',{ :className => class_name, :interval => wait_time.to_s } )

end

#verify_popup(class_name, time_out = 5) ⇒ Object

class_name

String
 description: Name of the popup implementation class. Base class name can also be used.
 example: PopupClass

time_out

Integer
 description: Time in seconds for how long to wait for the popup data.
 example: 5

returns

TestObject

description: An ui state test object from the time the popup was detected. Can be used the same way as other test objects.
example: -


125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb', line 125

def verify_popup( class_name, time_out = 5 )

   response = nil

   verify( time_out ){

     response = @sut.application.fixture( 'popup', 'printPopup', { :className => class_name } )

   }

   @sut.state_object( response )

end