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 +4 -4
- data/lib/webdriver_utils.rb +0 -1
- data/lib/webdriver_utils/sauce.rb +13 -4
- data/lib/webdriver_utils/version.rb +2 -2
- data/readme.md +1 -1
- data/release_notes.md +10 -0
- metadata +2 -3
- data/lib/webdriver_utils/page.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9cb9a64ddff456a38cdf812a48161b553e12dbb
|
4
|
+
data.tar.gz: 695eb4a59e85fcce004975fe1922810d943cff29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fc184d190d5bd70ee715cb517f2747aaa3dfd288283b0bfad6a56e1eae158f259a4d522f5a5bf0765faf31d7c58e868bcf5dc44c9c8bef68f0ae53f1338c8b3
|
7
|
+
data.tar.gz: 93003e6c2e44547e8c20cfb950e175aad0fb158994cd623c553938be1a1854b2dd61c74a6958652e0666b31020238ddf49b30fb9bb54a26b18f63bd95ed57729
|
data/lib/webdriver_utils.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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.
|
3
|
-
DATE = '2015-06-
|
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.
|
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-
|
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
|
data/lib/webdriver_utils/page.rb
DELETED
@@ -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
|