dojo_widgets 0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7764b04444747dd3c08da2c3415c78214ae7475b
4
+ data.tar.gz: ed1e5d4c00ef434b5f3481f3522f8cfdd8f9a29c
5
+ SHA512:
6
+ metadata.gz: a446faee102b53caf860c410332a3df309888374c32ccb250184e74be228da6b4ff6dbb55135c94a50f0e1f48b58dc03e3ffc36fc9e9c7fa14216f5d23195acb
7
+ data.tar.gz: 24fdcae0431c87d1267756e7dfa9d4e774bb93ae3ce7e13853fcc7c2dca854ced4be4db41da39e3958a91ecd990be821e6d9de8762608fbcf7562d85e1c26857
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/ChangeLog ADDED
@@ -0,0 +1,2 @@
1
+ === Version 0.1 / 2013-7-20
2
+ * Included basic implementation for the Accordion widget
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rake'
4
+ gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
5
+ gem 'guard-cucumber'
6
+ gem 'growl'
7
+
8
+ # Specify your gem's dependencies in dojo_widgets.gemspec
9
+ gemspec
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,25 @@
1
+ # DojoWidgets
2
+
3
+ This is a wrapper around some of the Dijit controls. The purpose is to make applications that use this UI control set easier to test using the [page-object](http://github.com/cheezy/page-object) gem.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'dojo_widgets'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install dojo_widgets
18
+
19
+ ## Contributing
20
+
21
+ 1. Fork it
22
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
23
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
24
+ 4. Push to the branch (`git push origin my-new-feature`)
25
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'dojo_widgets/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "dojo_widgets"
8
+ gem.version = DojoWidgets::VERSION
9
+ gem.license = 'MIT'
10
+ gem.authors = ["Jeffrey S. Morgan"]
11
+ gem.email = ["jeff.morgan@leandog.com"]
12
+ gem.description = %q{Wrapper around dijit controls for use with page-object gem}
13
+ gem.summary = %q{Wrapper around dijit controls for use with page-object gem}
14
+ gem.homepage = ""
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ["lib"]
20
+
21
+ gem.add_dependency 'page-object', '>= 0.9.1'
22
+
23
+ gem.add_development_dependency 'cucumber', '>= 1.3.2'
24
+ gem.add_development_dependency 'rspec', '>= 2.13'
25
+ end
@@ -0,0 +1,7 @@
1
+ Feature: The Accordion Widget
2
+
3
+ Scenario: Selecting a panel from the Accordion
4
+ Given I am on the dojo demo page
5
+ When I select the "Popups and Alerts" Accordion panel
6
+ Then the Accordion panel for "Popups and Alerts" should be visible
7
+
@@ -0,0 +1,11 @@
1
+ Given(/^I am on the dojo demo page$/) do
2
+ visit DojoDemoPage
3
+ end
4
+
5
+ When(/^I select the "(.*?)" Accordion panel$/) do |label|
6
+ on(DojoDemoPage).the_accordion.select_panel label
7
+ end
8
+
9
+ Then(/^the Accordion panel for "(.*?)" should be visible$/) do |label|
10
+ on(DojoDemoPage).the_accordion.panel_for(label).should be_visible
11
+ end
@@ -0,0 +1,16 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
2
+
3
+ require 'rspec/expectations'
4
+ require 'dojo_widgets'
5
+ require 'page-object'
6
+ require 'watir-webdriver'
7
+
8
+ World(PageObject::PageFactory)
9
+
10
+ Before do
11
+ @browser = Watir::Browser.new :firefox
12
+ end
13
+
14
+ After do
15
+ @browser.close
16
+ end
@@ -0,0 +1,18 @@
1
+ class DojoDemoPage
2
+ include PageObject
3
+
4
+ page_url 'http://demos.dojotoolkit.org/demos/themePreviewer/demo.html'
5
+
6
+ dojo_accordion(:the_accordion, :id => 'leftAccordion')
7
+
8
+ def initialize_page
9
+ wait_until(10) do
10
+ not div_element(:id => 'loader').visible?
11
+ end
12
+ end
13
+
14
+ def the_accordion
15
+ the_accordion_element
16
+ end
17
+
18
+ end
@@ -0,0 +1,10 @@
1
+ require "page-object"
2
+ require "dojo_widgets/version"
3
+ require "dojo_widgets/accordion"
4
+
5
+ module DojoWidgets
6
+
7
+ PageObject.register_widget(:dojo_accordion, DojoWidgets::Accordion, 'div')
8
+
9
+ end
10
+
@@ -0,0 +1,18 @@
1
+
2
+ module DojoWidgets
3
+ class Accordion < PageObject::Elements::Div
4
+
5
+ def select_panel(label)
6
+ span_element(:class => 'dijitAccordionText', :text => label).click
7
+ end
8
+
9
+ def panel_for(label)
10
+ panels = div_elements(:class => 'dijitAccordionInnerContainer')
11
+ the_panel = panels.find do |panel|
12
+ panel.span_element(:class => 'dijitAccordionText', :text => label)
13
+ end
14
+ the_panel.div_element(:class => 'dijitAccordionChildWrapper')
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,3 @@
1
+ module DojoWidgets
2
+ VERSION = "0.1"
3
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dojo_widgets
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Jeffrey S. Morgan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: page-object
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.9.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.9.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: cucumber
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.3.2
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: 1.3.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '2.13'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '2.13'
55
+ description: Wrapper around dijit controls for use with page-object gem
56
+ email:
57
+ - jeff.morgan@leandog.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - ChangeLog
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - dojo_widgets.gemspec
69
+ - features/accordion.feature
70
+ - features/step_definitions/dojo_demo_steps.rb
71
+ - features/support/env.rb
72
+ - features/support/pages/dojo_demo_page.rb
73
+ - lib/dojo_widgets.rb
74
+ - lib/dojo_widgets/accordion.rb
75
+ - lib/dojo_widgets/version.rb
76
+ homepage: ''
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.0.4
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Wrapper around dijit controls for use with page-object gem
100
+ test_files:
101
+ - features/accordion.feature
102
+ - features/step_definitions/dojo_demo_steps.rb
103
+ - features/support/env.rb
104
+ - features/support/pages/dojo_demo_page.rb