intransient_capybara 1.0.1 → 1.0.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
  SHA1:
3
- metadata.gz: 947b6ccc4687c7a53e50287635750f38f1954248
4
- data.tar.gz: e9f78842a8d76789c4529a0f35fa199f5cdc5da9
3
+ metadata.gz: 83593a8ec8648d2aaad1258458fa0d9960e7d464
4
+ data.tar.gz: 51a353e91f335e71206b1aff35b7147bb20f7cd4
5
5
  SHA512:
6
- metadata.gz: 8410c434c7901645473afe4a79f8423063ea8578d65afbfa2434e155a34f0af89dbe8c5b759e4381cc56dee2e62556bd928702208510d4844d748e942eca8753
7
- data.tar.gz: 0069d6bbebeb99905ba1d31a4c8807100eb787654d278dd99b07a96f5c157492106a05a0cdba9a3a9ac2d12bae0238b08dedec925cab8b3d0cbad8ec286e9d53
6
+ metadata.gz: 6c44f04d8a0e4978d48d0239c00bc3260cb9fa407b131487283f0695de28dcd95957d2b7678f1b8e3123e0ab57ccce68493feb3761b8452a6cd40f5f647a3e09
7
+ data.tar.gz: c68d4e09e88ad7678019619d36fc94742bbb018335657989328989456a91819658f0929eeca46c37fed0c228cbb89f2fdfc4c65fdfaa5e6c14310ed306e62268
data/README.md CHANGED
@@ -91,21 +91,21 @@ Register the driver
91
91
 
92
92
  ```
93
93
 
94
- ###Debuggability
94
+ ### Debuggability
95
95
 
96
- 1. When an element is not found, we output what the current path is and the page's entire HTML, to debug what is going on. A common case is getting redirected somewhere else, and another is the wrong template is rendering or your partial is not rendering at all. Sometimes you look at the HTML and your element is there and knowing that will help figure out why the selector isn't working.
96
+ 1. When an element is not found, we output what the current path is and the page's entire HTML (unless environment variable DEBUG_HIDE_PAGE_HTML is 'true'), to debug what is going on. A common case is getting redirected somewhere else, and another is the wrong template is rendering or your partial is not rendering at all. Sometimes you look at the HTML and your element is there and knowing that will help figure out why the selector isn't working.
97
97
 
98
98
  2. When environment variable DEBUG_TEST_TRAFFIC is 'true', we output a summary of network traffic from each test. If you are downloading a lot of stuff or making inordinant amounts of calls it will be insightful to you to know this - it might be reducable, or you may need to preload stuff, etc. You can also set DEBUG_TEST_TRAFFIC_RAISE_EXTERNAL to 'true' and we will throw an exception if you make a network call to an external service. This is super common and you should either stub out all of these or add them to the blacklist. jQuery is a common one if you are loading that JS from a CDN, and you may need to load it from the asset pipeline during tests instead.
99
99
 
100
100
  3. When environment variable TRACE_TEST_FRAMEWORK is 'true', we output some traces of blocking rack requests and the calling of test setup and teardown. This can help you make sure your ordering is correct and could help you see if things are happening concurrently or not.
101
101
 
102
- ###Correct configuration
102
+ ### Correct configuration
103
103
 
104
104
  1. Capybara.default_max_wait_time is a very important decision. This gem defaults that to 10 seconds. More than that and you're probably failing anyways and you're just extending your test run for no reason. Much less and you get transient. Time is less important than stability and 10 seconds is a good balance on the stabiltiy side of the world. You can override this by setting Capybara.default_max_wait_time again in your inherited class.
105
105
 
106
106
  2. Set phantomjs_options when you set up Poltergeist. Not loading images and ignoring SSL errors are the common suggestions to improve stability in PhantomJS.
107
107
 
108
- ###Correct usage of Capybara/Poltergeist/PhantomJS
108
+ ### Correct usage of Capybara/Poltergeist/PhantomJS
109
109
 
110
110
  1. You need to setup and teardown consistently in your tests, so we will throw an exception if you override one of these and forget to call super (which is SUPER common).
111
111
 
@@ -14,12 +14,15 @@ module Minitest
14
14
 
15
15
  retries = [ENV.fetch('MINITEST_RETRY_COUNT', 3).to_i, 1].max
16
16
 
17
- retries.times do
17
+ test_executions = 0
18
+ while test_executions < retries do
19
+ test_executions += 1
20
+
18
21
  result = Minitest.run_one_method(klass, method_name)
19
22
 
20
23
  first_result ||= result
21
24
 
22
- if result.passed?
25
+ if result.passed? || result.skipped?
23
26
  unless ENV.fetch('TRANSIENT_TESTS_REPORT_FAILURE', false) == 'true'
24
27
  report_result = result
25
28
  end
@@ -32,6 +35,7 @@ module Minitest
32
35
 
33
36
  if result.failure.exception.present? && result.failure.exception.class.to_s == 'Capybara::Poltergeist::DeadClient'
34
37
  puts "PhantomJS died!!!! - #{klass.to_s}##{method_name}"
38
+ test_executions -= 1
35
39
  next
36
40
  end
37
41
 
@@ -37,8 +37,11 @@ module Capybara
37
37
  puts 'We failed to find an element :('
38
38
  puts
39
39
  puts 'We are on path: ' + session.current_path
40
- puts
41
- puts 'This is the page HTML: ' + session.body
40
+
41
+ unless ENV.fetch('DEBUG_HIDE_PAGE_HTML', false) == 'true'
42
+ puts
43
+ puts 'This is the page HTML: ' + session.body
44
+ end
42
45
  puts
43
46
  raise sad_day
44
47
 
@@ -1,3 +1,3 @@
1
1
  module IntransientCapybara
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intransient_capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Ringling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-02 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capybara
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.4.5
154
+ rubygems_version: 2.5.1
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: A set of improvements to Capybara/Poltergeist/PhantomJS test stack that reduces