Module: MobyBehaviour::QT::Action

Includes:
Behaviour
Defined in:
lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb

Overview

description

This module contains behaviours specific to actions

behaviour

QtAction

requires

testability-driver-qt-sut-plugin

input_type

touch

sut_type

qt

sut_version

*

objects

QAction

Instance Method Summary collapse

Methods included from Behaviour

#command_params

Instance Method Details

#hover(refresh = false) ⇒ Object

b]NOTE:[/b

Moving mouse cursor over action’s position may not do anything,

unless test application window is topmost, or at least not obscured by other windows. This can be a problem especially when testing desktop applications on Windows 7.n n

b]IMPORTANT:[/b

In future this method may be changed to call hover slot of QAction instead of using mouse,

or deprecated and replace by a new method of different name better describing that this uses mouse.

arguments

refresh

Boolean
 description: Determine is refresh done after trigger command
 example: true
 default: false

returns

NilClass

description: -
example: -

exceptions

Exception

description: No special exceptions, may throw any exception


78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb', line 78

def hover( refresh = false )
	begin

		command = command_params #in qt_behaviour
		command.object_type( :Action )
		command.command_name( 'Hover' )
		command.set_object_id( @parent.id )
		command.command_params( 'id' => id )

		@sut.execute_command( command )
		force_refresh(:id => get_application_id) if refresh

	rescue Exception => e

		$logger.behaviour "FAIL;Failed hover with refresh \"#{ refresh.to_s }\".;#{ identity };hover;"
		raise e

	end

	$logger.behaviour "PASS;Hover operation executed successfully with refresh \"#{ refresh.to_s }\".;#{ identity };hover;"
	nil
end

#trigger(refresh = false) ⇒ Object

description

Activate action inside a visible widget.n n Trigger is done by determining action’s coordinates inside parent widget, performing mouse press down and up there. Therefore, the parent object in script must be a visible widget containing that action. For example, a menu must be opened first, before actions inside the menu can be triggered.n n

b]IMPORTANT:[/b

In future this method may be changed to call trigger slot of QAction instead of using mouse,

or deprecated and replace by a differently named method better describing that this uses mouse.

arguments

refresh

Boolean
 description: Determine is refresh done after trigger command
 example: true
 default: false

returns

NilClass

description: -
example: -

exceptions

Exception

description: No special exceptions, may throw any exception


126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb', line 126

def trigger( refresh = false )

	begin
		command = command_params #in qt_behaviour
		command.object_type( :Action )
		command.command_name( 'Trigger' )
		command.set_object_id( @parent.id )
		command.command_params( 'id'=>id )

		@sut.execute_command( command )
		force_refresh(:id => get_application_id) if refresh

	rescue Exception => e

		$logger.behaviour "FAIL;Failed trigger with refresh \"#{ refresh.to_s }\".;#{ identity };trigger;"
		raise e

	end

	$logger.behaviour "PASS;Trigger operation executed successfully with refresh \"#{ refresh.to_s }\".;#{ identity };trigger;"
	nil
end