gless 1.6.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.txt +24 -6
- data/examples/test_github/features/support/env.rb +1 -2
- data/examples/test_github/lib/config/development.yml.example +18 -6
- data/lib/gless.rb +3 -7
- data/lib/gless/browser.rb +13 -8
- data/lib/gless/config.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b15a2376bbf1adff76a9ac467fee021e9f05e85
|
4
|
+
data.tar.gz: 3dc288ba9043ca99d99d434a1602364c4ed243e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9b8e9ce610408ddd67b669ec47c44a6b1340b5ab01ce886bcaa168cf64b29c3edc2306894daf5041708ee225ff4695f6e20b6edcb9351d76c35979f891d8216
|
7
|
+
data.tar.gz: 75169a727bdbe88082f88b4bebf8c1263765fc36bc6145095c4bf9f42710999fa3103544402f75a81e3d43a3dced7ccd92f3662651eb957869fd7935751e1c4b
|
data/Changelog.txt
CHANGED
@@ -1,9 +1,27 @@
|
|
1
1
|
- 1.1.0: 29 Jan 2013: By default, "element"s now ignore non-visible
|
2
|
-
|
3
|
-
|
2
|
+
elements on the page; use { :invisible => true } to get the
|
3
|
+
old behaviour.
|
4
4
|
- 1.2.0: 10 Jun 2013: Changes by bairyn. Added caching, finding
|
5
|
-
based on parent element, and block validators.
|
5
|
+
based on parent element, and block validators.
|
6
6
|
- 1.3.0: 8 Aug 2013: Detect and work around errors caused by incorrect caching,
|
7
|
-
and add support for element arguments, evaluating elements
|
8
|
-
finding based on children, and the
|
9
|
-
matches a
|
7
|
+
and add support for element arguments, evaluating elements
|
8
|
+
under new parents, finding based on children, and the
|
9
|
+
:unique option to ensure only one element matches a
|
10
|
+
specification.
|
11
|
+
- 1.3.1: 19 Aug 2013: Typo fix.
|
12
|
+
- 1.4.0: 9 Sep 2013: Support for Sauce Labs related browser
|
13
|
+
capabilities via options under the :browser option in the
|
14
|
+
config file.
|
15
|
+
- 1.4.1: 11 Sep 2013: More Sauce-specific options.
|
16
|
+
- 1.4.2: 13 Sep 2013: Specified a license.
|
17
|
+
- 1.5.0: 21 Sep 2013: Better error reporting, deep_merge, click_once
|
18
|
+
with change_pages
|
19
|
+
- 1.5.1: 25 Oct 2013: Support for no config file.
|
20
|
+
- 1.5.2: 23 Feb 2014: Don't depend on Ruby's class creation order.
|
21
|
+
- 1.6.0: 3 Mar 2014: Allow the replay log to be completely disabled.
|
22
|
+
- 1.6.1: 3 Mar 2014: Let the logger decide want to log, instead of
|
23
|
+
always checking the config state.
|
24
|
+
- 2.0.0: 27 Mar 2014: Non-backwards-compatible changes to handling
|
25
|
+
of both extra browser capabilities and tags. The former is
|
26
|
+
now under :browser => :extras in the config file, and the
|
27
|
+
latter under :tag in the config file.
|
@@ -7,8 +7,7 @@ World(RSpec::Expectations)
|
|
7
7
|
Before do
|
8
8
|
require 'gless'
|
9
9
|
|
10
|
-
|
11
|
-
@logger, @config, @browser = Gless.setup( :test )
|
10
|
+
@logger, @config, @browser = Gless.setup()
|
12
11
|
|
13
12
|
if @config.get :global, :debug
|
14
13
|
require 'debugger'
|
@@ -6,13 +6,20 @@
|
|
6
6
|
:type: remote # Local or remote
|
7
7
|
:browser: chrome # Which browser to use; "ie", "chrome", and "firefox" are definitely valid, there may be others
|
8
8
|
:port: 4444 # If remote, port to connect to the selenium server, otherwise ignored
|
9
|
-
# These options would normally only be used with something like
|
10
|
-
#
|
9
|
+
# These options would normally only be used with something like SauceLabs
|
10
|
+
#
|
11
11
|
# :url: "http://rlpowell:[snip]@ondemand.saucelabs.com:80/wd/hub" # The URL Sauce gives you
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
12
|
+
#
|
13
|
+
# "extras" is where special things are defined to add to the
|
14
|
+
# browser capabilities list; used for stuff like Sauce
|
15
|
+
# parameters.
|
16
|
+
#
|
17
|
+
# :extras:
|
18
|
+
# :version: 27 # The browser version to use
|
19
|
+
# :platform: 'Windows 7' # The OS to use
|
20
|
+
# :"idle-timeout": 600 # Sauce specific
|
21
|
+
# :"max-duration": 5400 # Sauce specific
|
22
|
+
# :name: "default job name" # Sauce specific
|
16
23
|
:verbose: false # Whether to engage in more verbose/info level logging
|
17
24
|
:debug: false # Whether to engage in debug logging
|
18
25
|
:replay: false # Whether to create a replay log, which shows html for each step of operations
|
@@ -21,3 +28,8 @@
|
|
21
28
|
:screenshots: false # Whether, if debugging is on, to create screenshots as part of the replay log
|
22
29
|
:thumbnails: false # Whether, if screenshots are on, to create small-ish "thumbnail" pictures on the replay page; requires the imagemagick system package and the mini_magick gem
|
23
30
|
:cache: false # Whether, by default, to cache elements, significantly improving performance. For individual elements, caching can be disabled by adding ":cache => false" to the element specifier.
|
31
|
+
|
32
|
+
# A short name used in creating log lines and writing out the
|
33
|
+
# replay log and so on. Only really relevant if multiple runs are
|
34
|
+
# happening at once.
|
35
|
+
:tag: "notag"
|
data/lib/gless.rb
CHANGED
@@ -6,17 +6,13 @@
|
|
6
6
|
# project.
|
7
7
|
module Gless
|
8
8
|
# The current version number.
|
9
|
-
VERSION = '
|
9
|
+
VERSION = '2.0.0'
|
10
10
|
|
11
11
|
# Sets up the config, logger and browser instances, the ordering
|
12
12
|
# of which is slightly tricky. If a block is given, the config, after being
|
13
13
|
# initialized from the config file, is passed to the block, which should
|
14
14
|
# return the new, updated config.
|
15
15
|
#
|
16
|
-
# @param [String] tag A short name used in creating log lines and
|
17
|
-
# writing out the replay log and so on. Only really relevant if
|
18
|
-
# multiple runs are happening at once.
|
19
|
-
#
|
20
16
|
# @param [Hash] hash Defaults to +nil+, which is ignored. If
|
21
17
|
# present, this hash is used intead of reading a config file; the
|
22
18
|
# config file is totally ignored in this case.
|
@@ -25,13 +21,13 @@ module Gless
|
|
25
21
|
# optional block should return an updated config if given.
|
26
22
|
#
|
27
23
|
# @return [Gless::Logger, Gless::EnvConfig, Gless::Browser] logger, config, browser (in that order)
|
28
|
-
def self.setup(
|
24
|
+
def self.setup( hash = nil )
|
29
25
|
# Create the config reading/storage object
|
30
26
|
config = Gless::EnvConfig.new( hash )
|
31
27
|
config = yield config if block_given?
|
32
28
|
|
33
29
|
logger = Gless::Logger.new(
|
34
|
-
tag,
|
30
|
+
config.get_default( "notag", :global, :tag ),
|
35
31
|
config.get_default( false, :global, :replay ),
|
36
32
|
config.get_default( '%{home}/public_html/watir_replay/%{tag}', :global, :replay_path )
|
37
33
|
)
|
data/lib/gless/browser.rb
CHANGED
@@ -19,14 +19,17 @@ module Gless
|
|
19
19
|
def initialize( config, logger )
|
20
20
|
@config = config
|
21
21
|
@logger = logger
|
22
|
+
|
23
|
+
@logger.debug "Requested browser config: #{@config.get :global, :browser }"
|
24
|
+
|
22
25
|
type=@config.get :global, :browser, :type
|
23
26
|
browser=@config.get :global, :browser, :browser
|
24
27
|
port=@config.get :global, :browser, :port
|
25
28
|
url=@config.get_default false, :global, :browser, :url
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
29
|
+
extra_capabilities=@config.get_default false, :global, :browser, :extras
|
30
|
+
if ! extra_capabilities
|
31
|
+
extra_capabilities = Hash.new
|
32
|
+
end
|
30
33
|
|
31
34
|
if browser =~ %r{^\s*ie\s*$} or browser =~ %r{^\s*internet\s*_?\s*explorer\s*$}
|
32
35
|
browser = 'internet explorer'
|
@@ -41,11 +44,13 @@ module Gless
|
|
41
44
|
:javascript_enabled=>true,
|
42
45
|
:css_selectors_enabled=>true,
|
43
46
|
:takes_screenshot=>true,
|
44
|
-
:'max-duration' => max_duration,
|
45
|
-
:'idle-timeout' => idle_timeout,
|
46
|
-
:version => browser_version,
|
47
|
-
:platform => platform
|
48
47
|
)
|
48
|
+
# Load in any other stuff the user asked for
|
49
|
+
@logger.debug "Requested extra capabilities: #{extra_capabilities.inspect}"
|
50
|
+
extra_capabilities.each do |key, value|
|
51
|
+
@logger.debug "Adding capability #{key} with value #{value}"
|
52
|
+
capabilities[key] = value
|
53
|
+
end
|
49
54
|
|
50
55
|
if url
|
51
56
|
@logger.debug "Launching with custom url #{url}"
|
data/lib/gless/config.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Lee Powell
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|