jqueryui_widgets 0.2 → 0.3
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/ChangeLog +11 -1
- data/features/html/progress_bar.html +21 -0
- data/features/progress_bar.feature +13 -0
- data/features/step_definitions/progress_bar_steps.rb +15 -0
- data/features/step_definitions/tab_steps.rb +15 -0
- data/features/support/pages/progress_bar_page.rb +11 -0
- data/features/tabs.feature +9 -0
- data/jqueryui_widgets.gemspec +2 -2
- data/lib/jqueryui_widgets/progress_bar.rb +21 -0
- data/lib/jqueryui_widgets/tabs.rb +7 -0
- data/lib/jqueryui_widgets/version.rb +1 -1
- data/lib/jqueryui_widgets.rb +2 -0
- metadata +17 -6
- data/features/step_definitions/tab_stpes.rb +0 -7
data/ChangeLog
CHANGED
@@ -1,4 +1,14 @@
|
|
1
|
-
=== Version 0.2
|
1
|
+
=== Version 0.3 / 2013-2-23
|
2
|
+
* Enhancements
|
3
|
+
* Added selected method to Tabs
|
4
|
+
* Added labels method to Tabs
|
5
|
+
* Added Progress Bar functionality
|
6
|
+
* Added minimum method to Progress Bar
|
7
|
+
* Added maximum method to Progress Bar
|
8
|
+
* Added current method to Progress Bar
|
9
|
+
|
10
|
+
|
11
|
+
=== Version 0.2 / 2013-2-20
|
2
12
|
* Ehnahcements
|
3
13
|
* Added Tabs
|
4
14
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<html lang="en">
|
2
|
+
<head>
|
3
|
+
<meta charset="utf-8" />
|
4
|
+
<title>jQuery UI Progressbar - Default functionality</title>
|
5
|
+
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
|
6
|
+
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
|
7
|
+
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
|
8
|
+
<link rel="stylesheet" href="/resources/demos/style.css" />
|
9
|
+
<script>
|
10
|
+
$(function() {
|
11
|
+
$( "#progressbar" ).progressbar({
|
12
|
+
value: 37
|
13
|
+
});
|
14
|
+
});
|
15
|
+
</script>
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
|
19
|
+
<div id="progressbar"></div>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Using the progress bar
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given I am on the Progress Bar page
|
5
|
+
|
6
|
+
Scenario: Getting the min value
|
7
|
+
Then the minimum value should be "0"
|
8
|
+
|
9
|
+
Scenario: Getting the max value
|
10
|
+
Then the maximum value should be "100"
|
11
|
+
|
12
|
+
Scenario: Getting the current value
|
13
|
+
Then the current value should be "37"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Given /^I am on the Progress Bar page$/ do
|
2
|
+
visit_page ProgressBarPage
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /^the minimum value should be "(.+)"$/ do |minimum_value|
|
6
|
+
on(ProgressBarPage).progress_bar.minimum.should == minimum_value.to_i
|
7
|
+
end
|
8
|
+
|
9
|
+
Then /^the maximum value should be "(.+)"$/ do |maximum_value|
|
10
|
+
on(ProgressBarPage).progress_bar.maximum.should == maximum_value.to_i
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^the current value should be "(.+)"$/ do |current_value|
|
14
|
+
on(ProgressBarPage).progress_bar.current.should == current_value.to_i
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Given /^I am on the tabs page$/ do
|
2
|
+
visit TabsPage
|
3
|
+
end
|
4
|
+
|
5
|
+
When /^I select the "(.+)" tab$/ do |label|
|
6
|
+
on(TabsPage).tabs.select(label)
|
7
|
+
end
|
8
|
+
|
9
|
+
Then /^the current tab should be "(.+)"$/ do |label|
|
10
|
+
on(TabsPage).tabs.selected.should == label
|
11
|
+
end
|
12
|
+
|
13
|
+
Then /^the tab labels should include "([^"]*)"$/ do |label|
|
14
|
+
on(TabsPage).tabs.labels.should include label
|
15
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class ProgressBarPage
|
2
|
+
include PageObject
|
3
|
+
|
4
|
+
page_url "file://#{File.expand_path(File.dirname(__FILE__) + '/../../html/progress_bar.html')}"
|
5
|
+
|
6
|
+
jqueryui_progress_bar(:progress_bar, :id => 'progressbar')
|
7
|
+
|
8
|
+
def progress_bar
|
9
|
+
progress_bar_element
|
10
|
+
end
|
11
|
+
end
|
data/features/tabs.feature
CHANGED
@@ -6,3 +6,12 @@ Feature: Using the jqueryui Tab widget
|
|
6
6
|
Scenario: Using the tabs widget
|
7
7
|
When I select the "Proin dolor" tab
|
8
8
|
Then I should see "Morbi tincidunt, dui sit amet"
|
9
|
+
|
10
|
+
Scenario: Selected Tab Should Be
|
11
|
+
When I select the "Proin dolor" tab
|
12
|
+
Then the current tab should be "Proin dolor"
|
13
|
+
|
14
|
+
Scenario: Getting All Tab Names
|
15
|
+
Then the tab labels should include "Nunc tincidunt"
|
16
|
+
And the tab labels should include "Proin dolor"
|
17
|
+
And the tab labels should include "Aenean lacinia"
|
data/jqueryui_widgets.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'jqueryui_widgets/version'
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "jqueryui_widgets"
|
8
8
|
gem.version = JQueryUIWidgets::VERSION
|
9
|
-
gem.authors = ["Jeffrey S. Morgan"]
|
10
|
-
gem.email = ["jeff.morgan@leandog.com"]
|
9
|
+
gem.authors = ["Jeffrey S. Morgan", "Paul Clewell"]
|
10
|
+
gem.email = ["jeff.morgan@leandog.com", "andrevarshea@gmail.com"]
|
11
11
|
gem.description = %q{Wrapper around jQueryUI controls for use with page-object gem}
|
12
12
|
gem.summary = %q{Wrapper around jQueryUI controls for use with page-object gem}
|
13
13
|
gem.homepage = "http://github.com/cheezy/jqueryui_widgets"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class JQueryUIWidgets::ProgressBar < PageObject::Elements::Div
|
2
|
+
|
3
|
+
def minimum
|
4
|
+
convert_to_number attribute('aria-valuemin')
|
5
|
+
end
|
6
|
+
|
7
|
+
def maximum
|
8
|
+
convert_to_number attribute('aria-valuemax')
|
9
|
+
end
|
10
|
+
|
11
|
+
def current
|
12
|
+
convert_to_number attribute('aria-valuenow')
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
def convert_to_number(value)
|
17
|
+
value = value.to_i if value
|
18
|
+
value
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -4,4 +4,11 @@ class JQueryUIWidgets::Tabs < PageObject::Elements::UnorderedList
|
|
4
4
|
link_element(:text => label).click
|
5
5
|
end
|
6
6
|
|
7
|
+
def selected
|
8
|
+
list_item_element(:class => 'ui-tabs-active').link_element.text
|
9
|
+
end
|
10
|
+
|
11
|
+
def labels
|
12
|
+
link_elements(:class => 'ui-tabs-anchor').map(&:text)
|
13
|
+
end
|
7
14
|
end
|
data/lib/jqueryui_widgets.rb
CHANGED
@@ -2,10 +2,12 @@ require 'page-object'
|
|
2
2
|
require "jqueryui_widgets/version"
|
3
3
|
require 'jqueryui_widgets/basic_dialog'
|
4
4
|
require 'jqueryui_widgets/tabs'
|
5
|
+
require 'jqueryui_widgets/progress_bar'
|
5
6
|
|
6
7
|
module JQueryUIWidgets
|
7
8
|
|
8
9
|
PageObject.register_widget(:jqueryui_basic_dialog, JQueryUIWidgets::BasicDialog, 'div')
|
9
10
|
PageObject.register_widget(:jqueryui_tabs, JQueryUIWidgets::Tabs, 'ul')
|
11
|
+
PageObject.register_widget(:jqueryui_progress_bar, JQueryUIWidgets::ProgressBar, 'div')
|
10
12
|
|
11
13
|
end
|
metadata
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jqueryui_widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jeffrey S. Morgan
|
9
|
+
- Paul Clewell
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2013-02-
|
13
|
+
date: 2013-02-23 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: page-object
|
@@ -62,6 +63,7 @@ dependencies:
|
|
62
63
|
description: Wrapper around jQueryUI controls for use with page-object gem
|
63
64
|
email:
|
64
65
|
- jeff.morgan@leandog.com
|
66
|
+
- andrevarshea@gmail.com
|
65
67
|
executables: []
|
66
68
|
extensions: []
|
67
69
|
extra_rdoc_files: []
|
@@ -80,19 +82,24 @@ files:
|
|
80
82
|
- features/html/jquery-1.9.1.js
|
81
83
|
- features/html/jquery-ui.css
|
82
84
|
- features/html/jquery-ui.js
|
85
|
+
- features/html/progress_bar.html
|
83
86
|
- features/html/style.css
|
84
87
|
- features/html/tabs.html
|
88
|
+
- features/progress_bar.feature
|
85
89
|
- features/step_definitions/basic_dialog_steps.rb
|
86
90
|
- features/step_definitions/common_steps.rb
|
87
|
-
- features/step_definitions/
|
91
|
+
- features/step_definitions/progress_bar_steps.rb
|
92
|
+
- features/step_definitions/tab_steps.rb
|
88
93
|
- features/support/env.rb
|
89
94
|
- features/support/hooks.rb
|
90
95
|
- features/support/pages/basic_dialog_page.rb
|
96
|
+
- features/support/pages/progress_bar_page.rb
|
91
97
|
- features/support/pages/tabs_page.rb
|
92
98
|
- features/tabs.feature
|
93
99
|
- jqueryui_widgets.gemspec
|
94
100
|
- lib/jqueryui_widgets.rb
|
95
101
|
- lib/jqueryui_widgets/basic_dialog.rb
|
102
|
+
- lib/jqueryui_widgets/progress_bar.rb
|
96
103
|
- lib/jqueryui_widgets/tabs.rb
|
97
104
|
- lib/jqueryui_widgets/version.rb
|
98
105
|
homepage: http://github.com/cheezy/jqueryui_widgets
|
@@ -109,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
116
|
version: '0'
|
110
117
|
segments:
|
111
118
|
- 0
|
112
|
-
hash:
|
119
|
+
hash: -2934056565885187705
|
113
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
121
|
none: false
|
115
122
|
requirements:
|
@@ -118,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
125
|
version: '0'
|
119
126
|
segments:
|
120
127
|
- 0
|
121
|
-
hash:
|
128
|
+
hash: -2934056565885187705
|
122
129
|
requirements: []
|
123
130
|
rubyforge_project:
|
124
131
|
rubygems_version: 1.8.24
|
@@ -131,13 +138,17 @@ test_files:
|
|
131
138
|
- features/html/jquery-1.9.1.js
|
132
139
|
- features/html/jquery-ui.css
|
133
140
|
- features/html/jquery-ui.js
|
141
|
+
- features/html/progress_bar.html
|
134
142
|
- features/html/style.css
|
135
143
|
- features/html/tabs.html
|
144
|
+
- features/progress_bar.feature
|
136
145
|
- features/step_definitions/basic_dialog_steps.rb
|
137
146
|
- features/step_definitions/common_steps.rb
|
138
|
-
- features/step_definitions/
|
147
|
+
- features/step_definitions/progress_bar_steps.rb
|
148
|
+
- features/step_definitions/tab_steps.rb
|
139
149
|
- features/support/env.rb
|
140
150
|
- features/support/hooks.rb
|
141
151
|
- features/support/pages/basic_dialog_page.rb
|
152
|
+
- features/support/pages/progress_bar_page.rb
|
142
153
|
- features/support/pages/tabs_page.rb
|
143
154
|
- features/tabs.feature
|