cutedriver-qt-sut-plugin 2.0.0.20210120165900
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/env.rb +24 -0
- data/installer/extconf.rb +62 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin.rb +23 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/action.rb +157 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb +312 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/attribute.rb +300 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/behaviour.rb +214 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/configure_behaviour.rb +317 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_cpu.rb +145 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_gpu.rb +147 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_mem.rb +142 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/cute_pwr.rb +146 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/events.rb +192 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/file_transfer.rb +375 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/find.rb +82 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fixture.rb +214 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/fps.rb +189 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/gesture.rb +1039 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/infologger.rb +767 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/key_press.rb +166 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/locale_db.rb +157 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/method.rb +112 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/multitouch.rb +474 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/os.rb +100 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/qt_api_method.rb +148 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/record.rb +134 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/screen_capture.rb +279 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/settings.rb +302 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/sut.rb +840 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/synchronization.rb +257 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/treewidgetitemcolumn.rb +117 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/type_text.rb +97 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/view_item.rb +97 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/webkit.rb +272 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/widget.rb +877 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/action.rb +30 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/configure_command.rb +38 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/drag.rb +44 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/find_object.rb +67 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/group.rb +44 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/infologger_command.rb +38 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/qt.rb +171 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/tap.rb +54 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/version.rb +34 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/commands/widget.rb +199 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/agent.rb +54 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/application.rb +192 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/configure_command.rb +53 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/find_object.rb +48 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/fixture.rb +65 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/group.rb +57 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/infologger_command.rb +53 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/key_sequence.rb +93 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/screen_capture.rb +53 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/tap.rb +62 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/version.rb +46 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/controllers/widget.rb +98 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/plugin.rb +200 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/adapter.rb +466 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/communication.rb +185 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/sut/controller.rb +69 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/find_object_generator.rb +287 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/fixture_parameter.rb +77 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/message_composer.rb +370 -0
- data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/util/widget.rb +79 -0
- data/lib/testability-driver-qt-sut-plugin.rb +24 -0
- data/xml/behaviour/qt.xml +845 -0
- data/xml/defaults/sut_qt.xml +9 -0
- data/xml/keymap/qt.xml +321 -0
- data/xml/keymap/win.xml +174 -0
- data/xml/template/qt.xml +141 -0
- metadata +127 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ab3a4e6ce7e5a24adf034e3e5acdbafb4e5bfc1bf97390ce0f07c1fc78f05cf8
|
4
|
+
data.tar.gz: 1a97f85ed6011a3929fa4c68805ac838c5a2cc825e2551cc00751920eb2bb581
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ca27a98b6c4afef80c8bfb5f7f3f294d59fa566b90c65bdf4d681655d3e08317e6a24621517735d385e6ee4733e3633770a6a4c396a088f778cdaf7cc2b53184
|
7
|
+
data.tar.gz: d3d3b1aabe7554e95b1bc9b9259ce10eb4e00ecc586082980f57e387e2ebddae932b2de61037e4c96d15d2317e653b6f9675adeef102a0e3f701fbc9d622dd0f
|
data/env.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of TDriver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
|
21
|
+
PLUGIN_NAME = "cuTeDriver Qt SUT plugin"
|
22
|
+
GEM_NAME = 'cutedriver-qt-sut-plugin'
|
23
|
+
GEM_SUMMARY = 'cuTeDriver Interface Qt SUT plugin'
|
24
|
+
PLUGIN_VERSION = "0.8.4"
|
@@ -0,0 +1,62 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of TDriver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
require 'rubygems'
|
23
|
+
|
24
|
+
begin
|
25
|
+
|
26
|
+
require 'tdriver/util/loader'
|
27
|
+
|
28
|
+
rescue LoadError => exception
|
29
|
+
|
30
|
+
raise LoadError, 'SUT plugin requires TDriver'
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
MobyUtil::GemHelper.install( MobyUtil::FileHelper.tdriver_home ){ | tdriver_home_folder |
|
35
|
+
|
36
|
+
[
|
37
|
+
|
38
|
+
# default parameters & sut configuration
|
39
|
+
[ "../xml/defaults/*.xml", "defaults/", true ],
|
40
|
+
|
41
|
+
# parameters
|
42
|
+
[ '../xml/behaviour/*.xml', "behaviours/", true ],
|
43
|
+
[ '../xml/behaviour/*.xml', "default/behaviours/", true ],
|
44
|
+
|
45
|
+
# templates
|
46
|
+
[ "../xml/template/*.xml", "templates/", true ],
|
47
|
+
[ "../xml/template/*.xml", "default/templates/", true ],
|
48
|
+
|
49
|
+
# behaviours
|
50
|
+
[ "../xml/keymap/*.xml", "keymaps/", true ],
|
51
|
+
[ "../xml/keymap/*.xml", "default/keymaps/", true ]
|
52
|
+
|
53
|
+
].each { | task |
|
54
|
+
|
55
|
+
source, destination, overwrite = task
|
56
|
+
|
57
|
+
MobyUtil::FileHelper.copy_file( source, "#{ tdriver_home_folder }/#{ destination }", false, overwrite, true )
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
}
|
62
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of TDriver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
require File.expand_path( File.join( File.dirname( __FILE__ ), 'testability-driver-qt-sut-plugin/plugin.rb' ) )
|
23
|
+
|
@@ -0,0 +1,157 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of TDriver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
module MobyBehaviour
|
21
|
+
|
22
|
+
module QT
|
23
|
+
|
24
|
+
# == description
|
25
|
+
# This module contains behaviours specific to actions
|
26
|
+
#
|
27
|
+
# == behaviour
|
28
|
+
# QtAction
|
29
|
+
#
|
30
|
+
# == requires
|
31
|
+
# testability-driver-qt-sut-plugin
|
32
|
+
#
|
33
|
+
# == input_type
|
34
|
+
# touch
|
35
|
+
#
|
36
|
+
# == sut_type
|
37
|
+
# qt
|
38
|
+
#
|
39
|
+
# == sut_version
|
40
|
+
# *
|
41
|
+
#
|
42
|
+
# == objects
|
43
|
+
# QAction
|
44
|
+
#
|
45
|
+
module Action
|
46
|
+
|
47
|
+
include MobyBehaviour::QT::Behaviour
|
48
|
+
|
49
|
+
# == description
|
50
|
+
# Hover over an action inside a visible widget.\n
|
51
|
+
# \n
|
52
|
+
# Hover is done by determining action's coordinates inside parent widget and moving mouse cursor there.
|
53
|
+
# Therefore, the parent object in script must be a visible widget containing that action.
|
54
|
+
# For example, a menu must be opened first, before actions inside the menu can be hovered.\n
|
55
|
+
# \n
|
56
|
+
# [b]NOTE:[/b] Moving mouse cursor over action's position may not do anything,
|
57
|
+
# unless test application window is topmost, or at least not obscured by other windows.
|
58
|
+
# This can be a problem especially when testing desktop applications on Windows 7.\n
|
59
|
+
# \n
|
60
|
+
# [b]IMPORTANT:[/b] In future this method may be changed to call hover slot of QAction instead of using mouse,
|
61
|
+
# or deprecated and replace by a new method of different name better describing that this uses mouse.
|
62
|
+
#
|
63
|
+
# == arguments
|
64
|
+
# refresh
|
65
|
+
# Boolean
|
66
|
+
# description: Determine is refresh done after trigger command
|
67
|
+
# example: true
|
68
|
+
# default: false
|
69
|
+
#
|
70
|
+
# == returns
|
71
|
+
# NilClass
|
72
|
+
# description: -
|
73
|
+
# example: -
|
74
|
+
#
|
75
|
+
# == exceptions
|
76
|
+
# Exception
|
77
|
+
# description: No special exceptions, may throw any exception
|
78
|
+
def hover( refresh = false )
|
79
|
+
begin
|
80
|
+
|
81
|
+
command = command_params #in qt_behaviour
|
82
|
+
command.object_type( :Action )
|
83
|
+
command.command_name( 'Hover' )
|
84
|
+
command.set_object_id( @parent.id )
|
85
|
+
command.command_params( 'id' => id )
|
86
|
+
|
87
|
+
@sut.execute_command( command )
|
88
|
+
force_refresh(:id => get_application_id) if refresh
|
89
|
+
|
90
|
+
rescue Exception => e
|
91
|
+
|
92
|
+
$logger.behaviour "FAIL;Failed hover with refresh \"#{ refresh.to_s }\".;#{ identity };hover;"
|
93
|
+
raise e
|
94
|
+
|
95
|
+
end
|
96
|
+
|
97
|
+
$logger.behaviour "PASS;Hover operation executed successfully with refresh \"#{ refresh.to_s }\".;#{ identity };hover;"
|
98
|
+
nil
|
99
|
+
end
|
100
|
+
|
101
|
+
# == description
|
102
|
+
# Activate action inside a visible widget.\n
|
103
|
+
# \n
|
104
|
+
# Trigger is done by determining action's coordinates inside parent widget, performing mouse press down and up there.
|
105
|
+
# Therefore, the parent object in script must be a visible widget containing that action.
|
106
|
+
# For example, a menu must be opened first, before actions inside the menu can be triggered.\n
|
107
|
+
# \n
|
108
|
+
# [b]IMPORTANT:[/b] In future this method may be changed to call trigger slot of QAction instead of using mouse,
|
109
|
+
# or deprecated and replace by a differently named method better describing that this uses mouse.
|
110
|
+
#
|
111
|
+
# == arguments
|
112
|
+
# refresh
|
113
|
+
# Boolean
|
114
|
+
# description: Determine is refresh done after trigger command
|
115
|
+
# example: true
|
116
|
+
# default: false
|
117
|
+
#
|
118
|
+
# == returns
|
119
|
+
# NilClass
|
120
|
+
# description: -
|
121
|
+
# example: -
|
122
|
+
#
|
123
|
+
# == exceptions
|
124
|
+
# Exception
|
125
|
+
# description: No special exceptions, may throw any exception
|
126
|
+
def trigger( refresh = false )
|
127
|
+
|
128
|
+
begin
|
129
|
+
command = command_params #in qt_behaviour
|
130
|
+
command.object_type( :Action )
|
131
|
+
command.command_name( 'Trigger' )
|
132
|
+
command.set_object_id( @parent.id )
|
133
|
+
command.command_params( 'id'=>id )
|
134
|
+
|
135
|
+
@sut.execute_command( command )
|
136
|
+
force_refresh(:id => get_application_id) if refresh
|
137
|
+
|
138
|
+
rescue Exception => e
|
139
|
+
|
140
|
+
$logger.behaviour "FAIL;Failed trigger with refresh \"#{ refresh.to_s }\".;#{ identity };trigger;"
|
141
|
+
raise e
|
142
|
+
|
143
|
+
end
|
144
|
+
|
145
|
+
$logger.behaviour "PASS;Trigger operation executed successfully with refresh \"#{ refresh.to_s }\".;#{ identity };trigger;"
|
146
|
+
nil
|
147
|
+
end
|
148
|
+
|
149
|
+
# enable hooking for performance measurement & debug logging
|
150
|
+
TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
|
151
|
+
|
152
|
+
|
153
|
+
end # Action
|
154
|
+
|
155
|
+
end # QT
|
156
|
+
|
157
|
+
end # MobyBehaviour
|
data/lib/testability-driver-plugins/testability-driver-qt-sut-plugin/behaviours/application.rb
ADDED
@@ -0,0 +1,312 @@
|
|
1
|
+
############################################################################
|
2
|
+
##
|
3
|
+
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
## All rights reserved.
|
5
|
+
## Contact: Nokia Corporation (testabilitydriver@nokia.com)
|
6
|
+
##
|
7
|
+
## This file is part of TDriver.
|
8
|
+
##
|
9
|
+
## If you have questions regarding the use of this file, please contact
|
10
|
+
## Nokia at testabilitydriver@nokia.com .
|
11
|
+
##
|
12
|
+
## This library is free software; you can redistribute it and/or
|
13
|
+
## modify it under the terms of the GNU Lesser General Public
|
14
|
+
## License version 2.1 as published by the Free Software Foundation
|
15
|
+
## and appearing in the file LICENSE.LGPL included in the packaging
|
16
|
+
## of this file.
|
17
|
+
##
|
18
|
+
############################################################################
|
19
|
+
|
20
|
+
# why include TDriverVerify here?
|
21
|
+
#include TDriverVerify
|
22
|
+
|
23
|
+
module MobyBehaviour
|
24
|
+
|
25
|
+
module QT
|
26
|
+
|
27
|
+
# == description
|
28
|
+
# Application specific behaviours
|
29
|
+
#
|
30
|
+
# == behaviour
|
31
|
+
# QtApplication
|
32
|
+
#
|
33
|
+
# == requires
|
34
|
+
# testability-driver-qt-sut-plugin
|
35
|
+
#
|
36
|
+
# == input_type
|
37
|
+
# touch
|
38
|
+
#
|
39
|
+
# == sut_type
|
40
|
+
# qt
|
41
|
+
#
|
42
|
+
# == sut_version
|
43
|
+
# *
|
44
|
+
#
|
45
|
+
# == objects
|
46
|
+
# Application
|
47
|
+
#
|
48
|
+
module Application
|
49
|
+
|
50
|
+
@@__multitouch_operation = false
|
51
|
+
|
52
|
+
# == description
|
53
|
+
# Method for getting the status of multitouch operation
|
54
|
+
#
|
55
|
+
# == arguments
|
56
|
+
#
|
57
|
+
#
|
58
|
+
# == returns
|
59
|
+
# Boolean
|
60
|
+
# description: Returns false if multitouch operation is finished
|
61
|
+
# example: true
|
62
|
+
#
|
63
|
+
# == exceptions
|
64
|
+
#
|
65
|
+
#
|
66
|
+
def multitouch_ongoing?
|
67
|
+
|
68
|
+
@@__multitouch_operation
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
# == description
|
73
|
+
# Start to track a popup that may appear on the screen. Tracking is done based on the class name of the
|
74
|
+
# widget implementing popup functionality. Base class name can also be used in case framework level
|
75
|
+
# popup base class is available. The idea of the detection is to track info notes that appear
|
76
|
+
# on the screen for a moment and are therefore difficult to verify manually.
|
77
|
+
#
|
78
|
+
# == arguments
|
79
|
+
# class_name
|
80
|
+
# String
|
81
|
+
# description: Name of the popup implementation class. Base class name can also be used.
|
82
|
+
# example: PopupClass
|
83
|
+
#
|
84
|
+
# wait_time
|
85
|
+
# Integer
|
86
|
+
# description: How long to wait for the popup to appear
|
87
|
+
# example: 5
|
88
|
+
#
|
89
|
+
# == returns
|
90
|
+
# NilClass
|
91
|
+
# description: -
|
92
|
+
# example: -
|
93
|
+
#
|
94
|
+
def track_popup( class_name, wait_time = 1 )
|
95
|
+
|
96
|
+
wait_time = wait_time * 1000
|
97
|
+
|
98
|
+
fixture( 'popup', 'waitPopup',{ :className => class_name, :interval => wait_time.to_s } )
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
# == description
|
103
|
+
# Verify was the popup on the screen or not. The method uses TDriver verify internally for the verification.
|
104
|
+
# If the popup was shown then the entire application ui state is returned as a test object.
|
105
|
+
# More detailed verification can be done for the object (e.g. the content of the popup, labels etc...).
|
106
|
+
# \n
|
107
|
+
# [b]NOTE:[/b] If the popup does not close the verification will fail. Detection is based on grabbing the ui state just before the popup closes.
|
108
|
+
#
|
109
|
+
# == arguments
|
110
|
+
# class_name
|
111
|
+
# String
|
112
|
+
# description: Name of the popup implementation class. Base class name can also be used.
|
113
|
+
# example: PopupClass
|
114
|
+
#
|
115
|
+
# time_out
|
116
|
+
# Integer
|
117
|
+
# description: Time in seconds for how long to wait for the popup data.
|
118
|
+
# example: 5
|
119
|
+
#
|
120
|
+
# == returns
|
121
|
+
# TestObject
|
122
|
+
# description: An ui state test object from the time the popup was detected. Can be used the same way as other test objects.
|
123
|
+
# example: -
|
124
|
+
#
|
125
|
+
def verify_popup( class_name, time_out = 5 )
|
126
|
+
|
127
|
+
response = nil
|
128
|
+
|
129
|
+
verify( time_out ){
|
130
|
+
|
131
|
+
response = @sut.application.fixture( 'popup', 'printPopup', { :className => class_name } )
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
@sut.state_object( response )
|
136
|
+
|
137
|
+
end
|
138
|
+
|
139
|
+
# == description
|
140
|
+
# Taps the given objects at the same time (multitouch).
|
141
|
+
#
|
142
|
+
# == arguments
|
143
|
+
# objects
|
144
|
+
# Array
|
145
|
+
# description: Array of objects to tap.
|
146
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
147
|
+
#
|
148
|
+
# == returns
|
149
|
+
# NilClass
|
150
|
+
# description: -
|
151
|
+
# example: -
|
152
|
+
#
|
153
|
+
# == exceptions
|
154
|
+
# ArgumentError
|
155
|
+
# description: objects is not an array
|
156
|
+
#
|
157
|
+
def tap_objects(objects)
|
158
|
+
|
159
|
+
raise ArgumentError.new("Nothing to tap") unless objects.kind_of?(Array)
|
160
|
+
|
161
|
+
multitouch_operation{
|
162
|
+
objects.each { |o| o.tap }
|
163
|
+
}
|
164
|
+
|
165
|
+
end
|
166
|
+
|
167
|
+
# == description
|
168
|
+
# Taps down the given objects at the same time (multitouch).
|
169
|
+
#
|
170
|
+
# == arguments
|
171
|
+
# objects
|
172
|
+
# Array
|
173
|
+
# description: Array of objects to tap down.
|
174
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
175
|
+
#
|
176
|
+
# == returns
|
177
|
+
# NilClass
|
178
|
+
# description: -
|
179
|
+
# example: -
|
180
|
+
#
|
181
|
+
# == exceptions
|
182
|
+
# ArgumentError
|
183
|
+
# description: objects is not an array
|
184
|
+
#
|
185
|
+
def tap_down_objects(objects)
|
186
|
+
|
187
|
+
raise ArgumentError, 'Nothing to tap' unless objects.kind_of?( Array )
|
188
|
+
|
189
|
+
multitouch_operation{
|
190
|
+
objects.each { |o| o.tap_down }
|
191
|
+
}
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
|
196
|
+
# == description
|
197
|
+
# Taps up the given objects at the same time (multitouch).
|
198
|
+
#
|
199
|
+
# == arguments
|
200
|
+
# objects
|
201
|
+
# Array
|
202
|
+
# description: Array of objects to tap up.
|
203
|
+
# example: [@app.Square( :name => 'topLeft' ), @app.Square( :name => 'topRight' )]
|
204
|
+
#
|
205
|
+
# == returns
|
206
|
+
# NilClass
|
207
|
+
# description: -
|
208
|
+
# example: -
|
209
|
+
#
|
210
|
+
# == exceptions
|
211
|
+
# ArgumentError
|
212
|
+
# description: objects is not an array
|
213
|
+
#
|
214
|
+
def tap_up_objects(objects)
|
215
|
+
|
216
|
+
raise ArgumentError, 'Nothing to tap' unless objects.kind_of?( Array )
|
217
|
+
|
218
|
+
multitouch_operation{
|
219
|
+
objects.each { |o| o.tap_up }
|
220
|
+
}
|
221
|
+
|
222
|
+
end
|
223
|
+
|
224
|
+
# == description
|
225
|
+
# Performs the given operations at the same time (when possible).\n
|
226
|
+
# \n
|
227
|
+
# [b]NOTE:[/b] Only UI behaviours can be used here (e.g. taps, gestures).
|
228
|
+
#
|
229
|
+
# == arguments
|
230
|
+
# &block
|
231
|
+
# Proc
|
232
|
+
# description: code block containing the operations to perform.
|
233
|
+
# example: {@app.ScribbleArea.tap_object(400,50)
|
234
|
+
# @app.ScribbleArea.gesture(:Right, 1, 50)}
|
235
|
+
# == returns
|
236
|
+
# NilClass
|
237
|
+
# description: -
|
238
|
+
# example: -
|
239
|
+
#
|
240
|
+
#
|
241
|
+
def multi_touch(&block)
|
242
|
+
begin
|
243
|
+
@@__multitouch_operation = true
|
244
|
+
multitouch_operation( &block )
|
245
|
+
ensure
|
246
|
+
@@__multitouch_operation = false
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
# == description
|
251
|
+
# Resizes the application window so that width becomes height and vice versa.
|
252
|
+
#
|
253
|
+
# == arguments
|
254
|
+
# direction
|
255
|
+
# Symbol
|
256
|
+
# description: For future support
|
257
|
+
# example: -
|
258
|
+
#
|
259
|
+
# == returns
|
260
|
+
# NilClass
|
261
|
+
# description: -
|
262
|
+
# example: -
|
263
|
+
#
|
264
|
+
def change_orientation( direction = nil )
|
265
|
+
|
266
|
+
fixture('qt','change_orientation')
|
267
|
+
|
268
|
+
end
|
269
|
+
|
270
|
+
private
|
271
|
+
|
272
|
+
def multitouch_operation( &block )
|
273
|
+
|
274
|
+
# make sure the situation is ok before freeze
|
275
|
+
find_object_state = @sut.parameter[ :use_find_object, false ]
|
276
|
+
|
277
|
+
@sut.parameter[ :use_find_object ] = false
|
278
|
+
|
279
|
+
force_refresh
|
280
|
+
|
281
|
+
@sut.freeze
|
282
|
+
|
283
|
+
#disable sleep to avoid unnecessary sleeping
|
284
|
+
@sut.parameter[ :sleep_disabled ] = true
|
285
|
+
|
286
|
+
command = MobyCommand::Group.new( 0, self, block )
|
287
|
+
|
288
|
+
command.set_multitouch( true )
|
289
|
+
|
290
|
+
@sut.execute_command( command )
|
291
|
+
|
292
|
+
@sut.parameter[ :sleep_disabled ] = false
|
293
|
+
|
294
|
+
# sleep the biggest stored value
|
295
|
+
sleep @sut.parameter[ :skipped_sleep_time, 0 ].to_f if @sut.parameter[ :skipped_sleep_time, 0 ].to_f > 0
|
296
|
+
|
297
|
+
# reset values
|
298
|
+
@sut.parameter[ :skipped_sleep_time ] = 0
|
299
|
+
@sut.parameter[ :use_find_object] = find_object_state
|
300
|
+
|
301
|
+
@sut.unfreeze
|
302
|
+
|
303
|
+
end
|
304
|
+
|
305
|
+
# enable hooking for performance measurement & debug logging
|
306
|
+
TDriver::Hooking.hook_methods( self ) if defined?( TDriver::Hooking )
|
307
|
+
|
308
|
+
end # Application
|
309
|
+
|
310
|
+
end # QT
|
311
|
+
|
312
|
+
end # MobyBehaviour
|