test-recorder 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -1
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +13 -13
- data/lib/test_recorder/rspec.rb +13 -3
- data/lib/test_recorder/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ce916b59fcd166bdcafb222263423739c9c8fe58e53a50f5895c95485145522
|
4
|
+
data.tar.gz: 71fd0cb14988364e06d7977c38815a6656522c2acb79180ec06e5889b5eab155
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3caaba9397db23c5c2bdb215812345af54f04a21e25c56ae6c83209c45f42a2bfd1891a587e7c58682ee85bd07b806d077adb7f7e780e2cd1c202fa2a38e5b64
|
7
|
+
data.tar.gz: 50f45dfc872ff6cc60a997f842bff3ba95d225cd88621879d2a07c0119c577376528ac3cedf306322c9c7efe1e18a1be63d232109c4d3ac29f3689d22aed27b9
|
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
test-recorder (0.
|
4
|
+
test-recorder (0.2.0)
|
5
5
|
activesupport
|
6
6
|
selenium-devtools
|
7
7
|
selenium-webdriver (>= 4.0)
|
@@ -9,35 +9,35 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (7.0.
|
12
|
+
activesupport (7.0.7)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 1.6, < 2)
|
15
15
|
minitest (>= 5.1)
|
16
16
|
tzinfo (~> 2.0)
|
17
17
|
activesupport-testing-metadata (0.1.0)
|
18
18
|
activesupport (>= 4.0)
|
19
|
-
concurrent-ruby (1.
|
20
|
-
debug (1.
|
19
|
+
concurrent-ruby (1.2.2)
|
20
|
+
debug (1.8.0)
|
21
21
|
irb (>= 1.5.0)
|
22
22
|
reline (>= 0.3.1)
|
23
|
-
i18n (1.
|
23
|
+
i18n (1.14.1)
|
24
24
|
concurrent-ruby (~> 1.0)
|
25
25
|
io-console (0.6.0)
|
26
|
-
irb (1.
|
27
|
-
reline (>= 0.3.
|
28
|
-
minitest (5.
|
26
|
+
irb (1.7.4)
|
27
|
+
reline (>= 0.3.6)
|
28
|
+
minitest (5.19.0)
|
29
29
|
rake (12.3.3)
|
30
|
-
reline (0.3.
|
30
|
+
reline (0.3.8)
|
31
31
|
io-console (~> 0.5)
|
32
|
-
rexml (3.2.
|
32
|
+
rexml (3.2.6)
|
33
33
|
rubyzip (2.3.2)
|
34
|
-
selenium-devtools (0.
|
34
|
+
selenium-devtools (0.115.0)
|
35
35
|
selenium-webdriver (~> 4.2)
|
36
|
-
selenium-webdriver (4.
|
36
|
+
selenium-webdriver (4.11.0)
|
37
37
|
rexml (~> 3.2, >= 3.2.5)
|
38
38
|
rubyzip (>= 1.2.2, < 3.0)
|
39
39
|
websocket (~> 1.0)
|
40
|
-
tzinfo (2.0.
|
40
|
+
tzinfo (2.0.6)
|
41
41
|
concurrent-ruby (~> 1.0)
|
42
42
|
websocket (1.2.9)
|
43
43
|
|
data/lib/test_recorder/rspec.rb
CHANGED
@@ -9,19 +9,29 @@ module TestRecorder
|
|
9
9
|
attr_accessor :cdp_recorder
|
10
10
|
|
11
11
|
def after_failed_example(example)
|
12
|
-
if example
|
12
|
+
if passed?(example)
|
13
|
+
cdp_recorder.stop_and_discard
|
14
|
+
else
|
13
15
|
video_path = cdp_recorder.stop_and_save("failures_#{method_name(example)}.webm").to_s
|
14
16
|
if File.exist?(video_path)
|
15
17
|
example.metadata[:extra_failure_lines] = [example.metadata[:extra_failure_lines], "[Video]: #{video_path}"].flatten
|
16
18
|
end
|
17
|
-
else
|
18
|
-
cdp_recorder.stop_and_discard
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
def method_name(example)
|
23
23
|
example.description.underscore.tr(CHARS_TO_TRANSLATE.join, "_")[0...200] + "_#{rand(1000)}"
|
24
24
|
end
|
25
|
+
|
26
|
+
def passed?(example)
|
27
|
+
return false if example.exception
|
28
|
+
return true unless defined?(::RSpec::Expectations::FailureAggregator)
|
29
|
+
|
30
|
+
failure_notifier = ::RSpec::Support.failure_notifier
|
31
|
+
return true unless failure_notifier.is_a?(::RSpec::Expectations::FailureAggregator)
|
32
|
+
|
33
|
+
failure_notifier.failures.empty? && failure_notifier.other_errors.empty?
|
34
|
+
end
|
25
35
|
end
|
26
36
|
end
|
27
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-recorder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuji Yaginuma
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -75,6 +75,7 @@ extra_rdoc_files: []
|
|
75
75
|
files:
|
76
76
|
- ".github/workflows/ci.yml"
|
77
77
|
- ".gitignore"
|
78
|
+
- CHANGELOG.md
|
78
79
|
- Gemfile
|
79
80
|
- Gemfile.lock
|
80
81
|
- LICENSE.txt
|
@@ -111,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
112
|
- !ruby/object:Gem::Version
|
112
113
|
version: '0'
|
113
114
|
requirements: []
|
114
|
-
rubygems_version: 3.4.
|
115
|
+
rubygems_version: 3.4.10
|
115
116
|
signing_key:
|
116
117
|
specification_version: 4
|
117
118
|
summary: Automatically record videos when tests failed.
|