browsed 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/browsed/client.rb +9 -1
- data/lib/browsed/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7134f8076720d3ac8c06ece828213da9582aa696b5cc3de87a4b2bd761416e0
|
4
|
+
data.tar.gz: 792c0861d2825fb28ff44521bfdf2d679f1df8479b769077b70672f3fd3f1807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6df46b2a370d4397247e66cca64f67e93b1ca96fe4b1cdc91ec391d49aebc8f3a3a68f15ddc2df216feafb2d643bf8e48ad83c4a36fc785ebefc5f94d1bf377e
|
7
|
+
data.tar.gz: bdc851d90b9e4a64c57093f4bfb6536b0443054ab5acb2ba1c291566b0fc31500d1b0e911d7a0ec671ccc4dd4f26c1ba4fa9f5f9c66a45b608412ce7fe6aed34
|
data/Gemfile.lock
CHANGED
data/lib/browsed/client.rb
CHANGED
@@ -53,6 +53,10 @@ module Browsed
|
|
53
53
|
Capybara.default_max_wait_time = driver_options.fetch(:wait_time, 30) #seconds
|
54
54
|
|
55
55
|
self.session = Capybara::Session.new(self.driver)
|
56
|
+
|
57
|
+
if self.resolution&.any? && !self.driver.eql?(:poltergeist) # Resolution for Poltergeist is set in the driver
|
58
|
+
self.session.current_window.resize_to(self.resolution.first, self.resolution.last) # [width, height]
|
59
|
+
end
|
56
60
|
else
|
57
61
|
raise Browsed::TooManyProcessesError, "Too many PhantomJS processes running, reached maximum allowed number of #{self.maximum_processes}"
|
58
62
|
end
|
@@ -148,7 +152,11 @@ module Browsed
|
|
148
152
|
|
149
153
|
# Resolution
|
150
154
|
def set_resolution(res)
|
151
|
-
|
155
|
+
if res && res.is_a?(Array)
|
156
|
+
self.resolution = res
|
157
|
+
elsif res && res.is_a?(Symbol) && res.eql?(:randomize)
|
158
|
+
self.resolution = randomize_resolution
|
159
|
+
end
|
152
160
|
end
|
153
161
|
|
154
162
|
def randomize_resolution
|
data/lib/browsed/version.rb
CHANGED