integration-tests-rails 1.1.7 → 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/integration_tests_rails/capybara/local.rb +1 -0
- data/lib/integration_tests_rails/capybara/remote.rb +1 -0
- data/lib/integration_tests_rails/capybara/retry.rb +2 -2
- data/lib/integration_tests_rails/configuration.rb +7 -2
- data/lib/integration_tests_rails/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: 0d10ed4b78dce98a66176a7e04911af5bada45c544ccf2c6adb979f88315ec68
|
|
4
|
+
data.tar.gz: d46b2a963273837d366b710a133b6dfa370c382f057784406f1c24a8e3af1eee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d561dc1ad7ebd82c193f49b51ce4ecd69aa5aca6f6b11866f9cb57c777573fc196549e260aeb9a94dd6dfdeed9bce36e92dc2a3da0ab0f903d0f72a346e18d0b
|
|
7
|
+
data.tar.gz: 834a9468ab2b347df5358592cee7928f72c7cfccbbb1758e82c608529050fb83afe9cd83dc7212ccd67b8cee59234fbb46881c091f86453145ba6c77c2e1b2d6
|
data/README.md
CHANGED
|
@@ -64,6 +64,7 @@ The `IntegrationTestsRails.setup` method accepts an optional block for further c
|
|
|
64
64
|
IntegrationTestsRails.setup do |config|
|
|
65
65
|
config.auto_retry = false # Whether to automatically wrap all examples inside retry_on_fail block.
|
|
66
66
|
config.chrome_url = nil # Used for remote Chrome instances. Needs remote to be true.
|
|
67
|
+
config.headless = false # Whether to run Chrome in headless mode.
|
|
67
68
|
config.js_coverage = true # Whether to enable JavaScript coverage using Istanbul.
|
|
68
69
|
config.max_server_retries = 1000 # Before running the tests, Cuprite starts a server to communicate with Chrome. This sets the maximum number of retries to connect to that server.
|
|
69
70
|
config.puma_threads = '1:1' # Number of threads for the Puma server used by Cuprite.
|
|
@@ -12,11 +12,11 @@ module IntegrationTestsRails
|
|
|
12
12
|
(attempts + 1).times do |attempt_number|
|
|
13
13
|
reset_example_state(context)
|
|
14
14
|
example.run
|
|
15
|
-
ex =
|
|
15
|
+
ex = example.exception
|
|
16
16
|
break unless ex
|
|
17
17
|
break unless capture_exceptions.any? { |klass| ex.is_a?(klass) }
|
|
18
18
|
|
|
19
|
-
Util.log "Auto Retry Attempt #{attempt_number + 1} failed for: #{description}"
|
|
19
|
+
Util.log "Auto Retry Attempt #{attempt_number + 1} failed for: #{description} (#{ex.class})"
|
|
20
20
|
sleep(sleep_duration) if attempt_number < attempts && sleep_duration.positive?
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -40,7 +40,7 @@ module IntegrationTestsRails
|
|
|
40
40
|
attr_accessor :source_dir, :output_dir, :backup_dir, :coverage_path, :wait_time, :remote, :chrome_url, :window_size,
|
|
41
41
|
:tests_page_html, :max_server_retries, :verbose, :js_coverage, :auto_retry,
|
|
42
42
|
:timeout, :server_host, :server_port, :puma_threads, :experimental_features,
|
|
43
|
-
:retry_attempts, :retry_sleep_duration, :retry_capture_exceptions
|
|
43
|
+
:retry_attempts, :retry_sleep_duration, :retry_capture_exceptions, :headless
|
|
44
44
|
|
|
45
45
|
def initialize # rubocop:disable Metrics/MethodLength
|
|
46
46
|
@auto_retry = false
|
|
@@ -48,13 +48,18 @@ module IntegrationTestsRails
|
|
|
48
48
|
@chrome_url = nil
|
|
49
49
|
@coverage_path = 'coverage/nyc'
|
|
50
50
|
@experimental_features = false
|
|
51
|
+
@headless = false
|
|
51
52
|
@js_coverage = true
|
|
52
53
|
@max_server_retries = 1000
|
|
53
54
|
@output_dir = 'tmp/instrumented_js'
|
|
54
55
|
@puma_threads = '1:1'
|
|
55
56
|
@remote = false
|
|
56
57
|
@retry_attempts = 1
|
|
57
|
-
@retry_capture_exceptions = [
|
|
58
|
+
@retry_capture_exceptions = [
|
|
59
|
+
'RSpec::Expectations::ExpectationNotMetError',
|
|
60
|
+
'Capybara::ElementNotFound',
|
|
61
|
+
'Ferrum::JavaScriptError'
|
|
62
|
+
]
|
|
58
63
|
@retry_sleep_duration = 0
|
|
59
64
|
@server_host = '0.0.0.0' # rubocop:disable Style/IpAddresses
|
|
60
65
|
@server_port = nil
|