webdriver_utils 1.0.0 → 1.0.1

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: 414ee08e8c65ab9f86db33da2a7c82f33ba2f0fc
4
- data.tar.gz: 9c2a707c136a064790918e13e7f9dcab97937092
3
+ metadata.gz: d9cb9a64ddff456a38cdf812a48161b553e12dbb
4
+ data.tar.gz: 695eb4a59e85fcce004975fe1922810d943cff29
5
5
  SHA512:
6
- metadata.gz: 01cf392a85de71fa6240396fb6a7e89d28076bb60c05763cd54e47fc24ad07654574e82aa8658cf7ee3f3024014327b9ecd102bf70c12249fb2bbae68cca4102
7
- data.tar.gz: 5e0b605f6599a8dfe173ae6a65c04b92c103aa015c583553e454048310bce591a49a2982b207f9f0b6a5d41ea0df4fbb6b4d0d0dbcf4c6f4a6faa6fa5c06d7c5
6
+ metadata.gz: 5fc184d190d5bd70ee715cb517f2747aaa3dfd288283b0bfad6a56e1eae158f259a4d522f5a5bf0765faf31d7c58e868bcf5dc44c9c8bef68f0ae53f1338c8b3
7
+ data.tar.gz: 93003e6c2e44547e8c20cfb950e175aad0fb158994cd623c553938be1a1854b2dd61c74a6958652e0666b31020238ddf49b30fb9bb54a26b18f63bd95ed57729
@@ -1,7 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'selenium-webdriver'
3
3
 
4
- require_relative 'webdriver_utils/page'
5
4
  require_relative 'webdriver_utils/sauce'
6
5
  require_relative 'webdriver_utils/silence_gem_warnings'
7
6
  require_relative 'webdriver_utils/version'
@@ -1,17 +1,26 @@
1
1
  # top level sauce helper methods
2
2
 
3
+ # Returns sauce username if env is set and not empty.
4
+ # If env isn't defined then nil is returned.
3
5
  def sauce_user
4
- ENV['SAUCE_USERNAME']
6
+ env = ENV['SAUCE_USERNAME']
7
+ (env && !env.empty?) ? env : nil
5
8
  end
6
9
 
10
+ # Returns sauce key if env is set and not empty.
11
+ # If env isn't defined then nil is returned.
7
12
  def sauce_key
8
- ENV['SAUCE_ACCESS_KEY']
13
+ env = ENV['SAUCE_ACCESS_KEY']
14
+ (env && !env.empty?) ? env : nil
9
15
  end
10
16
 
17
+ # Returns true if both sauce user and sauce key are defined.
11
18
  def sauce?
12
- !!(sauce_user && sauce_key)
19
+ sauce_user && sauce_key
13
20
  end
14
21
 
22
+ # Returns true if env is set and not empty.
15
23
  def jenkins?
16
- !!ENV['JENKINS_SERVER_COOKIE']
24
+ env = ENV['JENKINS_SERVER_COOKIE']
25
+ env && !env.empty?
17
26
  end
@@ -1,4 +1,4 @@
1
1
  module WebDriverUtils
2
- VERSION = '1.0.0' unless defined? ::WebDriverUtils::VERSION
3
- DATE = '2015-06-19' unless defined? ::WebDriverUtils::DATE
2
+ VERSION = '1.0.1' unless defined? ::WebDriverUtils::VERSION
3
+ DATE = '2015-06-20' unless defined? ::WebDriverUtils::DATE
4
4
  end
data/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- # webdriver_utils [![Gem Version](https://badge.fury.io/rb/webdriver_utils.svg)](https://rubygems.org/gems/webdriver_utils) [![Build Status](https://travis-ci.org/bootstraponline/webdriver_utils.svg?branch=master)](https://travis-ci.org/bootstraponline/webdriver_utils)
1
+ # webdriver_utils [![Gem Version](https://badge.fury.io/rb/webdriver_utils.svg)](https://rubygems.org/gems/webdriver_utils) [![Build Status](https://travis-ci.org/bootstraponline/webdriver_utils.svg?branch=master)](https://travis-ci.org/bootstraponline/webdriver_utils) [![Dependency Status](https://gemnasium.com/bootstraponline/webdriver_utils.svg?nocache)](https://gemnasium.com/bootstraponline/webdriver_utils)
2
2
 
3
3
  WebDriver utility methods.
4
4
 
data/release_notes.md CHANGED
@@ -1,3 +1,13 @@
1
+ #### v1.0.1 2015-06-20
2
+
3
+ - [3864ea9](https://github.com/bootstraponline/webdriver_utils/commit/3864ea97c6fb0c10c09acddaa0e9c6cfbec6b61b) Release 1.0.1
4
+ - [05d369c](https://github.com/bootstraponline/webdriver_utils/commit/05d369c27435707025ae49477b554254efe00337) Update sauce helpers
5
+ - [cbf5517](https://github.com/bootstraponline/webdriver_utils/commit/cbf55173cda55be64fe1ea970c3e3e628bb6b344) Move page helpers to angular_webdriver
6
+ - [909b4e3](https://github.com/bootstraponline/webdriver_utils/commit/909b4e3da137467d08ed94ec575030b4adf32c85) Allow by/element/no_wait within block in page object
7
+ - [82d485d](https://github.com/bootstraponline/webdriver_utils/commit/82d485d3b66c6ea29b18804fee166b395a4842bf) Reuse page object once defined
8
+ - [204c1a4](https://github.com/bootstraponline/webdriver_utils/commit/204c1a40279cd5a7bcba06ed10d905096f0a1b9f) Add gemnasium badge
9
+
10
+
1
11
  #### v1.0.0 2015-06-19
2
12
 
3
13
  - [764a48d](https://github.com/bootstraponline/webdriver_utils/commit/764a48dcb01410e156023bf7da3567ab6abda18b) Release 1.0.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdriver_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-19 00:00:00.000000000 Z
11
+ date: 2015-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver
@@ -108,7 +108,6 @@ files:
108
108
  - Rakefile
109
109
  - Thorfile
110
110
  - lib/webdriver_utils.rb
111
- - lib/webdriver_utils/page.rb
112
111
  - lib/webdriver_utils/sauce.rb
113
112
  - lib/webdriver_utils/silence_gem_warnings.rb
114
113
  - lib/webdriver_utils/version.rb
@@ -1,23 +0,0 @@
1
- module WebDriverUtils
2
- class << self
3
- def require_all_pages glob_path=nil
4
- glob_path ||= File.join(Rake.application.original_dir, 'page', '**', '*.rb')
5
- Dir.glob(glob_path) { |file| require_relative file }
6
- end
7
-
8
- def define_page_methods opts={}
9
- method = opts.fetch(:method, :define_singleton_method)
10
- page_module = opts[:page_module] || raise('must set page_module')
11
- target_class = opts[:target_class] || raise('must set target_class')
12
- driver_object = opts[:watir] || opts[:driver] || raise('must set driver')
13
- page_module.constants.each do |page_class|
14
- # ButtonsPage => buttons_page
15
- # https://github.com/rails/rails/blob/daaa21bc7d20f2e4ff451637423a25ff2d5e75c7/activesupport/lib/active_support/inflector/methods.rb#L96
16
- page_name = page_class.to_s.gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase
17
- target_class.send(method, page_name) do
18
- page_module.const_get(page_class).new driver_object
19
- end
20
- end
21
- end
22
- end # class << self
23
- end # module WebDriverUtils