browsed 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: d7134f8076720d3ac8c06ece828213da9582aa696b5cc3de87a4b2bd761416e0
4
- data.tar.gz: 792c0861d2825fb28ff44521bfdf2d679f1df8479b769077b70672f3fd3f1807
3
+ metadata.gz: f1dcc1ed224b661035c70a3ecd01bc9865223ee504bf698783e049f2cac76157
4
+ data.tar.gz: 80c2a3f1624b49b21a2a8185bc940f87cd56798c5eb2c8bd9e258dbc64eea1a4
5
5
  SHA512:
6
- metadata.gz: 6df46b2a370d4397247e66cca64f67e93b1ca96fe4b1cdc91ec391d49aebc8f3a3a68f15ddc2df216feafb2d643bf8e48ad83c4a36fc785ebefc5f94d1bf377e
7
- data.tar.gz: bdc851d90b9e4a64c57093f4bfb6536b0443054ab5acb2ba1c291566b0fc31500d1b0e911d7a0ec671ccc4dd4f26c1ba4fa9f5f9c66a45b608412ce7fe6aed34
6
+ metadata.gz: 7d2edf3dec1d5b19ff8f3e94c96e400360da0775e6549f23715b4b0756890f377e167f1cbc685e8eaef0ccbeb967151e08037c02f7ace75a99081460cb36d5de
7
+ data.tar.gz: d5c9be8ade68d874af45dbf08a7507601dc7562a4524655c4d1225ef3f63678165796bb28770d649da603048461c0b7f1fa95c26ed29d617dea621a5a2dc1cb0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- browsed (0.1.2)
4
+ browsed (0.1.3)
5
5
  agents
6
6
  capybara (~> 3.4, >= 3.4.1)
7
7
  poltergeist (~> 1.18, >= 1.18.1)
data/bin/browse CHANGED
@@ -10,7 +10,9 @@ browser = :firefox
10
10
  url = "https://whatismyipaddress.com"
11
11
  path = File.expand_path("../../files/#{Time.now.to_i}.png", __FILE__)
12
12
 
13
- client = Browsed::Client.new(driver: driver, browser: browser, device: :desktop, environment: :development)
13
+ client = Browsed::Client.new(driver: driver, browser: browser, device: :desktop, environment: :development, resolution: [1366,768])
14
+
15
+ client.resize! # Set resolution
14
16
 
15
17
  client.session.visit(url)
16
18
 
@@ -53,10 +53,6 @@ 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
60
56
  else
61
57
  raise Browsed::TooManyProcessesError, "Too many PhantomJS processes running, reached maximum allowed number of #{self.maximum_processes}"
62
58
  end
@@ -70,6 +66,15 @@ module Browsed
70
66
  Launchy.open path if development?
71
67
  end
72
68
 
69
+ # Resize the window separately and not based on initialization
70
+ def resize!(res = nil)
71
+ res ||= self.resolution
72
+
73
+ if res && res.size.eql?(2) && !self.driver.eql?(:poltergeist) # Resolution for Poltergeist is set in the driver
74
+ self.session.current_window.resize_to(res.first, res.last) # [width, height]
75
+ end
76
+ end
77
+
73
78
  def reset_session!
74
79
  self.session.reset_session!
75
80
  end
@@ -1,3 +1,3 @@
1
1
  module Browsed
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browsed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian