jqueryui_widgets 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ body {
2
+ font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
3
+ font-size: 62.5%;
4
+ }
@@ -0,0 +1,34 @@
1
+ <html lang="en">
2
+ <head>
3
+ <meta charset="utf-8" />
4
+ <title>jQuery UI Tabs - Default functionality</title>
5
+ <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
6
+ <script src="jquery-1.9.1.js"></script>
7
+ <script src="jquery-ui.js"></script>
8
+ <link rel="stylesheet" href="style.css" />
9
+ <script>
10
+ $(function() {
11
+ $( "#tabs" ).tabs();
12
+ });
13
+ </script>
14
+ </head>
15
+ <body>
16
+ <div id="tabs">
17
+ <ul>
18
+ <li><a href="#tabs-1">Nunc tincidunt</a></li>
19
+ <li><a href="#tabs-2">Proin dolor</a></li>
20
+ <li><a href="#tabs-3">Aenean lacinia</a></li>
21
+ </ul>
22
+ <div id="tabs-1">
23
+ <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
24
+ </div>
25
+ <div id="tabs-2">
26
+ <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
27
+ </div>
28
+ <div id="tabs-3">
29
+ <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>
30
+ <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
31
+ </div>
32
+ </div>
33
+ </body>
34
+ </html>
@@ -2,11 +2,11 @@ Given /^I am on the basic dialog page$/ do
2
2
  visit BasicDialogPage
3
3
  end
4
4
 
5
- Then /^the basic dialog title should be "([^"]*)"$/ do |title|
5
+ Then /^the basic dialog title should be "(.+)"$/ do |title|
6
6
  on(BasicDialogPage).basic_dialog.title.should == title
7
7
  end
8
8
 
9
- When /^the content should include "([^"]*)"$/ do |content|
9
+ When /^the content should include "(.+)"$/ do |content|
10
10
  on(BasicDialogPage).basic_dialog.content.should include content
11
11
  end
12
12
 
@@ -0,0 +1,3 @@
1
+ Then /^I should see "(.+)"$/ do |expected|
2
+ @current_page.text.should include expected
3
+ end
@@ -0,0 +1,7 @@
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
@@ -1,11 +1,9 @@
1
1
  class BasicDialogPage
2
2
  include PageObject
3
3
 
4
- page_url 'http://jqueryui.com/dialog'
5
-
6
- in_frame(:class => 'demo-frame') do |frame|
7
- jqueryui_basic_dialog(:basic_dialog, :class => 'ui-dialog', :frame => frame)
8
- end
4
+ page_url "file://#{File.expand_path(File.dirname(__FILE__) + '/../../html/basic_dialog.html')}"
5
+
6
+ jqueryui_basic_dialog(:basic_dialog, :class => 'ui-dialog')
9
7
 
10
8
  def basic_dialog
11
9
  basic_dialog_element
@@ -0,0 +1,11 @@
1
+ class TabsPage
2
+ include PageObject
3
+
4
+ page_url "file://#{File.expand_path(File.dirname(__FILE__) + '/../../html/tabs.html')}"
5
+
6
+ jqueryui_tabs(:tabs, :class => 'ui-tabs-nav')
7
+
8
+ def tabs
9
+ tabs_element
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ Feature: Using the jqueryui Tab widget
2
+
3
+ Background:
4
+ Given I am on the tabs page
5
+
6
+ Scenario: Using the tabs widget
7
+ When I select the "Proin dolor" tab
8
+ Then I should see "Morbi tincidunt, dui sit amet"
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.email = ["jeff.morgan@leandog.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
- gem.homepage = "http://github.com/cheezy/jqueryui-widgets"
13
+ gem.homepage = "http://github.com/cheezy/jqueryui_widgets"
14
14
 
15
15
  gem.files = `git ls-files`.split($/)
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,10 +1,11 @@
1
1
  require 'page-object'
2
2
  require "jqueryui_widgets/version"
3
3
  require 'jqueryui_widgets/basic_dialog'
4
+ require 'jqueryui_widgets/tabs'
4
5
 
5
6
  module JQueryUIWidgets
6
7
 
7
8
  PageObject.register_widget(:jqueryui_basic_dialog, JQueryUIWidgets::BasicDialog, 'div')
8
-
9
+ PageObject.register_widget(:jqueryui_tabs, JQueryUIWidgets::Tabs, 'ul')
9
10
 
10
11
  end
@@ -0,0 +1,7 @@
1
+ class JQueryUIWidgets::Tabs < PageObject::Elements::UnorderedList
2
+
3
+ def select(label)
4
+ link_element(:text => label).click
5
+ end
6
+
7
+ end
@@ -1,3 +1,3 @@
1
1
  module JQueryUIWidgets
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
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.1'
4
+ version: '0.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-02 00:00:00.000000000 Z
12
+ date: 2013-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: page-object
@@ -67,6 +67,8 @@ extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
69
  - .gitignore
70
+ - .rvmrc
71
+ - ChangeLog
70
72
  - Gemfile
71
73
  - Guardfile
72
74
  - LICENSE.txt
@@ -74,15 +76,26 @@ files:
74
76
  - Rakefile
75
77
  - cucumber.yml
76
78
  - features/basic_dialog.feature
79
+ - features/html/basic_dialog.html
80
+ - features/html/jquery-1.9.1.js
81
+ - features/html/jquery-ui.css
82
+ - features/html/jquery-ui.js
83
+ - features/html/style.css
84
+ - features/html/tabs.html
77
85
  - features/step_definitions/basic_dialog_steps.rb
86
+ - features/step_definitions/common_steps.rb
87
+ - features/step_definitions/tab_stpes.rb
78
88
  - features/support/env.rb
79
89
  - features/support/hooks.rb
80
90
  - features/support/pages/basic_dialog_page.rb
91
+ - features/support/pages/tabs_page.rb
92
+ - features/tabs.feature
81
93
  - jqueryui_widgets.gemspec
82
94
  - lib/jqueryui_widgets.rb
83
95
  - lib/jqueryui_widgets/basic_dialog.rb
96
+ - lib/jqueryui_widgets/tabs.rb
84
97
  - lib/jqueryui_widgets/version.rb
85
- homepage: http://github.com/cheezy/jqueryui-widgets
98
+ homepage: http://github.com/cheezy/jqueryui_widgets
86
99
  licenses: []
87
100
  post_install_message:
88
101
  rdoc_options: []
@@ -96,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
96
109
  version: '0'
97
110
  segments:
98
111
  - 0
99
- hash: 3243817440089572801
112
+ hash: 2251152469367588668
100
113
  required_rubygems_version: !ruby/object:Gem::Requirement
101
114
  none: false
102
115
  requirements:
@@ -105,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
118
  version: '0'
106
119
  segments:
107
120
  - 0
108
- hash: 3243817440089572801
121
+ hash: 2251152469367588668
109
122
  requirements: []
110
123
  rubyforge_project:
111
124
  rubygems_version: 1.8.24
@@ -114,7 +127,17 @@ specification_version: 3
114
127
  summary: Wrapper around jQueryUI controls for use with page-object gem
115
128
  test_files:
116
129
  - features/basic_dialog.feature
130
+ - features/html/basic_dialog.html
131
+ - features/html/jquery-1.9.1.js
132
+ - features/html/jquery-ui.css
133
+ - features/html/jquery-ui.js
134
+ - features/html/style.css
135
+ - features/html/tabs.html
117
136
  - features/step_definitions/basic_dialog_steps.rb
137
+ - features/step_definitions/common_steps.rb
138
+ - features/step_definitions/tab_stpes.rb
118
139
  - features/support/env.rb
119
140
  - features/support/hooks.rb
120
141
  - features/support/pages/basic_dialog_page.rb
142
+ - features/support/pages/tabs_page.rb
143
+ - features/tabs.feature