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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c74ddd16cdffa85784c96e4be8bc549752122364fa729a5cf8cc68fc923d4dc0
4
- data.tar.gz: 5b9d3ec1a27a641c447ac896a031625153027797a9b5d2a163bdb17f706a88b0
3
+ metadata.gz: 9ce916b59fcd166bdcafb222263423739c9c8fe58e53a50f5895c95485145522
4
+ data.tar.gz: 71fd0cb14988364e06d7977c38815a6656522c2acb79180ec06e5889b5eab155
5
5
  SHA512:
6
- metadata.gz: 572f1b6775222278e1e036c8c7e692f1991521fbcc30ecab6e44f7e713252670f62a2b88f308ff0eb6467ee6c65db90966f98f3cffd1a8d2e8bf59372b601199
7
- data.tar.gz: 397223170511f89678bbf2593586929965a12dd6b1c969d328a18cdc26b818717b39173f818210eb3be457b12f0df9d354718cf4175d12eab4d95d697d99b10e
6
+ metadata.gz: 3caaba9397db23c5c2bdb215812345af54f04a21e25c56ae6c83209c45f42a2bfd1891a587e7c58682ee85bd07b806d077adb7f7e780e2cd1c202fa2a38e5b64
7
+ data.tar.gz: 50f45dfc872ff6cc60a997f842bff3ba95d225cd88621879d2a07c0119c577376528ac3cedf306322c9c7efe1e18a1be63d232109c4d3ac29f3689d22aed27b9
@@ -1,6 +1,11 @@
1
1
  name: CI
2
2
 
3
- on: [push]
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ pull_request:
4
9
 
5
10
  jobs:
6
11
  build:
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 0.2.0 - 2023-08-23
2
+
3
+ * Add support for aggregate_failures #21 (@willnet)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- test-recorder (0.1.5)
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.4)
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.1.10)
20
- debug (1.7.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.12.0)
23
+ i18n (1.14.1)
24
24
  concurrent-ruby (~> 1.0)
25
25
  io-console (0.6.0)
26
- irb (1.6.2)
27
- reline (>= 0.3.0)
28
- minitest (5.17.0)
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.2)
30
+ reline (0.3.8)
31
31
  io-console (~> 0.5)
32
- rexml (3.2.5)
32
+ rexml (3.2.6)
33
33
  rubyzip (2.3.2)
34
- selenium-devtools (0.109.0)
34
+ selenium-devtools (0.115.0)
35
35
  selenium-webdriver (~> 4.2)
36
- selenium-webdriver (4.7.1)
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.5)
40
+ tzinfo (2.0.6)
41
41
  concurrent-ruby (~> 1.0)
42
42
  websocket (1.2.9)
43
43
 
@@ -9,19 +9,29 @@ module TestRecorder
9
9
  attr_accessor :cdp_recorder
10
10
 
11
11
  def after_failed_example(example)
12
- if example.exception
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
@@ -1,3 +1,3 @@
1
1
  module TestRecorder
2
- VERSION = "0.1.5"
2
+ VERSION = "0.2.0"
3
3
  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.1.5
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-01-31 00:00:00.000000000 Z
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.1
115
+ rubygems_version: 3.4.10
115
116
  signing_key:
116
117
  specification_version: 4
117
118
  summary: Automatically record videos when tests failed.