panda-core 0.9.4 → 0.10.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '04695145fc8e1f8c8bdd13d1ee35d91e1a3eb470070d265463f72e97f9ddd19c'
4
- data.tar.gz: 509bd365e3b501f2f34d0add9617f29b757dcb1b2ca6db6d65c6f1dccfc2142f
3
+ metadata.gz: 8786fda5161f67845a6c814fc2db3191a9956d963fbdc8722d90b0c4f6330d7d
4
+ data.tar.gz: c45c391136050ce04b0bd94d173a3ebfd96dd7da69cd56a979e51cdfb7fd6533
5
5
  SHA512:
6
- metadata.gz: 3187a5adef002caceeda919102eb8f281aad08058bdc53a10be6297fcc78edaeecade4cdd6ead4246d6596f4fdbd1d37c44d1a2b280bb91023de20b6dc9a75c9
7
- data.tar.gz: 6b7ee0a2d2dc9fcfd4c35bde5217a6390d700085dfdb52417189e702c9906d446d5a8d4f89efb21db8c14bd38962a4f23a7c4748b797f7cc235db349b6d7c7c8
6
+ metadata.gz: 27c669708d8cb665eae8746f090087f3b4bccd0f116f6c8cb3e9db22e56d9f07acc57cd98b6cba008c264744654ae85e343f75b56b8616f231ecfe2e6228b233
7
+ data.tar.gz: bc4af6f141ae74da63103bd930b682ddc8ed4e9024029a552c1189ff90e36f22772f4c56d2c3f27b701e87d408612a6118caea5deb1bd2d6ba0c7150bf91df23
@@ -7,8 +7,8 @@
7
7
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@7.1.0/css/all.min.css">
8
8
  <%= panda_core_stylesheet %>
9
9
 
10
- <!-- ES Module Shims polyfill - must load BEFORE importmap (blocking, not async) -->
11
- <script src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" crossorigin="anonymous"></script>
10
+ <!-- ES Module Shims polyfill - must load BEFORE importmap -->
11
+ <script async src="https://ga.jspm.io/npm:es-module-shims@2.6.2/dist/es-module-shims.js"></script>
12
12
 
13
13
  <!-- Panda JavaScript (Core + all registered modules via ModuleRegistry) -->
14
14
  <%= panda_core_javascript %>
@@ -45,25 +45,59 @@ module Panda
45
45
 
46
46
  # Enable automatic screenshots on failure
47
47
  # Add CI-specific timeout and retry logic for form interactions
48
+ # Includes MultipleExceptionError detection
48
49
  around(:each, type: :system) do |example|
49
- if ENV["GITHUB_ACTIONS"] == "true"
50
- # In CI, wrap the test execution with additional error handling
51
- begin
52
- example.run
53
- rescue => e
54
- # Log any error for debugging
55
- puts "[CI] Test error detected: #{e.class} - #{e.message}"
56
- puts "[CI] Current URL: #{begin
57
- page.current_url
58
- rescue
59
- ""
60
- end}"
61
-
62
- # Re-raise the original error
63
- raise e
64
- end
65
- else
50
+ exception = nil
51
+
52
+ begin
66
53
  example.run
54
+ rescue => e
55
+ exception = e
56
+ end
57
+
58
+ # Also check example.exception in case RSpec aggregated exceptions there
59
+ exception ||= example.exception
60
+
61
+ # Handle MultipleExceptionError specially - don't retry, just report and skip
62
+ if exception.is_a?(RSpec::Core::MultipleExceptionError)
63
+ puts "\n" + ("=" * 80)
64
+ puts "⚠️ MULTIPLE EXCEPTIONS - SKIPPING TEST (NO RETRY)"
65
+ puts "=" * 80
66
+ puts "Test: #{example.full_description}"
67
+ puts "File: #{example.metadata[:file_path]}:#{example.metadata[:line_number]}"
68
+ puts "Total exceptions: #{exception.all_exceptions.count}"
69
+ puts "=" * 80
70
+
71
+ # Group exceptions by class for cleaner output
72
+ exceptions_by_class = exception.all_exceptions.group_by(&:class)
73
+ exceptions_by_class.each do |klass, exs|
74
+ puts "\n#{klass.name} (#{exs.count} occurrence#{"s" if exs.count > 1}):"
75
+ puts " #{exs.first.message.split("\n").first}"
76
+ end
77
+
78
+ puts "\n" + ("=" * 80)
79
+ puts "⚠️ Skipping retry - moving to next test"
80
+ puts "=" * 80 + "\n"
81
+
82
+ # Mark this so after hooks can skip verbose output
83
+ example.metadata[:multiple_exception_detected] = true
84
+
85
+ # Re-raise to mark test as failed, but don't retry
86
+ raise exception
87
+ end
88
+
89
+ # For other exceptions in CI, log and re-raise
90
+ if exception && ENV["GITHUB_ACTIONS"] == "true"
91
+ puts "[CI] Test error detected: #{exception.class} - #{exception.message}"
92
+ puts "[CI] Current URL: #{begin
93
+ page.current_url
94
+ rescue
95
+ ""
96
+ end}"
97
+ raise exception
98
+ elsif exception
99
+ # Not in CI, just re-raise
100
+ raise exception
67
101
  end
68
102
  end
69
103
 
@@ -127,8 +161,11 @@ module Panda
127
161
  end
128
162
  rescue => e
129
163
  puts "Failed to capture screenshot: #{e.message}"
130
- puts "Exception class: #{example.exception.class}"
131
- puts "Exception message: #{example.exception.message}"
164
+ # Skip verbose output if already handled by MultipleExceptionError handler
165
+ unless example.metadata[:multiple_exception_detected]
166
+ puts "Exception class: #{example.exception.class}"
167
+ puts "Exception message: #{example.exception.message}"
168
+ end
132
169
  end
133
170
  end
134
171
  end
@@ -34,22 +34,59 @@ RSpec.configure do |config|
34
34
  driven_by :cuprite
35
35
  end
36
36
 
37
- # CI-specific error handling
37
+ # CI-specific error handling with MultipleExceptionError detection
38
38
  config.around(:each, type: :system) do |example|
39
- if ENV["GITHUB_ACTIONS"] == "true"
40
- begin
41
- example.run
42
- rescue => e
43
- puts "[CI] Test error detected: #{e.class} - #{e.message}"
44
- puts "[CI] Current URL: #{begin
45
- page.current_url
46
- rescue
47
- ""
48
- end}"
49
- raise e
50
- end
51
- else
39
+ exception = nil
40
+
41
+ begin
52
42
  example.run
43
+ rescue => e
44
+ exception = e
45
+ end
46
+
47
+ # Also check example.exception in case RSpec aggregated exceptions there
48
+ exception ||= example.exception
49
+
50
+ # Handle MultipleExceptionError specially - don't retry, just report and skip
51
+ if exception.is_a?(RSpec::Core::MultipleExceptionError)
52
+ puts "\n" + ("=" * 80)
53
+ puts "⚠️ MULTIPLE EXCEPTIONS - SKIPPING TEST (NO RETRY)"
54
+ puts "=" * 80
55
+ puts "Test: #{example.full_description}"
56
+ puts "File: #{example.metadata[:file_path]}:#{example.metadata[:line_number]}"
57
+ puts "Total exceptions: #{exception.all_exceptions.count}"
58
+ puts "=" * 80
59
+
60
+ # Group exceptions by class for cleaner output
61
+ exceptions_by_class = exception.all_exceptions.group_by(&:class)
62
+ exceptions_by_class.each do |klass, exs|
63
+ puts "\n#{klass.name} (#{exs.count} occurrence#{"s" if exs.count > 1}):"
64
+ puts " #{exs.first.message.split("\n").first}"
65
+ end
66
+
67
+ puts "\n" + ("=" * 80)
68
+ puts "⚠️ Skipping retry - moving to next test"
69
+ puts "=" * 80 + "\n"
70
+
71
+ # Mark this so after hooks can skip verbose output
72
+ example.metadata[:multiple_exception_detected] = true
73
+
74
+ # Re-raise to mark test as failed, but don't retry
75
+ raise exception
76
+ end
77
+
78
+ # For other exceptions in CI, log and re-raise
79
+ if exception && ENV["GITHUB_ACTIONS"] == "true"
80
+ puts "[CI] Test error detected: #{exception.class} - #{exception.message}"
81
+ puts "[CI] Current URL: #{begin
82
+ page.current_url
83
+ rescue
84
+ ""
85
+ end}"
86
+ raise exception
87
+ elsif exception
88
+ # Not in CI, just re-raise
89
+ raise exception
53
90
  end
54
91
  end
55
92
 
@@ -112,8 +149,11 @@ RSpec.configure do |config|
112
149
  end
113
150
  rescue => e
114
151
  puts "Failed to capture screenshot: #{e.message}"
115
- puts "Exception class: #{example.exception.class}"
116
- puts "Exception message: #{example.exception.message}"
152
+ # Skip verbose output if already handled by MultipleExceptionError handler
153
+ unless example.metadata[:multiple_exception_detected]
154
+ puts "Exception class: #{example.exception.class}"
155
+ puts "Exception message: #{example.exception.message}"
156
+ end
117
157
  end
118
158
  end
119
159
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Panda
4
4
  module Core
5
- # Version 0.9.4 - CI fixes
6
- VERSION = "0.9.4"
5
+ # Version 0.10.0 - MultipleExceptionError detection and ES shims fix
6
+ VERSION = "0.10.0"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panda-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Otaina Limited
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-11-15 00:00:00.000000000 Z
12
+ date: 2025-11-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: image_processing