lebowski 0.3.0 → 0.3.1
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.
- data/History.md +10 -1
- data/License.txt +1 -1
- data/lib/lebowski/foundation/mixins/positioned_element.rb +1 -1
- data/lib/lebowski/foundation/mixins/user_actions.rb +16 -10
- data/lib/lebowski/runtime/sprout_core_extensions.rb +5 -4
- data/lib/lebowski/version.rb +1 -1
- data/resources/user-extensions.js +36 -2
- metadata +5 -5
data/History.md
CHANGED
@@ -1,10 +1,19 @@
|
|
1
|
+
# lebowski 0.3.1 January 23, 2011
|
2
|
+
|
3
|
+
* Fixed mouse down and right mouse down user actions
|
4
|
+
* Fixed double click user action
|
5
|
+
* Fixed mouse event simulation bug. Event's which property now assigned the correct value
|
6
|
+
|
1
7
|
# lebowski 0.3.0 December 6, 2010
|
2
8
|
|
3
9
|
* Updated to now work with Ruby 1.9.2 and RSpec v2
|
4
10
|
* Fixes drag and drop user actions
|
5
11
|
* Fixes clicking on segmented view's buttons
|
6
12
|
* Fixes mouse user actions so that, by default, DOM elements are clicked in the center instead of relative (0, 0)
|
7
|
-
* Fixes RSpec extension That operator's contains? method
|
13
|
+
* Fixes RSpec extension That operator's contains? method
|
14
|
+
* Added user actions mouse_wheel_delta_x and mouse_wheel_delta_y
|
15
|
+
* View proxy now includes scrollable_parent_view method
|
16
|
+
* Updated framework to build gem with Jeweler. Rubyforge and Hoe are no longer used
|
8
17
|
* Note: If creating an instance of the Selenium client driver that you want to pass to Lebowski's
|
9
18
|
MainApplication, you must now supply the client with a timeout value or else you will immediately get a
|
10
19
|
timeout error (e.g. set :timeout_in_seconds => 60)
|
data/License.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2010 Michael Cohen <http://frozencanuck.wordpress.com>
|
1
|
+
Copyright (c) 2010, 2011 Michael Cohen <http://frozencanuck.wordpress.com>
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -27,11 +27,13 @@ module Lebowski
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def mouse_down_at(x, y)
|
30
|
+
scroll_to_visible
|
30
31
|
@driver.sc_mouse_down_at action_target, x, y, *action_locator_args
|
31
32
|
stall :mouse_down
|
32
33
|
end
|
33
34
|
|
34
35
|
def right_mouse_down_at(x, y)
|
36
|
+
scroll_to_visible
|
35
37
|
@driver.sc_right_mouse_down_at action_target, x, y, *action_locator_args
|
36
38
|
stall :right_mouse_down
|
37
39
|
end
|
@@ -47,6 +49,12 @@ module Lebowski
|
|
47
49
|
stall :click
|
48
50
|
end
|
49
51
|
|
52
|
+
def double_click_at(x, y)
|
53
|
+
scroll_to_visible
|
54
|
+
@driver.sc_double_click_at action_target, x, y, *action_locator_args
|
55
|
+
stall :double_click
|
56
|
+
end
|
57
|
+
|
50
58
|
def right_click_at(x, y)
|
51
59
|
right_mouse_down_at x, y
|
52
60
|
right_mouse_up_at x, y
|
@@ -86,6 +94,13 @@ module Lebowski
|
|
86
94
|
right_mouse_up_at :center, :center
|
87
95
|
end
|
88
96
|
|
97
|
+
#
|
98
|
+
# Used to perform a double click on this view in the remote application
|
99
|
+
#
|
100
|
+
def double_click()
|
101
|
+
double_click_at :center, :center
|
102
|
+
end
|
103
|
+
|
89
104
|
#
|
90
105
|
# Used to perform a single click on this view in the remote application
|
91
106
|
#
|
@@ -108,18 +123,11 @@ module Lebowski
|
|
108
123
|
# Used to perform a single basic click on this view in the remote application
|
109
124
|
#
|
110
125
|
def basic_click()
|
126
|
+
scroll_to_visible
|
111
127
|
@driver.sc_basic_click action_target, *action_locator_args
|
112
128
|
stall :click
|
113
129
|
end
|
114
130
|
|
115
|
-
#
|
116
|
-
# Used to perform a double click on this view in the remote application
|
117
|
-
#
|
118
|
-
def double_click()
|
119
|
-
@driver.sc_double_click action_target, *action_locator_args
|
120
|
-
stall :double_click
|
121
|
-
end
|
122
|
-
|
123
131
|
#
|
124
132
|
# Used to perform a mouse wheel action on the x-axis
|
125
133
|
#
|
@@ -223,8 +231,6 @@ module Lebowski
|
|
223
231
|
# and drop user action
|
224
232
|
@driver.sc_disable_all_autoscrolling
|
225
233
|
|
226
|
-
self.scroll_to_visible
|
227
|
-
|
228
234
|
mouse_down_at mouse_offset_x, mouse_offset_y
|
229
235
|
mouse_move_at mouse_offset_x, mouse_offset_y
|
230
236
|
|
@@ -212,6 +212,11 @@ module Lebowski
|
|
212
212
|
__remote_control_command("scMouseUpRightAt", [__locator(type, *params), encoded_params])
|
213
213
|
end
|
214
214
|
|
215
|
+
def sc_double_click_at(type, x, y, *params)
|
216
|
+
encoded_params = ObjectEncoder.encode_hash({ :x => x, :y => y })
|
217
|
+
__remote_control_command("scDoubleClickAt", [__locator(type, *params), encoded_params])
|
218
|
+
end
|
219
|
+
|
215
220
|
def sc_basic_click(type, *params)
|
216
221
|
__remote_control_command("click", [__locator(type, *params), ])
|
217
222
|
end
|
@@ -224,10 +229,6 @@ module Lebowski
|
|
224
229
|
__remote_control_command("scRightClick", [__locator(type, *params), ])
|
225
230
|
end
|
226
231
|
|
227
|
-
def sc_double_click(type, *params)
|
228
|
-
__remote_control_command("scDoubleClick", [__locator(type, *params), ])
|
229
|
-
end
|
230
|
-
|
231
232
|
def sc_mouse_wheel_delta_x(type, delta, *params)
|
232
233
|
__remote_control_command("scMouseWheelDeltaX", [__locator(type, *params), delta])
|
233
234
|
end
|
data/lib/lebowski/version.rb
CHANGED
@@ -351,11 +351,28 @@ ScExt.MouseEventSimulation = {
|
|
351
351
|
var element = selenium.browserbot.findElement(locator),
|
352
352
|
coord = element ? $SC.viewportOffset(element) : { x: 0, y: 0 },
|
353
353
|
width = element ? element.clientWidth : 0,
|
354
|
-
height = element ? element.clientHeight : 0
|
354
|
+
height = element ? element.clientHeight : 0,
|
355
|
+
which = 1;
|
355
356
|
|
356
357
|
x = x ? (x === 'center' ? width / 2 : x) : 0;
|
357
358
|
y = y ? (y === 'center' ? height / 2 : y) : 0;
|
358
359
|
|
360
|
+
if ($SC.browser.msie) {
|
361
|
+
button = button ? button : 1;
|
362
|
+
switch (button) {
|
363
|
+
case 1: which = 1; break;
|
364
|
+
case 4: which = 2; break;
|
365
|
+
case 2: which = 3; break;
|
366
|
+
}
|
367
|
+
} else {
|
368
|
+
button = button ? button : 0;
|
369
|
+
switch (button) {
|
370
|
+
case 0: which = 1; break;
|
371
|
+
case 1: which = 2; break;
|
372
|
+
case 2: which = 3; break;
|
373
|
+
}
|
374
|
+
}
|
375
|
+
|
359
376
|
var coords = element ? $SC.viewportOffset(element) : { x: 0, y: 0 },
|
360
377
|
clientX = coords.x + x,
|
361
378
|
clientY = coords.y + y;
|
@@ -368,7 +385,8 @@ ScExt.MouseEventSimulation = {
|
|
368
385
|
pageX: clientX,
|
369
386
|
pageY: clientY,
|
370
387
|
bubbles: true,
|
371
|
-
button: button
|
388
|
+
button: button,
|
389
|
+
which: which,
|
372
390
|
altKey: selenium.browserbot.altKeyDown,
|
373
391
|
metaKey: selenium.browserbot.metaKeyDown,
|
374
392
|
ctrlKey: selenium.browserbot.controlKeyDown,
|
@@ -1319,6 +1337,22 @@ Selenium.prototype.doScMouseDownRightAt = function(locator, params) {
|
|
1319
1337
|
} catch (e) {}
|
1320
1338
|
};
|
1321
1339
|
|
1340
|
+
/**
|
1341
|
+
Action performs a click at event
|
1342
|
+
*/
|
1343
|
+
Selenium.prototype.doScClickAt = function(locator, params) {
|
1344
|
+
this.doScMouseDownAt(locator, params);
|
1345
|
+
this.doScMouseUpAt(locator, params);
|
1346
|
+
};
|
1347
|
+
|
1348
|
+
/**
|
1349
|
+
Action performs a double click at event
|
1350
|
+
*/
|
1351
|
+
Selenium.prototype.doScDoubleClickAt = function(locator, params) {
|
1352
|
+
this.doScClickAt(locator, params);
|
1353
|
+
this.doScClickAt(locator, params);
|
1354
|
+
};
|
1355
|
+
|
1322
1356
|
/**
|
1323
1357
|
Action performs a single click that is recognized by the SproutCore framework.
|
1324
1358
|
*/
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 1
|
9
|
+
version: 0.3.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Cohen
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-01-23 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -291,7 +291,7 @@ licenses:
|
|
291
291
|
post_install_message: |
|
292
292
|
**************************************************
|
293
293
|
|
294
|
-
Thank you for installing lebowski-0.3.
|
294
|
+
Thank you for installing lebowski-0.3.1
|
295
295
|
|
296
296
|
Please be sure to read the README.md and History.md
|
297
297
|
for useful information on how to use this framework
|
@@ -314,7 +314,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
314
314
|
requirements:
|
315
315
|
- - ">="
|
316
316
|
- !ruby/object:Gem::Version
|
317
|
-
hash:
|
317
|
+
hash: 456298455366827608
|
318
318
|
segments:
|
319
319
|
- 0
|
320
320
|
version: "0"
|