jqueryui_widgets 0.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +7 -0
- data/features/accordion.feature +0 -1
- data/features/html/slider.html +23 -0
- data/features/html/spinner.html +60 -0
- data/features/slider.feature +14 -0
- data/features/spinner.feature +15 -0
- data/features/step_definitions/basic_dialog_steps.rb +4 -4
- data/features/step_definitions/progress_bar_steps.rb +3 -3
- data/features/step_definitions/slider_steps.rb +11 -0
- data/features/step_definitions/spinner_steps.rb +19 -0
- data/features/support/pages/basic_dialog_page.rb +1 -4
- data/features/support/pages/progress_bar_page.rb +1 -4
- data/features/support/pages/slider_page.rb +11 -0
- data/features/support/pages/spinner_page.rb +12 -0
- data/jqueryui_widgets.gemspec +1 -1
- data/lib/jqueryui_widgets.rb +4 -0
- data/lib/jqueryui_widgets/accordion.rb +5 -1
- data/lib/jqueryui_widgets/basic_dialog.rb +28 -15
- data/lib/jqueryui_widgets/core_ext/string.rb +6 -0
- data/lib/jqueryui_widgets/menus.rb +10 -1
- data/lib/jqueryui_widgets/progress_bar.rb +26 -19
- data/lib/jqueryui_widgets/slider.rb +42 -0
- data/lib/jqueryui_widgets/spinner.rb +54 -0
- data/lib/jqueryui_widgets/tabs.rb +10 -1
- data/lib/jqueryui_widgets/version.rb +1 -1
- metadata +25 -6
data/ChangeLog
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== Version 0.6 / 2013-5-24
|
2
|
+
* Enhancements
|
3
|
+
* New functionality from Page Object
|
4
|
+
* Added in Slider functionality
|
5
|
+
* Added in Spinner functionality
|
6
|
+
* Additional documentation for all widgets
|
7
|
+
|
1
8
|
== Version 0.5 / 2013-3-29
|
2
9
|
* Enhancements
|
3
10
|
* Added in Accordion functionality
|
data/features/accordion.feature
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<title>jQuery UI Slider - Default functionality</title>
|
7
|
+
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
|
8
|
+
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
|
9
|
+
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
|
10
|
+
<link rel="stylesheet" href="/resources/demos/style.css" />
|
11
|
+
<script>
|
12
|
+
$(function() {
|
13
|
+
$( "#slider" ).slider();
|
14
|
+
});
|
15
|
+
</script>
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
|
19
|
+
<div id="slider"></div>
|
20
|
+
|
21
|
+
|
22
|
+
</body>
|
23
|
+
</html>
|
@@ -0,0 +1,60 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
<title>jQuery UI Spinner - Default functionality</title>
|
7
|
+
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
|
8
|
+
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
|
9
|
+
<script src="/resources/demos/external/jquery.mousewheel.js"></script>
|
10
|
+
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
|
11
|
+
<link rel="stylesheet" href="/resources/demos/style.css" />
|
12
|
+
<script>
|
13
|
+
$(function() {
|
14
|
+
var spinner = $( "#spinner" ).spinner();
|
15
|
+
|
16
|
+
$( "#disable" ).click(function() {
|
17
|
+
if ( spinner.spinner( "option", "disabled" ) ) {
|
18
|
+
spinner.spinner( "enable" );
|
19
|
+
} else {
|
20
|
+
spinner.spinner( "disable" );
|
21
|
+
}
|
22
|
+
});
|
23
|
+
$( "#destroy" ).click(function() {
|
24
|
+
if ( spinner.data( "ui-spinner" ) ) {
|
25
|
+
spinner.spinner( "destroy" );
|
26
|
+
} else {
|
27
|
+
spinner.spinner();
|
28
|
+
}
|
29
|
+
});
|
30
|
+
$( "#getvalue" ).click(function() {
|
31
|
+
alert( spinner.spinner( "value" ) );
|
32
|
+
});
|
33
|
+
$( "#setvalue" ).click(function() {
|
34
|
+
spinner.spinner( "value", 5 );
|
35
|
+
});
|
36
|
+
|
37
|
+
$( "button" ).button();
|
38
|
+
});
|
39
|
+
</script>
|
40
|
+
</head>
|
41
|
+
<body>
|
42
|
+
|
43
|
+
<p>
|
44
|
+
<label for="spinner">Select a value:</label>
|
45
|
+
<input id="spinner" name="value" />
|
46
|
+
</p>
|
47
|
+
|
48
|
+
<p>
|
49
|
+
<button id="disable">Toggle disable/enable</button>
|
50
|
+
<button id="destroy">Toggle widget</button>
|
51
|
+
</p>
|
52
|
+
|
53
|
+
<p>
|
54
|
+
<button id="getvalue">Get value</button>
|
55
|
+
<button id="setvalue">Set value to 5</button>
|
56
|
+
</p>
|
57
|
+
|
58
|
+
|
59
|
+
</body>
|
60
|
+
</html>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: Using the JQueryUI Slider Widget
|
2
|
+
|
3
|
+
Here we'll be able to get the current value of the
|
4
|
+
Slider widget, and set a new one.
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given I am on the slider page
|
8
|
+
|
9
|
+
Scenario: Using the Slider widget
|
10
|
+
Then the current value of the slider should be "0%"
|
11
|
+
|
12
|
+
Scenario: Setting the Slider to a specific value
|
13
|
+
When I move the slider to "20%"
|
14
|
+
Then the current value of the slider should be "10%"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
Feature: Using the JQueryUI Spinner Widget
|
3
|
+
|
4
|
+
Background:
|
5
|
+
Given I am on the spinner page
|
6
|
+
|
7
|
+
Scenario: Adjust the spinner value with arrows
|
8
|
+
When I click the increment button
|
9
|
+
Then the Spinner Widget should read "1"
|
10
|
+
When I click the decrement button
|
11
|
+
Then the Spinner Widget should read "0"
|
12
|
+
|
13
|
+
Scenario: Manually set the spinner value
|
14
|
+
When I set the spinner value to "10"
|
15
|
+
Then the Spinner Widget should read "10"
|
@@ -3,18 +3,18 @@ Given /^I am on the basic dialog page$/ do
|
|
3
3
|
end
|
4
4
|
|
5
5
|
Then /^the basic dialog title should be "(.+)"$/ do |title|
|
6
|
-
on(BasicDialogPage).
|
6
|
+
on(BasicDialogPage).the_dialog_title.should == title
|
7
7
|
end
|
8
8
|
|
9
9
|
When /^the content should include "(.+)"$/ do |content|
|
10
|
-
on(BasicDialogPage).
|
10
|
+
on(BasicDialogPage).the_dialog_content.should include content
|
11
11
|
end
|
12
12
|
|
13
13
|
When /^I close the basic dialog$/ do
|
14
|
-
on(BasicDialogPage).
|
14
|
+
on(BasicDialogPage).close_the_dialog
|
15
15
|
end
|
16
16
|
|
17
17
|
Then /^the basic dialog should not be visible$/ do
|
18
|
-
on(BasicDialogPage).
|
18
|
+
on(BasicDialogPage).the_dialog_element.should_not be_visible
|
19
19
|
end
|
20
20
|
|
@@ -3,13 +3,13 @@ Given /^I am on the Progress Bar page$/ do
|
|
3
3
|
end
|
4
4
|
|
5
5
|
Then /^the minimum value should be "(.+)"$/ do |minimum_value|
|
6
|
-
on(ProgressBarPage).
|
6
|
+
on(ProgressBarPage).the_progress_min.should == minimum_value.to_i
|
7
7
|
end
|
8
8
|
|
9
9
|
Then /^the maximum value should be "(.+)"$/ do |maximum_value|
|
10
|
-
on(ProgressBarPage).
|
10
|
+
on(ProgressBarPage).the_progress_max.should == maximum_value.to_i
|
11
11
|
end
|
12
12
|
|
13
13
|
Then /^the current value should be "(.+)"$/ do |current_value|
|
14
|
-
on(ProgressBarPage).
|
14
|
+
on(ProgressBarPage).the_progress.should == current_value.to_i
|
15
15
|
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Given /^I am on the slider page$/ do
|
2
|
+
visit SliderPage
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /^the current value of the slider should be "([^"]*)"$/ do |percent|
|
6
|
+
on(SliderPage).the_slider.should == percent
|
7
|
+
end
|
8
|
+
|
9
|
+
When(/^I move the slider to "([^"]*)"$/) do |value|
|
10
|
+
on(SliderPage).the_slider = value
|
11
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Given /^I am on the spinner page$/ do
|
2
|
+
visit SpinnerPage
|
3
|
+
end
|
4
|
+
|
5
|
+
When(/^I click the increment button$/) do
|
6
|
+
on(SpinnerPage).increment_the_spinner
|
7
|
+
end
|
8
|
+
|
9
|
+
Then(/^the Spinner Widget should read "([^"]*)"$/) do |value|
|
10
|
+
on(SpinnerPage).the_spinner.should == value
|
11
|
+
end
|
12
|
+
|
13
|
+
When(/^I click the decrement button$/) do
|
14
|
+
on(SpinnerPage).decrement_the_spinner
|
15
|
+
end
|
16
|
+
|
17
|
+
When(/^I set the spinner value to "([^"]*)"$/) do |value|
|
18
|
+
on(SpinnerPage).the_spinner = value
|
19
|
+
end
|
@@ -3,10 +3,7 @@ class BasicDialogPage
|
|
3
3
|
|
4
4
|
page_url "file://#{File.expand_path(File.dirname(__FILE__) + '/../../html/basic_dialog.html')}"
|
5
5
|
|
6
|
-
jqueryui_basic_dialog(:
|
6
|
+
jqueryui_basic_dialog(:the_dialog, :class => 'ui-dialog')
|
7
7
|
|
8
|
-
def basic_dialog
|
9
|
-
basic_dialog_element
|
10
|
-
end
|
11
8
|
end
|
12
9
|
|
@@ -3,9 +3,6 @@ class ProgressBarPage
|
|
3
3
|
|
4
4
|
page_url "file://#{File.expand_path(File.dirname(__FILE__) + '/../../html/progress_bar.html')}"
|
5
5
|
|
6
|
-
jqueryui_progress_bar(:
|
6
|
+
jqueryui_progress_bar(:the_progress, :id => 'progressbar')
|
7
7
|
|
8
|
-
def progress_bar
|
9
|
-
progress_bar_element
|
10
|
-
end
|
11
8
|
end
|
data/jqueryui_widgets.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_dependency 'page-object', '>= 0.8.
|
20
|
+
gem.add_dependency 'page-object', '>= 0.8.8'
|
21
21
|
|
22
22
|
gem.add_development_dependency 'cucumber', '>= 1.2.0'
|
23
23
|
gem.add_development_dependency 'rspec', '>= 2.12'
|
data/lib/jqueryui_widgets.rb
CHANGED
@@ -5,6 +5,8 @@ require 'jqueryui_widgets/tabs'
|
|
5
5
|
require 'jqueryui_widgets/progress_bar'
|
6
6
|
require 'jqueryui_widgets/menus'
|
7
7
|
require 'jqueryui_widgets/accordion'
|
8
|
+
require 'jqueryui_widgets/slider'
|
9
|
+
require 'jqueryui_widgets/spinner'
|
8
10
|
|
9
11
|
module JQueryUIWidgets
|
10
12
|
|
@@ -13,5 +15,7 @@ module JQueryUIWidgets
|
|
13
15
|
PageObject.register_widget(:jqueryui_progress_bar, JQueryUIWidgets::ProgressBar, 'div')
|
14
16
|
PageObject.register_widget(:jqueryui_menus, JQueryUIWidgets::Menus, 'ul')
|
15
17
|
PageObject.register_widget(:jqueryui_accordion, JQueryUIWidgets::Accordion, 'div')
|
18
|
+
PageObject.register_widget(:jqueryui_slider, JQueryUIWidgets::Slider, 'div')
|
19
|
+
PageObject.register_widget(:jqueryui_spinner, JQueryUIWidgets::Spinner, 'span')
|
16
20
|
|
17
21
|
end
|
@@ -2,6 +2,11 @@
|
|
2
2
|
#
|
3
3
|
# Accordion class to make use of the Accordion widget.
|
4
4
|
#
|
5
|
+
# NOTE: Since JQueryUI Widgets are completely customizable,
|
6
|
+
# we've kept the Accordion class limited to basic functionality
|
7
|
+
# so that end users can pick up the gem and customize it to
|
8
|
+
# suit their own needs.
|
9
|
+
#
|
5
10
|
class JQueryUIWidgets::Accordion < PageObject::Elements::Div
|
6
11
|
|
7
12
|
#
|
@@ -64,7 +69,6 @@ class JQueryUIWidgets::Accordion < PageObject::Elements::Div
|
|
64
69
|
def wait_for_content(index)
|
65
70
|
the_content = div_elements(:class => 'ui-accordion-content')[index]
|
66
71
|
wait_until(1, "Content not visible within one second") do
|
67
|
-
puts the_content.style("display")
|
68
72
|
the_content.style("display") == "block"
|
69
73
|
end
|
70
74
|
end
|
@@ -3,30 +3,43 @@
|
|
3
3
|
# Basic Dialog allows JQuery UI Widgets to interact
|
4
4
|
# with the basic dialogs that JQueryUI pops up.
|
5
5
|
#
|
6
|
+
# NOTE: JQueryUI Widgets are very customizable,
|
7
|
+
# so we've kept the functionality for the dialogs
|
8
|
+
# class as rudimentary as possible, to allow the
|
9
|
+
# end user to build up any functionality they
|
10
|
+
# require, and customize the class to suit their
|
11
|
+
# particular needs.
|
12
|
+
#
|
6
13
|
class JQueryUIWidgets::BasicDialog < PageObject::Elements::Div
|
7
14
|
|
8
15
|
#
|
9
|
-
#
|
10
|
-
# bar in the UI dialog and returns the text.
|
16
|
+
# Generates three methods
|
11
17
|
#
|
12
|
-
|
13
|
-
|
14
|
-
end
|
15
|
-
|
18
|
+
# The {NAME}title method grabs the span element of the title
|
19
|
+
# bar in the UI dialog and returns the text.
|
16
20
|
#
|
17
|
-
#
|
21
|
+
# {NAME}_content method will return the entire text of
|
18
22
|
# the JQuery UI dialog box.
|
19
23
|
#
|
20
|
-
|
21
|
-
div_element(:class => 'ui-dialog-content').text
|
22
|
-
end
|
23
|
-
|
24
|
-
#
|
25
|
-
# Close function will, of course, click the button
|
24
|
+
# close_{NAME} method will, of course, click the button
|
26
25
|
# labeled close.
|
27
26
|
#
|
28
|
-
|
29
|
-
|
27
|
+
|
28
|
+
def self.accessor_methods(accessor, name)
|
29
|
+
accessor.send :define_method, "#{name}_title" do
|
30
|
+
dialog = self.send "#{name}_element"
|
31
|
+
dialog.div_element(:class => 'ui-dialog-titlebar').span_element.text
|
32
|
+
end
|
33
|
+
|
34
|
+
accessor.send :define_method, "#{name}_content" do
|
35
|
+
dialog = self.send "#{name}_element"
|
36
|
+
dialog.div_element(:class => 'ui-dialog-content').text
|
37
|
+
end
|
38
|
+
|
39
|
+
accessor.send :define_method, "close_#{name}" do
|
40
|
+
dialog = self.send "#{name}_element"
|
41
|
+
dialog.button_element(:class => 'ui-dialog-titlebar-close').click
|
42
|
+
end
|
30
43
|
end
|
31
44
|
|
32
45
|
end
|
@@ -1,6 +1,15 @@
|
|
1
1
|
|
2
2
|
#
|
3
|
-
# Class that wraps the jQueryUI menu
|
3
|
+
# Class that wraps the jQueryUI menu, allowing
|
4
|
+
# users to interact with both top level, and
|
5
|
+
# nested menus.
|
6
|
+
#
|
7
|
+
# NOTE: We've kept to the basic functionality
|
8
|
+
# of the Menu widget in order to avoid causing
|
9
|
+
# difficulty with the usage of the widget since
|
10
|
+
# all of the JQuery UI Widgets are so customizable.
|
11
|
+
# In this fashion, we allow the user to customize
|
12
|
+
# the code to suit their own needs.
|
4
13
|
#
|
5
14
|
class JQueryUIWidgets::Menus < PageObject::Elements::UnorderedList
|
6
15
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'jqueryui_widgets/core_ext/string'
|
1
2
|
|
2
3
|
#
|
3
4
|
# The progress bar class will interact with the
|
@@ -5,39 +6,45 @@
|
|
5
6
|
# returning the Minimum value, Maximum Value and
|
6
7
|
# Current progress.
|
7
8
|
#
|
9
|
+
# NOTE: As with all JQuery UI Widgets, we have
|
10
|
+
# left the Progress Bar code with the basics
|
11
|
+
# of functionality to allow the user to
|
12
|
+
# customize the gem to suit their own needs.
|
13
|
+
#
|
8
14
|
class JQueryUIWidgets::ProgressBar < PageObject::Elements::Div
|
9
15
|
|
10
16
|
#
|
11
|
-
#
|
17
|
+
# Generates three methods.
|
18
|
+
#
|
19
|
+
# The {NAME}_min function returns the minimum
|
12
20
|
# possible value of the progress bar by
|
13
21
|
# returning the 'aria-valuemin' attribute's
|
14
22
|
# value.
|
15
23
|
#
|
16
|
-
|
17
|
-
convert_to_number attribute('aria-valuemin')
|
18
|
-
end
|
19
|
-
|
20
|
-
#
|
21
|
-
# The maximum function returns the maximum
|
24
|
+
# The {NAME}_max function returns the maximum
|
22
25
|
# value of the progress bar by returning
|
23
26
|
# the 'aria-valuemax' attribute's value.
|
24
|
-
def maximum
|
25
|
-
convert_to_number attribute('aria-valuemax')
|
26
|
-
end
|
27
|
-
|
28
27
|
#
|
29
|
-
# The
|
28
|
+
# The {NAME} function returns the current
|
30
29
|
# value of the progress bar by returning the
|
31
30
|
# 'aria-valuenow' attribute's value.
|
32
31
|
#
|
33
|
-
def
|
34
|
-
|
35
|
-
|
32
|
+
def self.accessor_methods(accessor, name)
|
33
|
+
accessor.send :define_method, "#{name}" do
|
34
|
+
progress_bar = self.send "#{name}_element"
|
35
|
+
progress_bar.attribute('aria-valuenow').convert_to_number
|
36
|
+
end
|
37
|
+
|
38
|
+
accessor.send :define_method, "#{name}_min" do
|
39
|
+
progress_bar = self.send "#{name}_element"
|
40
|
+
progress_bar.attribute('aria-valuemin').convert_to_number
|
41
|
+
end
|
42
|
+
|
43
|
+
accessor.send :define_method, "#{name}_max" do
|
44
|
+
progress_bar = self.send "#{name}_element"
|
45
|
+
progress_bar.attribute('aria-valuemax').convert_to_number
|
46
|
+
end
|
36
47
|
|
37
|
-
private
|
38
|
-
def convert_to_number(value)
|
39
|
-
value = value.to_i if value
|
40
|
-
value
|
41
48
|
end
|
42
49
|
|
43
50
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Slider Class will serve as a wrapper for the JQuery UI Slider widget,
|
4
|
+
# allowing the user to interact with the slider, setting it to a specific
|
5
|
+
# position within the length of the slider, between 0% and 100%.
|
6
|
+
#
|
7
|
+
# The user will pass in the variable they wish to set with the addition
|
8
|
+
# of the % symbol.
|
9
|
+
#
|
10
|
+
# NOTE: The code for the Slider widget will be kept as basic as
|
11
|
+
# possible in order to allow the user to tailor the class to suit
|
12
|
+
# their own needs in case customization of the slider has been
|
13
|
+
# exercised.
|
14
|
+
#
|
15
|
+
|
16
|
+
class JQueryUIWidgets::Slider < PageObject::Elements::Div
|
17
|
+
|
18
|
+
#
|
19
|
+
# Generates two methods.
|
20
|
+
#
|
21
|
+
# The {NAME} method picks up the current position of the
|
22
|
+
# slider, grabbing the % and returning it.
|
23
|
+
#
|
24
|
+
# The {NAME}= method will allow the user to set the
|
25
|
+
# position of the slider by passing in a percentage.
|
26
|
+
#
|
27
|
+
# @example
|
28
|
+
# the_slider=('15%')
|
29
|
+
# Will set the slider to 15%.
|
30
|
+
#
|
31
|
+
def self.accessor_methods(accessor, name)
|
32
|
+
accessor.send :define_method, "#{name}" do
|
33
|
+
slider = self.send "#{name}_element"
|
34
|
+
the_slider = slider.link_element(:class => 'ui-slider-handle ui-state-default ui-corner-all')
|
35
|
+
the_slider.html[/\d+%/]
|
36
|
+
end
|
37
|
+
|
38
|
+
accessor.send :define_method, "#{name}=" do |value|
|
39
|
+
browser.execute_script("document.getElementsByClassName('ui-slider-handle')[0].style.left=\"#{value}\";")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#
|
2
|
+
# The Spinner Class will serve as a wrapper for the JQuery UI Spinner
|
3
|
+
# widget, allowing the user to interact with the spinner, setting
|
4
|
+
# the value either through manual entry, or the up or down arrows attached
|
5
|
+
# to the widget.
|
6
|
+
#
|
7
|
+
# NOTE: The code for the Spinner widget will be kept as basic as possible
|
8
|
+
# in order to allow the user to tailor the class to suit their own
|
9
|
+
# needs in case customization of the spinner has been exercised.
|
10
|
+
#
|
11
|
+
class JQueryUIWidgets::Spinner < PageObject::Elements::Span
|
12
|
+
|
13
|
+
#
|
14
|
+
# Generates four methods.
|
15
|
+
#
|
16
|
+
# The increment_{NAME} method allows the user to click the
|
17
|
+
# up arrow and increment the value of the widget by 1.
|
18
|
+
#
|
19
|
+
# The decrement_{NAME} method allows the user to click the
|
20
|
+
# down arrow and decrement the value of the widget by 1.
|
21
|
+
#
|
22
|
+
# The {NAME} method allows the user to return the current
|
23
|
+
# value of the widget.
|
24
|
+
#
|
25
|
+
# The {NAME}_set method allows the user to set the value
|
26
|
+
# of the widget.
|
27
|
+
#
|
28
|
+
# @example
|
29
|
+
# the_spinner = 15
|
30
|
+
#
|
31
|
+
# Will set the spinner to 15.
|
32
|
+
#
|
33
|
+
def self.accessor_methods(accessor, name)
|
34
|
+
accessor.send :define_method, "increment_#{name}" do
|
35
|
+
spinner = self.send "#{name}_element"
|
36
|
+
spinner.link_element(:class => 'ui-spinner-up').click
|
37
|
+
end
|
38
|
+
|
39
|
+
accessor.send :define_method, "decrement_#{name}" do
|
40
|
+
spinner = self.send "#{name}_element"
|
41
|
+
spinner.link_element(:class => 'ui-spinner-down').click
|
42
|
+
end
|
43
|
+
|
44
|
+
accessor.send :define_method, "#{name}" do
|
45
|
+
spinner = self.send "#{name}_element"
|
46
|
+
spinner.text_field_element(:id => 'spinner').value
|
47
|
+
end
|
48
|
+
|
49
|
+
accessor.send :define_method, "#{name}=" do |value|
|
50
|
+
spinner = self.send "#{name}_element"
|
51
|
+
spinner.text_field_element(:id => 'spinner').value = value
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -1,6 +1,15 @@
|
|
1
1
|
|
2
2
|
#
|
3
|
-
# Class that wraps the JQueryUI Tabs
|
3
|
+
# Class that wraps the JQueryUI Tabs, allowing
|
4
|
+
# the user to interact with tabbed items.
|
5
|
+
#
|
6
|
+
# NOTE: The Tabs Widget code will be kept as
|
7
|
+
# basic as possible for the time being, since
|
8
|
+
# the Widget itself is fully customizable, we
|
9
|
+
# cannot allow for all of the possible
|
10
|
+
# functionality. This will allow for users
|
11
|
+
# to customize the gem to suit their own
|
12
|
+
# needs for the widget.
|
4
13
|
#
|
5
14
|
|
6
15
|
class JQueryUIWidgets::Tabs < PageObject::Elements::UnorderedList
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jqueryui_widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.6'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-05-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: page-object
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.8.
|
22
|
+
version: 0.8.8
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ! '>='
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.8.
|
30
|
+
version: 0.8.8
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: cucumber
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,15 +86,21 @@ files:
|
|
86
86
|
- features/html/jquery-ui.js
|
87
87
|
- features/html/menus.html
|
88
88
|
- features/html/progress_bar.html
|
89
|
+
- features/html/slider.html
|
90
|
+
- features/html/spinner.html
|
89
91
|
- features/html/style.css
|
90
92
|
- features/html/tabs.html
|
91
93
|
- features/menus.feature
|
92
94
|
- features/progress_bar.feature
|
95
|
+
- features/slider.feature
|
96
|
+
- features/spinner.feature
|
93
97
|
- features/step_definitions/accordion_steps.rb
|
94
98
|
- features/step_definitions/basic_dialog_steps.rb
|
95
99
|
- features/step_definitions/common_steps.rb
|
96
100
|
- features/step_definitions/menu_steps.rb
|
97
101
|
- features/step_definitions/progress_bar_steps.rb
|
102
|
+
- features/step_definitions/slider_steps.rb
|
103
|
+
- features/step_definitions/spinner_steps.rb
|
98
104
|
- features/step_definitions/tab_steps.rb
|
99
105
|
- features/support/env.rb
|
100
106
|
- features/support/hooks.rb
|
@@ -102,14 +108,19 @@ files:
|
|
102
108
|
- features/support/pages/basic_dialog_page.rb
|
103
109
|
- features/support/pages/menu_page.rb
|
104
110
|
- features/support/pages/progress_bar_page.rb
|
111
|
+
- features/support/pages/slider_page.rb
|
112
|
+
- features/support/pages/spinner_page.rb
|
105
113
|
- features/support/pages/tabs_page.rb
|
106
114
|
- features/tabs.feature
|
107
115
|
- jqueryui_widgets.gemspec
|
108
116
|
- lib/jqueryui_widgets.rb
|
109
117
|
- lib/jqueryui_widgets/accordion.rb
|
110
118
|
- lib/jqueryui_widgets/basic_dialog.rb
|
119
|
+
- lib/jqueryui_widgets/core_ext/string.rb
|
111
120
|
- lib/jqueryui_widgets/menus.rb
|
112
121
|
- lib/jqueryui_widgets/progress_bar.rb
|
122
|
+
- lib/jqueryui_widgets/slider.rb
|
123
|
+
- lib/jqueryui_widgets/spinner.rb
|
113
124
|
- lib/jqueryui_widgets/tabs.rb
|
114
125
|
- lib/jqueryui_widgets/version.rb
|
115
126
|
homepage: http://github.com/cheezy/jqueryui_widgets
|
@@ -126,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
137
|
version: '0'
|
127
138
|
segments:
|
128
139
|
- 0
|
129
|
-
hash: -
|
140
|
+
hash: -2842964414733939533
|
130
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
142
|
none: false
|
132
143
|
requirements:
|
@@ -135,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
146
|
version: '0'
|
136
147
|
segments:
|
137
148
|
- 0
|
138
|
-
hash: -
|
149
|
+
hash: -2842964414733939533
|
139
150
|
requirements: []
|
140
151
|
rubyforge_project:
|
141
152
|
rubygems_version: 1.8.25
|
@@ -152,15 +163,21 @@ test_files:
|
|
152
163
|
- features/html/jquery-ui.js
|
153
164
|
- features/html/menus.html
|
154
165
|
- features/html/progress_bar.html
|
166
|
+
- features/html/slider.html
|
167
|
+
- features/html/spinner.html
|
155
168
|
- features/html/style.css
|
156
169
|
- features/html/tabs.html
|
157
170
|
- features/menus.feature
|
158
171
|
- features/progress_bar.feature
|
172
|
+
- features/slider.feature
|
173
|
+
- features/spinner.feature
|
159
174
|
- features/step_definitions/accordion_steps.rb
|
160
175
|
- features/step_definitions/basic_dialog_steps.rb
|
161
176
|
- features/step_definitions/common_steps.rb
|
162
177
|
- features/step_definitions/menu_steps.rb
|
163
178
|
- features/step_definitions/progress_bar_steps.rb
|
179
|
+
- features/step_definitions/slider_steps.rb
|
180
|
+
- features/step_definitions/spinner_steps.rb
|
164
181
|
- features/step_definitions/tab_steps.rb
|
165
182
|
- features/support/env.rb
|
166
183
|
- features/support/hooks.rb
|
@@ -168,5 +185,7 @@ test_files:
|
|
168
185
|
- features/support/pages/basic_dialog_page.rb
|
169
186
|
- features/support/pages/menu_page.rb
|
170
187
|
- features/support/pages/progress_bar_page.rb
|
188
|
+
- features/support/pages/slider_page.rb
|
189
|
+
- features/support/pages/spinner_page.rb
|
171
190
|
- features/support/pages/tabs_page.rb
|
172
191
|
- features/tabs.feature
|