forki 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb9eb80820ccf86f9a99d1c757940a935137d834a2bd76d855deaeee470840a1
4
- data.tar.gz: 667f0600afdf53ced62b57def3021a6ccc0cf2a194142e2f23beb76c8384a35a
3
+ metadata.gz: 0736d43f45a908cbae8d8685a9e91b0863fc635a0544065fa3afb23d4664b64e
4
+ data.tar.gz: 1954cd17cb5997446cdc8040f36f0cd531c32184581f5cde20ae5783c495664d
5
5
  SHA512:
6
- metadata.gz: 78aa5d9bf07a1f5790f8e1705056956b30a7d2854723b74fdfd0a7612be2c3988916333bfc5fc15dff62d62fda1d01452f375765b4e1ddc6633148372993ebbb
7
- data.tar.gz: 21d6c81749a1f1fe160508e9efe53ca6abc2be59b01eb31684a500df79b9092647de47d1545ea21c0c701c5d1e34f2f40c35dcf0765bdfce6d7c72ec60feee2b
6
+ metadata.gz: 0ee46a3fe486e66f8d91a9cc025443f8c2fd98644cc2eb97effee03358ba7ca27976e2ec3d18af14d4678091c7d46a7005ed1ffe1e7744be4b783efaa0cbac58
7
+ data.tar.gz: f94fdbec137832b79ff52c6a63c2a2bb1d777a629df5ec474b11d18ee85335c5fd31f83d2d02dbbe31996f23e3cbb5570bd2582c98c6779744acdd39d45e98ee
data/Gemfile CHANGED
@@ -19,3 +19,5 @@ gem "dotenv", "~> 2.7.6"
19
19
  gem "byebug"
20
20
 
21
21
  gem "rack", "2.2.4"
22
+
23
+ gem "curb", "~> 1.0", ">= 1.0.5"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- forki (0.1.0)
4
+ forki (0.1.1)
5
5
  apparition
6
6
  capybara
7
7
  oj
@@ -48,6 +48,7 @@ GEM
48
48
  xpath (~> 3.2)
49
49
  concurrent-ruby (1.2.2)
50
50
  crass (1.0.6)
51
+ curb (1.0.5)
51
52
  dotenv (2.7.6)
52
53
  erubi (1.12.0)
53
54
  ethon (0.16.0)
@@ -150,6 +151,7 @@ PLATFORMS
150
151
 
151
152
  DEPENDENCIES
152
153
  byebug
154
+ curb (~> 1.0, >= 1.0.5)
153
155
  dotenv (~> 2.7.6)
154
156
  forki!
155
157
  minitest (~> 5.0)
@@ -349,8 +349,9 @@ module Forki
349
349
  page.quit
350
350
 
351
351
  post_data
352
- rescue Net::ReadTimeout
353
- # Eat it?
352
+ rescue Net::ReadTimeout => e
353
+ puts "Time out error: #{e}"
354
+ puts e.backtrace
354
355
  rescue StandardError => e
355
356
  raise e
356
357
  ensure
@@ -6,6 +6,7 @@ require "dotenv/load"
6
6
  require "oj"
7
7
  require "selenium-webdriver"
8
8
  require "open-uri"
9
+ require 'selenium/webdriver/remote/http/curb'
9
10
 
10
11
  options = Selenium::WebDriver::Options.chrome(exclude_switches: ["enable-automation"])
11
12
  options.add_argument("--start-maximized")
@@ -20,8 +21,8 @@ options.add_argument("--remote-debugging-port=9222")
20
21
  options.add_argument("--user-data-dir=/tmp/tarun_forki_#{SecureRandom.uuid}")
21
22
 
22
23
  Capybara.register_driver :selenium_forki do |app|
23
- client = Selenium::WebDriver::Remote::Http::Default.new
24
- client.read_timeout = 60 # Don't wait 60 seconds to return Net::ReadTimeoutError. We'll retry through Hypatia after 10 seconds
24
+ client = Selenium::WebDriver::Remote::Http::Curb.new
25
+ # client.read_timeout = 60 # Don't wait 60 seconds to return Net::ReadTimeoutError. We'll retry through Hypatia after 10 seconds
25
26
  Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, http_client: client)
26
27
  end
27
28
 
@@ -97,8 +98,8 @@ module Forki
97
98
  options.add_argument("--user-data-dir=/tmp/tarun_forki_#{SecureRandom.uuid}")
98
99
 
99
100
  Capybara.register_driver :selenium_forki do |app|
100
- client = Selenium::WebDriver::Remote::Http::Default.new
101
- client.read_timeout = 60 # Don't wait 60 seconds to return Net::ReadTimeoutError. We'll retry through Hypatia after 10 seconds
101
+ client = Selenium::WebDriver::Remote::Http::Curb.new
102
+ # client.read_timeout = 60 # Don't wait 60 seconds to return Net::ReadTimeoutError. We'll retry through Hypatia after 10 seconds
102
103
  Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, http_client: client)
103
104
  end
104
105
 
@@ -110,7 +111,9 @@ module Forki
110
111
  raise MissingCredentialsError if ENV["FACEBOOK_EMAIL"].nil? || ENV["FACEBOOK_PASSWORD"].nil?
111
112
 
112
113
  url ||= "https://www.facebook.com"
113
- visit(url) # Visit the url passed in or the facebook homepage if nothing is
114
+
115
+
116
+ page.driver.browser.navigate.to(url) # Visit the url passed in or the facebook homepage if nothing is
114
117
 
115
118
  # Look for "login_form" box, which throws an error if not found. So we catch it and run the rest of the tests
116
119
  begin
@@ -120,7 +123,7 @@ module Forki
120
123
  end
121
124
 
122
125
  # Since we're not logged in, let's do that quick
123
- visit("https://www.facebook.com") if login_form.nil?
126
+ page.driver.browser.navigate.to("https://www.facebook.com") if login_form.nil?
124
127
 
125
128
  login_form.fill_in("email", with: ENV["FACEBOOK_EMAIL"])
126
129
  login_form.fill_in("pass", with: ENV["FACEBOOK_PASSWORD"])
data/lib/forki/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Forki
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-23 00:00:00.000000000 Z
11
+ date: 2023-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara