jqueryui_widgets 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +18 -0
- data/Gemfile +8 -0
- data/Guardfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/cucumber.yml +7 -0
- data/features/basic_dialog.feature +14 -0
- data/features/step_definitions/basic_dialog_steps.rb +20 -0
- data/features/support/env.rb +7 -0
- data/features/support/hooks.rb +28 -0
- data/features/support/pages/basic_dialog_page.rb +14 -0
- data/jqueryui_widgets.gemspec +24 -0
- data/lib/jqueryui_widgets.rb +10 -0
- data/lib/jqueryui_widgets/basic_dialog.rb +15 -0
- data/lib/jqueryui_widgets/version.rb +3 -0
- metadata +120 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
guard 'cucumber', :notification => false, :all_after_pass => false, :cli => '--profile focus' do
|
2
|
+
watch(%r{^features/.+\.feature$})
|
3
|
+
watch(%r{^features/support/.+$}) { 'features' }
|
4
|
+
watch(%r{^features/step_definitions/(.+)_steps\.rb$}) { 'features' }
|
5
|
+
watch(%r{^lib/.+\.rb$}) { 'features' }
|
6
|
+
watch(%r{^cucumber.yml$}) { 'features' }
|
7
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Jeffrey S. Morgan
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# JqueryuiWidgets
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'jqueryui_widgets'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install jqueryui_widgets
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/cucumber.yml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<% std_opts = '--no-source --color --format pretty' %>
|
2
|
+
|
3
|
+
default: DRIVER=WATIR <%= std_opts %>
|
4
|
+
watir_webdriver: DRIVER=WATIR <%= std_opts %>
|
5
|
+
selenium_webdriver: DRIVER=SELENIUM <%= std_opts %>
|
6
|
+
focus: DRIVER=WATIR <%= std_opts %> --tags @focus
|
7
|
+
#focus: DRIVER=SELENIUM <%= std_opts %> -tags @focus
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: Using the jqueryui_dialog BasicDialog widget
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given I am on the basic dialog page
|
5
|
+
|
6
|
+
Scenario: Getting information from the page
|
7
|
+
Then the basic dialog title should be "Basic dialog"
|
8
|
+
And the content should include "This is the default dialog"
|
9
|
+
|
10
|
+
@focus
|
11
|
+
Scenario: Closing the dialog
|
12
|
+
When I close the basic dialog
|
13
|
+
Then the basic dialog should not be visible
|
14
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Given /^I am on the basic dialog page$/ do
|
2
|
+
visit BasicDialogPage
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /^the basic dialog title should be "([^"]*)"$/ do |title|
|
6
|
+
on(BasicDialogPage).basic_dialog.title.should == title
|
7
|
+
end
|
8
|
+
|
9
|
+
When /^the content should include "([^"]*)"$/ do |content|
|
10
|
+
on(BasicDialogPage).basic_dialog.content.should include content
|
11
|
+
end
|
12
|
+
|
13
|
+
When /^I close the basic dialog$/ do
|
14
|
+
on(BasicDialogPage).basic_dialog.close
|
15
|
+
end
|
16
|
+
|
17
|
+
Then /^the basic dialog should not be visible$/ do
|
18
|
+
on(BasicDialogPage).basic_dialog.should_not be_visible
|
19
|
+
end
|
20
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'watir-webdriver'
|
2
|
+
require 'selenium-webdriver'
|
3
|
+
|
4
|
+
module PersistentBrowser
|
5
|
+
|
6
|
+
@@browser = false
|
7
|
+
|
8
|
+
def self.get_browser
|
9
|
+
unless @@browser
|
10
|
+
@@browser = Watir::Browser.new :firefox if ENV['DRIVER'] == 'WATIR'
|
11
|
+
@@browser = Selenium::WebDriver.for :firefox if ENV['DRIVER'] == 'SELENIUM'
|
12
|
+
end
|
13
|
+
@@browser
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.quit
|
17
|
+
@@browser.quit
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
Before do
|
22
|
+
@browser = PersistentBrowser.get_browser
|
23
|
+
end
|
24
|
+
|
25
|
+
at_exit do
|
26
|
+
PersistentBrowser.quit
|
27
|
+
end
|
28
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class BasicDialogPage
|
2
|
+
include PageObject
|
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
|
9
|
+
|
10
|
+
def basic_dialog
|
11
|
+
basic_dialog_element
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jqueryui_widgets/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "jqueryui_widgets"
|
8
|
+
gem.version = JQueryUIWidgets::VERSION
|
9
|
+
gem.authors = ["Jeffrey S. Morgan"]
|
10
|
+
gem.email = ["jeff.morgan@leandog.com"]
|
11
|
+
gem.description = %q{Wrapper around jQueryUI controls for use with page-object gem}
|
12
|
+
gem.summary = %q{Wrapper around jQueryUI controls for use with page-object gem}
|
13
|
+
gem.homepage = "http://github.com/cheezy/jqueryui-widgets"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_dependency 'page-object', '>= 0.8.0'
|
21
|
+
|
22
|
+
gem.add_development_dependency 'cucumber', '>= 1.2.0'
|
23
|
+
gem.add_development_dependency 'rspec', '>= 2.12'
|
24
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class JQueryUIWidgets::BasicDialog < PageObject::Elements::Div
|
2
|
+
|
3
|
+
def title
|
4
|
+
div_element(:class => 'ui-dialog-titlebar').span_element.text
|
5
|
+
end
|
6
|
+
|
7
|
+
def content
|
8
|
+
div_element(:class => 'ui-dialog-content').text
|
9
|
+
end
|
10
|
+
|
11
|
+
def close
|
12
|
+
button_element(:class => 'ui-dialog-titlebar-close').click
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jqueryui_widgets
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jeffrey S. Morgan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: page-object
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.8.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.8.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: cucumber
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.2.0
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.2.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '2.12'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.12'
|
62
|
+
description: Wrapper around jQueryUI controls for use with page-object gem
|
63
|
+
email:
|
64
|
+
- jeff.morgan@leandog.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- .gitignore
|
70
|
+
- Gemfile
|
71
|
+
- Guardfile
|
72
|
+
- LICENSE.txt
|
73
|
+
- README.md
|
74
|
+
- Rakefile
|
75
|
+
- cucumber.yml
|
76
|
+
- features/basic_dialog.feature
|
77
|
+
- features/step_definitions/basic_dialog_steps.rb
|
78
|
+
- features/support/env.rb
|
79
|
+
- features/support/hooks.rb
|
80
|
+
- features/support/pages/basic_dialog_page.rb
|
81
|
+
- jqueryui_widgets.gemspec
|
82
|
+
- lib/jqueryui_widgets.rb
|
83
|
+
- lib/jqueryui_widgets/basic_dialog.rb
|
84
|
+
- lib/jqueryui_widgets/version.rb
|
85
|
+
homepage: http://github.com/cheezy/jqueryui-widgets
|
86
|
+
licenses: []
|
87
|
+
post_install_message:
|
88
|
+
rdoc_options: []
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
hash: 3243817440089572801
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ! '>='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
hash: 3243817440089572801
|
109
|
+
requirements: []
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 1.8.24
|
112
|
+
signing_key:
|
113
|
+
specification_version: 3
|
114
|
+
summary: Wrapper around jQueryUI controls for use with page-object gem
|
115
|
+
test_files:
|
116
|
+
- features/basic_dialog.feature
|
117
|
+
- features/step_definitions/basic_dialog_steps.rb
|
118
|
+
- features/support/env.rb
|
119
|
+
- features/support/hooks.rb
|
120
|
+
- features/support/pages/basic_dialog_page.rb
|