page_object 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5daee20accfb18f8c4f1adc3a09b393d0dd440c
4
- data.tar.gz: e7f299c37a39148f11e71089b98b7ce09b6a3a5a
3
+ metadata.gz: cf3cf481702ee92e87f03cbe730ea93da1c4b447
4
+ data.tar.gz: b33a2c7db6e74bc89d616a82482e2beb8ed45e52
5
5
  SHA512:
6
- metadata.gz: 62ca3cf3d47db792139911becaeaea12be23484bb28769918d984e49359dc9408a5d2397c7b2b05a85c945bc54a99c899265698d5e6791bf2c8a20e447db9663
7
- data.tar.gz: 6b0cbd370727190bfe546c2c5a9c8685090502ec3c0620710e30676128c2d9fae87c2516a6c8f0cca9abae9098211c48eda0f620e2d1e656b2bd9ed914b4f4e5
6
+ metadata.gz: c1c31af37e925102ef7084f0369eba147589f70d97a711b3f39e84123c68e66124c565fa077d2147eaf85367556ec182a0df3b1aba49f8b3240f618bb3d2edee
7
+ data.tar.gz: 07e5952c8fe569dc40bbc68e04f84dcfa84dbf8f8a348fc1535e9514d8cb01e2a59a6284727f1731a7695b7328aa66f35d7abfd5e3c983609b38881740ed0994
@@ -0,0 +1 @@
1
+ service_name: travis-ci
@@ -1,7 +1,13 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  rvm:
3
4
  - 2.2.2
4
-
5
5
  before_script:
6
6
  - "export DISPLAY=:99.0"
7
7
  - "sh -e /etc/init.d/xvfb start"
8
+ script:
9
+ - bundle exec rake test_with_coveralls
10
+ notifications:
11
+ email:
12
+ on_success: never
13
+ on_failure: never
data/Gemfile CHANGED
@@ -9,6 +9,7 @@ gem 'growl'
9
9
  gem 'guard-rspec'
10
10
  gem 'guard-cucumber'
11
11
  gem 'net-http-persistent'
12
+ gem 'coveralls', require: false
12
13
 
13
14
 
14
15
  gemspec
data/README.md CHANGED
@@ -1,8 +1,13 @@
1
- # page-object
1
+ # page_object
2
2
 
3
- [![Build Status](https://travis-ci.org/cheezy/page-object.png)](https://travis-ci.org/cheezy/page-object)
3
+ [![Gem Version](https://badge.fury.io/rb/page_object.svg)](https://rubygems.org/gems/page_object)
4
+ [![Build Status](https://travis-ci.org/bootstraponline/page_object.svg?nocache)](https://travis-ci.org/bootstraponline/page_object/builds)
5
+ [![Coverage Status](https://coveralls.io/repos/bootstraponline/page_object/badge.svg?nocache)](https://coveralls.io/r/bootstraponline/page_object)
6
+ [![Dependency Status](https://gemnasium.com/bootstraponline/page_object.svg?nocache)](https://gemnasium.com/bootstraponline/page_object)
4
7
 
5
8
 
9
+ `page_object` is a fork of the page-object gem with bug fixes.
10
+
6
11
  A simple gem that assists in creating flexible page objects for testing browser based applications. The goal is to facilitate creating abstraction layers in your tests to decouple the tests from the item they are testing and to provide a simple interface to the elements on a page. It works with both watir-webdriver and selenium-webdriver.
7
12
 
8
13
  ## Documentation
data/Rakefile CHANGED
@@ -3,6 +3,8 @@ require 'bundler'
3
3
  require 'rspec/core/rake_task'
4
4
  require 'cucumber'
5
5
  require 'cucumber/rake/task'
6
+ require 'coveralls/rake/task'
7
+ Coveralls::RakeTask.new
6
8
 
7
9
  Bundler::GemHelper.install_tasks
8
10
 
@@ -32,4 +34,6 @@ task :lib do
32
34
  $LOAD_PATH.unshift(File.expand_path("lib", File.dirname(__FILE__)))
33
35
  end
34
36
 
35
- task :default => :test
37
+ task :test_with_coveralls => [:test, 'coveralls:push']
38
+
39
+ task :default => :test_with_coveralls
@@ -0,0 +1,6 @@
1
+ require 'appium_thor'
2
+
3
+ Appium::Thor::Config.set do
4
+ gem_name 'page_object'
5
+ github_owner 'bootstraponline'
6
+ end
@@ -207,7 +207,7 @@ module PageObject
207
207
  # * :xpath => Watir and Selenium
208
208
  # @param optional block to be invoked when element method is called
209
209
  #
210
- def text_field(name, identifier={:index => 0}, &block)
210
+ def text_field(name, identifier={:index => 0}, &block)
211
211
  standard_methods(name, identifier, 'text_field_for', &block)
212
212
  define_method(name) do
213
213
  return platform.text_field_value_for identifier.clone unless block_given?
@@ -402,7 +402,7 @@ module PageObject
402
402
  end
403
403
 
404
404
  #
405
- # adds four methods - one to select, another to return if a radio button
405
+ # adds four methods - one to select, another to return if a radio button
406
406
  # is selected, another method to return a PageObject::Elements::RadioButton
407
407
  # object representing the radio button element, and another to check
408
408
  # the radio button's existence.
@@ -1219,7 +1219,20 @@ module PageObject
1219
1219
  # * :xpath => Watir and Selenium
1220
1220
  # @param optional block to be invoked when element method is called
1221
1221
  #
1222
- def element(name, tag, identifier={:index => 0}, &block)
1222
+ def element(name, tag=:element, identifier={ :index => 0 }, &block)
1223
+ # default tag to :element
1224
+ #
1225
+ # element 'button', css: 'some css'
1226
+ #
1227
+ # is the same as
1228
+ #
1229
+ # element 'button', :element, css: 'some css'
1230
+ #
1231
+ if tag.is_a?(Hash)
1232
+ identifier = tag
1233
+ tag = :element
1234
+ end
1235
+
1223
1236
  define_method("#{name}") do
1224
1237
  self.send("#{name}_element").text
1225
1238
  end
@@ -1252,7 +1265,20 @@ module PageObject
1252
1265
  # * :xpath => Watir and Selenium
1253
1266
  # @param optional block to be invoked when element method is called
1254
1267
  #
1255
- def elements(name, tag, identifier={:index => 0}, &block)
1268
+ def elements(name, tag=:element, identifier={:index => 0}, &block)
1269
+ # default tag to :element
1270
+ #
1271
+ # elements 'button', css: 'some css'
1272
+ #
1273
+ # is the same as
1274
+ #
1275
+ # elements 'button', :element, css: 'some css'
1276
+ #
1277
+ if tag.is_a?(Hash)
1278
+ identifier = tag
1279
+ tag = :element
1280
+ end
1281
+
1256
1282
  define_method("#{name}_elements") do
1257
1283
  return call_block(&block) if block_given?
1258
1284
  platform.elements_for(tag, identifier.clone)
@@ -1,4 +1 @@
1
- module PageObject
2
- # @private
3
- VERSION = '1.1.1'
4
- end
1
+ require_relative '../page_object/version'
@@ -0,0 +1,5 @@
1
+ module PageObject
2
+ # @private
3
+ VERSION = '1.1.2' unless defined? ::PageObject::VERSION
4
+ DATE = '2015-06-19' unless defined? ::PageObject::DATE
5
+ end
@@ -27,5 +27,6 @@ Gem::Specification.new do |s|
27
27
  s.add_development_dependency 'yard', '>= 0.7.2'
28
28
  s.add_development_dependency 'rack', '>= 1.0'
29
29
  s.add_development_dependency 'coveralls', '~> 0.8.1'
30
-
30
+ s.add_development_dependency 'appium_thor', '>= 0.0.7'
31
+ s.add_development_dependency 'thor', '>= 0.19.1'
31
32
  end
@@ -2,13 +2,14 @@
2
2
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
4
 
5
- if ENV['coverage']
6
- raise 'simplecov only works on Ruby 1.9' unless RUBY_VERSION =~ /^1\.9/
5
+ require 'simplecov'
6
+ require 'coveralls'
7
7
 
8
- require 'simplecov'
9
- require 'coveralls'
10
- SimpleCov.start { add_filter 'spec/' }
11
- end
8
+ # Omit coveralls formatter since we're merging suite results via a Rake task
9
+ # https://coveralls.zendesk.com/hc/en-us/articles/201769485-Ruby-Rails
10
+ SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter]
11
+
12
+ SimpleCov.start { add_filter 'spec/' }
12
13
 
13
14
  require 'rspec'
14
15
  require 'watir-webdriver'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: page_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Morgan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-17 00:00:00.000000000 Z
12
+ date: 2015-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: watir-webdriver
@@ -123,6 +123,34 @@ dependencies:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
125
  version: 0.8.1
126
+ - !ruby/object:Gem::Dependency
127
+ name: appium_thor
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 0.0.7
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: 0.0.7
140
+ - !ruby/object:Gem::Dependency
141
+ name: thor
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: 0.19.1
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: 0.19.1
126
154
  description: Page Object DSL that works with both Watir and Selenium
127
155
  email:
128
156
  - jeff.morgan@leandog.com
@@ -131,10 +159,9 @@ executables: []
131
159
  extensions: []
132
160
  extra_rdoc_files: []
133
161
  files:
162
+ - ".coveralls.yml"
134
163
  - ".gitignore"
135
164
  - ".rspec"
136
- - ".ruby-gemset"
137
- - ".ruby-version"
138
165
  - ".travis.yml"
139
166
  - ChangeLog
140
167
  - Gemfile
@@ -142,6 +169,7 @@ files:
142
169
  - LICENSE
143
170
  - README.md
144
171
  - Rakefile
172
+ - Thorfile
145
173
  - cucumber.yml
146
174
  - features/area.feature
147
175
  - features/async.feature
@@ -353,8 +381,8 @@ files:
353
381
  - lib/page-object/sections.rb
354
382
  - lib/page-object/version.rb
355
383
  - lib/page-object/widgets.rb
384
+ - lib/page_object/version.rb
356
385
  - page_object.gemspec
357
- - pageobject.gems
358
386
  - spec/page-object/accessors_spec.rb
359
387
  - spec/page-object/element_locators_spec.rb
360
388
  - spec/page-object/elements/area_spec.rb
@@ -1 +0,0 @@
1
- page-object
@@ -1 +0,0 @@
1
- ruby-2.1.2
@@ -1 +0,0 @@
1
- bundler