whirlwind 0.1.0

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.
Files changed (77) hide show
  1. data/.autotest +23 -0
  2. data/.gemtest +0 -0
  3. data/History.txt +6 -0
  4. data/Manifest.txt +79 -0
  5. data/README.txt +76 -0
  6. data/Rakefile +15 -0
  7. data/bin/whirlwind +99 -0
  8. data/demo_test_site/demo_site.rb +37 -0
  9. data/demo_test_site/public/images/arrow_left_48.png +0 -0
  10. data/demo_test_site/public/images/arrow_right_48.png +0 -0
  11. data/demo_test_site/public/images/down.gif +0 -0
  12. data/demo_test_site/public/images/header.jpg +0 -0
  13. data/demo_test_site/public/images/menu.gif +0 -0
  14. data/demo_test_site/public/images/menuhover.gif +0 -0
  15. data/demo_test_site/public/javascripts/browser.menu.js +61 -0
  16. data/demo_test_site/public/javascripts/cyberconnect_helpers.js +369 -0
  17. data/demo_test_site/public/javascripts/jquery-1.5.1.min.js +16 -0
  18. data/demo_test_site/public/javascripts/jquery-1.6.2.min.js +18 -0
  19. data/demo_test_site/public/javascripts/jquery-ui-1.8.10.custom.min.js +1370 -0
  20. data/demo_test_site/public/javascripts/jquery.layout.min-1.2.0.js +80 -0
  21. data/demo_test_site/public/javascripts/jqueryslidemenu.css +93 -0
  22. data/demo_test_site/public/javascripts/jqueryslidemenu.js +48 -0
  23. data/demo_test_site/public/javascripts/ui.accordion.js +477 -0
  24. data/demo_test_site/public/jquery.ui.all.css +11 -0
  25. data/demo_test_site/public/jquery.ui.base.css +11 -0
  26. data/demo_test_site/public/jquery.ui.theme.css +252 -0
  27. data/demo_test_site/public/jquery_css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  28. data/demo_test_site/public/jquery_css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  29. data/demo_test_site/public/jquery_css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  30. data/demo_test_site/public/jquery_css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  31. data/demo_test_site/public/jquery_css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  32. data/demo_test_site/public/jquery_css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  33. data/demo_test_site/public/jquery_css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  34. data/demo_test_site/public/jquery_css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  35. data/demo_test_site/public/jquery_css/images/ui-icons_222222_256x240.png +0 -0
  36. data/demo_test_site/public/jquery_css/images/ui-icons_2e83ff_256x240.png +0 -0
  37. data/demo_test_site/public/jquery_css/images/ui-icons_454545_256x240.png +0 -0
  38. data/demo_test_site/public/jquery_css/images/ui-icons_888888_256x240.png +0 -0
  39. data/demo_test_site/public/jquery_css/images/ui-icons_cd0a0a_256x240.png +0 -0
  40. data/demo_test_site/public/jquery_css/jquery-ui-1.8.10.custom.css +573 -0
  41. data/demo_test_site/public/jquery_layout.css +14 -0
  42. data/demo_test_site/public/jqueryslidemenu.css +93 -0
  43. data/demo_test_site/public/menu.css +12 -0
  44. data/demo_test_site/public/style.css +196 -0
  45. data/demo_test_site/views/index.erb +294 -0
  46. data/images/.placeholder +0 -0
  47. data/lib/browser.rb +22 -0
  48. data/lib/cucumber/formatter/cucumber.css +282 -0
  49. data/lib/cucumber/formatter/html_image.rb +750 -0
  50. data/lib/cucumber/formatter/jquery-min.js +154 -0
  51. data/lib/cucumber.rb +68 -0
  52. data/lib/duration.rb +13 -0
  53. data/lib/io.rb +31 -0
  54. data/lib/ordered_xml_markup.rb +24 -0
  55. data/lib/rspec.rb +75 -0
  56. data/lib/watir.rb +105 -0
  57. data/lib/whirlwind.rb +39 -0
  58. data/sites/demo/conf/base_urls.yml +6 -0
  59. data/sites/demo/conf/browser.yaml +1 -0
  60. data/sites/demo/conf/html_elements.yaml +22 -0
  61. data/sites/demo/conf/remote_machine.yaml +12 -0
  62. data/sites/demo/conf/users.yaml +21 -0
  63. data/sites/demo/elements/demo_common_elements.rb +42 -0
  64. data/sites/demo/elements/demo_elements.rb +18 -0
  65. data/sites/demo/elements/demo_registration_elements.rb +27 -0
  66. data/sites/demo/features/click_links.feature +21 -0
  67. data/sites/demo/features/register_user.feature +27 -0
  68. data/sites/demo/features/step_defn/demo.rb +62 -0
  69. data/sites/demo/flows/home_flows.rb +25 -0
  70. data/sites/demo/flows/registration_flows.rb +21 -0
  71. data/sites/demo/results/.placeholder +0 -0
  72. data/test/features/browser_types.feature +22 -0
  73. data/test/features/open_browser.feature +20 -0
  74. data/test/features/resource_size.feature +13 -0
  75. data/test/features/step_defn/browser.rb +61 -0
  76. data/test/test_whirlwind.rb +8 -0
  77. metadata +198 -0
@@ -0,0 +1,477 @@
1
+ /*
2
+ * jQuery UI Accordion 1.7.1
3
+ *
4
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
6
+ * and GPL (GPL-LICENSE.txt) licenses.
7
+ *
8
+ * http://docs.jquery.com/UI/Accordion
9
+ *
10
+ * Depends:
11
+ * ui.core.js
12
+ */
13
+ (function($) {
14
+
15
+ $.widget("ui.accordion", {
16
+
17
+ _init: function() {
18
+
19
+ var o = this.options, self = this;
20
+ this.running = 0;
21
+
22
+ // if the user set the alwaysOpen option on init
23
+ // then we need to set the collapsible option
24
+ // if they set both on init, collapsible will take priority
25
+ if (o.collapsible == $.ui.accordion.defaults.collapsible &&
26
+ o.alwaysOpen != $.ui.accordion.defaults.alwaysOpen) {
27
+ o.collapsible = !o.alwaysOpen;
28
+ }
29
+
30
+ if ( o.navigation ) {
31
+ var current = this.element.find("a").filter(o.navigationFilter);
32
+ if ( current.length ) {
33
+ if ( current.filter(o.header).length ) {
34
+ this.active = current;
35
+ } else {
36
+ this.active = current.parent().parent().prev();
37
+ current.addClass("ui-accordion-content-active");
38
+ }
39
+ }
40
+ }
41
+
42
+ this.element.addClass("ui-accordion ui-widget ui-helper-reset");
43
+
44
+ // in lack of child-selectors in CSS we need to mark top-LIs in a UL-accordion for some IE-fix
45
+ if (this.element[0].nodeName == "UL") {
46
+ this.element.children("li").addClass("ui-accordion-li-fix");
47
+ }
48
+
49
+ this.headers = this.element.find(o.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all")
50
+ .bind("mouseenter.accordion", function(){ $(this).addClass('ui-state-hover'); })
51
+ .bind("mouseleave.accordion", function(){ $(this).removeClass('ui-state-hover'); })
52
+ .bind("focus.accordion", function(){ $(this).addClass('ui-state-focus'); })
53
+ .bind("blur.accordion", function(){ $(this).removeClass('ui-state-focus'); });
54
+
55
+ this.headers
56
+ .next()
57
+ .addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
58
+
59
+ this.active = this._findActive(this.active || o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");
60
+ this.active.next().addClass('ui-accordion-content-active');
61
+
62
+ //Append icon elements
63
+ $("<span/>").addClass("ui-icon " + o.icons.header).prependTo(this.headers);
64
+ this.active.find(".ui-icon").toggleClass(o.icons.header).toggleClass(o.icons.headerSelected);
65
+
66
+ // IE7-/Win - Extra vertical space in lists fixed
67
+ if ($.browser.msie) {
68
+ this.element.find('a').css('zoom', '1');
69
+ }
70
+
71
+ this.resize();
72
+
73
+ //ARIA
74
+ this.element.attr('role','tablist');
75
+
76
+ this.headers
77
+ .attr('role','tab')
78
+ .bind('keydown', function(event) { return self._keydown(event); })
79
+ .next()
80
+ .attr('role','tabpanel');
81
+
82
+ this.headers
83
+ .not(this.active || "")
84
+ .attr('aria-expanded','false')
85
+ .attr("tabIndex", "-1")
86
+ .next()
87
+ .hide();
88
+
89
+ // make sure at least one header is in the tab order
90
+ if (!this.active.length) {
91
+ this.headers.eq(0).attr('tabIndex','0');
92
+ } else {
93
+ this.active
94
+ .attr('aria-expanded','true')
95
+ .attr('tabIndex', '0');
96
+ }
97
+
98
+ // only need links in taborder for Safari
99
+ if (!$.browser.safari)
100
+ this.headers.find('a').attr('tabIndex','-1');
101
+
102
+ if (o.event) {
103
+ this.headers.bind((o.event) + ".accordion", function(event) { return self._clickHandler.call(self, event, this); });
104
+ }
105
+
106
+ },
107
+
108
+ destroy: function() {
109
+ var o = this.options;
110
+
111
+ this.element
112
+ .removeClass("ui-accordion ui-widget ui-helper-reset")
113
+ .removeAttr("role")
114
+ .unbind('.accordion')
115
+ .removeData('accordion');
116
+
117
+ this.headers
118
+ .unbind(".accordion")
119
+ .removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top")
120
+ .removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");
121
+
122
+ this.headers.find("a").removeAttr("tabindex");
123
+ this.headers.children(".ui-icon").remove();
124
+ var contents = this.headers.next().css("display", "").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");
125
+ if (o.autoHeight || o.fillHeight) {
126
+ contents.css("height", "");
127
+ }
128
+ },
129
+
130
+ _setData: function(key, value) {
131
+ if(key == 'alwaysOpen') { key = 'collapsible'; value = !value; }
132
+ $.widget.prototype._setData.apply(this, arguments);
133
+ },
134
+
135
+ _keydown: function(event) {
136
+
137
+ var o = this.options, keyCode = $.ui.keyCode;
138
+
139
+ if (o.disabled || event.altKey || event.ctrlKey)
140
+ return;
141
+
142
+ var length = this.headers.length;
143
+ var currentIndex = this.headers.index(event.target);
144
+ var toFocus = false;
145
+
146
+ switch(event.keyCode) {
147
+ case keyCode.RIGHT:
148
+ case keyCode.DOWN:
149
+ toFocus = this.headers[(currentIndex + 1) % length];
150
+ break;
151
+ case keyCode.LEFT:
152
+ case keyCode.UP:
153
+ toFocus = this.headers[(currentIndex - 1 + length) % length];
154
+ break;
155
+ case keyCode.SPACE:
156
+ case keyCode.ENTER:
157
+ return this._clickHandler({ target: event.target }, event.target);
158
+ }
159
+
160
+ if (toFocus) {
161
+ $(event.target).attr('tabIndex','-1');
162
+ $(toFocus).attr('tabIndex','0');
163
+ toFocus.focus();
164
+ return false;
165
+ }
166
+
167
+ return true;
168
+
169
+ },
170
+
171
+ resize: function() {
172
+
173
+ var o = this.options, maxHeight;
174
+
175
+ if (o.fillSpace) {
176
+
177
+ if($.browser.msie) { var defOverflow = this.element.parent().css('overflow'); this.element.parent().css('overflow', 'hidden'); }
178
+ maxHeight = this.element.parent().height();
179
+ if($.browser.msie) { this.element.parent().css('overflow', defOverflow); }
180
+
181
+ this.headers.each(function() {
182
+ maxHeight -= $(this).outerHeight();
183
+ });
184
+
185
+ var maxPadding = 0;
186
+ this.headers.next().each(function() {
187
+ maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height());
188
+ }).height(Math.max(0, maxHeight - maxPadding))
189
+ .css('overflow', 'auto');
190
+
191
+ } else if ( o.autoHeight ) {
192
+ maxHeight = 0;
193
+ this.headers.next().each(function() {
194
+ maxHeight = Math.max(maxHeight, $(this).outerHeight());
195
+ }).height(maxHeight);
196
+ }
197
+
198
+ },
199
+
200
+ activate: function(index) {
201
+ // call clickHandler with custom event
202
+ var active = this._findActive(index)[0];
203
+ this._clickHandler({ target: active }, active);
204
+ },
205
+
206
+ _findActive: function(selector) {
207
+ return selector
208
+ ? typeof selector == "number"
209
+ ? this.headers.filter(":eq(" + selector + ")")
210
+ : this.headers.not(this.headers.not(selector))
211
+ : selector === false
212
+ ? $([])
213
+ : this.headers.filter(":eq(0)");
214
+ },
215
+
216
+ _clickHandler: function(event, target) {
217
+
218
+ var o = this.options;
219
+ if (o.disabled) return false;
220
+
221
+ // called only when using activate(false) to close all parts programmatically
222
+ if (!event.target && o.collapsible) {
223
+ this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
224
+ .find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
225
+ this.active.next().addClass('ui-accordion-content-active');
226
+ var toHide = this.active.next(),
227
+ data = {
228
+ options: o,
229
+ newHeader: $([]),
230
+ oldHeader: o.active,
231
+ newContent: $([]),
232
+ oldContent: toHide
233
+ },
234
+ toShow = (this.active = $([]));
235
+ this._toggle(toShow, toHide, data);
236
+ return false;
237
+ }
238
+
239
+ // get the click target
240
+ var clicked = $(event.currentTarget || target);
241
+ var clickedIsActive = clicked[0] == this.active[0];
242
+
243
+ // if animations are still active, or the active header is the target, ignore click
244
+ if (this.running || (!o.collapsible && clickedIsActive)) {
245
+ return false;
246
+ }
247
+
248
+ // switch classes
249
+ this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all")
250
+ .find(".ui-icon").removeClass(o.icons.headerSelected).addClass(o.icons.header);
251
+ this.active.next().addClass('ui-accordion-content-active');
252
+ if (!clickedIsActive) {
253
+ clicked.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top")
254
+ .find(".ui-icon").removeClass(o.icons.header).addClass(o.icons.headerSelected);
255
+ clicked.next().addClass('ui-accordion-content-active');
256
+ }
257
+
258
+ // find elements to show and hide
259
+ var toShow = clicked.next(),
260
+ toHide = this.active.next(),
261
+ data = {
262
+ options: o,
263
+ newHeader: clickedIsActive && o.collapsible ? $([]) : clicked,
264
+ oldHeader: this.active,
265
+ newContent: clickedIsActive && o.collapsible ? $([]) : toShow.find('> *'),
266
+ oldContent: toHide.find('> *')
267
+ },
268
+ down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
269
+
270
+ this.active = clickedIsActive ? $([]) : clicked;
271
+ this._toggle(toShow, toHide, data, clickedIsActive, down);
272
+
273
+ return false;
274
+
275
+ },
276
+
277
+ _toggle: function(toShow, toHide, data, clickedIsActive, down) {
278
+
279
+ var o = this.options, self = this;
280
+
281
+ this.toShow = toShow;
282
+ this.toHide = toHide;
283
+ this.data = data;
284
+
285
+ var complete = function() { if(!self) return; return self._completed.apply(self, arguments); };
286
+
287
+ // trigger changestart event
288
+ this._trigger("changestart", null, this.data);
289
+
290
+ // count elements to animate
291
+ this.running = toHide.size() === 0 ? toShow.size() : toHide.size();
292
+
293
+ if (o.animated) {
294
+
295
+ var animOptions = {};
296
+
297
+ if ( o.collapsible && clickedIsActive ) {
298
+ animOptions = {
299
+ toShow: $([]),
300
+ toHide: toHide,
301
+ complete: complete,
302
+ down: down,
303
+ autoHeight: o.autoHeight || o.fillSpace
304
+ };
305
+ } else {
306
+ animOptions = {
307
+ toShow: toShow,
308
+ toHide: toHide,
309
+ complete: complete,
310
+ down: down,
311
+ autoHeight: o.autoHeight || o.fillSpace
312
+ };
313
+ }
314
+
315
+ if (!o.proxied) {
316
+ o.proxied = o.animated;
317
+ }
318
+
319
+ if (!o.proxiedDuration) {
320
+ o.proxiedDuration = o.duration;
321
+ }
322
+
323
+ o.animated = $.isFunction(o.proxied) ?
324
+ o.proxied(animOptions) : o.proxied;
325
+
326
+ o.duration = $.isFunction(o.proxiedDuration) ?
327
+ o.proxiedDuration(animOptions) : o.proxiedDuration;
328
+
329
+ var animations = $.ui.accordion.animations,
330
+ duration = o.duration,
331
+ easing = o.animated;
332
+
333
+ if (!animations[easing]) {
334
+ animations[easing] = function(options) {
335
+ this.slide(options, {
336
+ easing: easing,
337
+ duration: duration || 700
338
+ });
339
+ };
340
+ }
341
+
342
+ animations[easing](animOptions);
343
+
344
+ } else {
345
+
346
+ if (o.collapsible && clickedIsActive) {
347
+ toShow.toggle();
348
+ } else {
349
+ toHide.hide();
350
+ toShow.show();
351
+ }
352
+
353
+ complete(true);
354
+
355
+ }
356
+
357
+ toHide.prev().attr('aria-expanded','false').attr("tabIndex", "-1").blur();
358
+ toShow.prev().attr('aria-expanded','true').attr("tabIndex", "0").focus();
359
+
360
+ },
361
+
362
+ _completed: function(cancel) {
363
+
364
+ var o = this.options;
365
+
366
+ this.running = cancel ? 0 : --this.running;
367
+ if (this.running) return;
368
+
369
+ if (o.clearStyle) {
370
+ this.toShow.add(this.toHide).css({
371
+ height: "",
372
+ overflow: ""
373
+ });
374
+ }
375
+
376
+ this._trigger('change', null, this.data);
377
+ }
378
+
379
+ });
380
+
381
+
382
+ $.extend($.ui.accordion, {
383
+ version: "1.7.1",
384
+ defaults: {
385
+ active: null,
386
+ alwaysOpen: true, //deprecated, use collapsible
387
+ animated: 'slide',
388
+ autoHeight: true,
389
+ clearStyle: false,
390
+ collapsible: false,
391
+ event: "click",
392
+ fillSpace: false,
393
+ header: "> li > :first-child,> :not(li):even",
394
+ icons: {
395
+ header: "ui-icon-triangle-1-e",
396
+ headerSelected: "ui-icon-triangle-1-s"
397
+ },
398
+ navigation: false,
399
+ navigationFilter: function() {
400
+ return this.href.toLowerCase() == location.href.toLowerCase();
401
+ }
402
+ },
403
+ animations: {
404
+ slide: function(options, additions) {
405
+ options = $.extend({
406
+ easing: "swing",
407
+ duration: 300
408
+ }, options, additions);
409
+ if ( !options.toHide.size() ) {
410
+ options.toShow.animate({height: "show"}, options);
411
+ return;
412
+ }
413
+ if ( !options.toShow.size() ) {
414
+ options.toHide.animate({height: "hide"}, options);
415
+ return;
416
+ }
417
+ var overflow = options.toShow.css('overflow'),
418
+ percentDone,
419
+ showProps = {},
420
+ hideProps = {},
421
+ fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
422
+ originalWidth;
423
+ // fix width before calculating height of hidden element
424
+ var s = options.toShow;
425
+ originalWidth = s[0].style.width;
426
+ s.width( parseInt(s.parent().width(),10) - parseInt(s.css("paddingLeft"),10) - parseInt(s.css("paddingRight"),10) - (parseInt(s.css("borderLeftWidth"),10) || 0) - (parseInt(s.css("borderRightWidth"),10) || 0) );
427
+
428
+ $.each(fxAttrs, function(i, prop) {
429
+ hideProps[prop] = 'hide';
430
+
431
+ var parts = ('' + $.css(options.toShow[0], prop)).match(/^([\d+-.]+)(.*)$/);
432
+ showProps[prop] = {
433
+ value: parts[1],
434
+ unit: parts[2] || 'px'
435
+ };
436
+ });
437
+ options.toShow.css({ height: 0, overflow: 'hidden' }).show();
438
+ options.toHide.filter(":hidden").each(options.complete).end().filter(":visible").animate(hideProps,{
439
+ step: function(now, settings) {
440
+ // only calculate the percent when animating height
441
+ // IE gets very inconsistent results when animating elements
442
+ // with small values, which is common for padding
443
+ if (settings.prop == 'height') {
444
+ percentDone = (settings.now - settings.start) / (settings.end - settings.start);
445
+ }
446
+
447
+ options.toShow[0].style[settings.prop] =
448
+ (percentDone * showProps[settings.prop].value) + showProps[settings.prop].unit;
449
+ },
450
+ duration: options.duration,
451
+ easing: options.easing,
452
+ complete: function() {
453
+ if ( !options.autoHeight ) {
454
+ options.toShow.css("height", "");
455
+ }
456
+ options.toShow.css("width", originalWidth);
457
+ options.toShow.css({overflow: overflow});
458
+ options.complete();
459
+ }
460
+ });
461
+ },
462
+ bounceslide: function(options) {
463
+ this.slide(options, {
464
+ easing: options.down ? "easeOutBounce" : "swing",
465
+ duration: options.down ? 1000 : 200
466
+ });
467
+ },
468
+ easeslide: function(options) {
469
+ this.slide(options, {
470
+ easing: "easeinout",
471
+ duration: 700
472
+ });
473
+ }
474
+ }
475
+ });
476
+
477
+ })(jQuery);
@@ -0,0 +1,11 @@
1
+ /*
2
+ * jQuery UI CSS Framework 1.8.9
3
+ *
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
+ * Dual licensed under the MIT or GPL Version 2 licenses.
6
+ * http://jquery.org/license
7
+ *
8
+ * http://docs.jquery.com/UI/Theming
9
+ */
10
+ @import "jquery.ui.base.css";
11
+ @import "jquery.ui.theme.css";
@@ -0,0 +1,11 @@
1
+ @import url("jquery.ui.core.css");
2
+ @import url("jquery.ui.resizable.css");
3
+ @import url("jquery.ui.selectable.css");
4
+ @import url("jquery.ui.accordion.css");
5
+ @import url("jquery.ui.autocomplete.css");
6
+ @import url("jquery.ui.button.css");
7
+ @import url("jquery.ui.dialog.css");
8
+ @import url("jquery.ui.slider.css");
9
+ @import url("jquery.ui.tabs.css");
10
+ @import url("jquery.ui.datepicker.css");
11
+ @import url("jquery.ui.progressbar.css");