diff --git a/test/browser/features/lib/browser.rb b/test/browser/features/lib/browser.rb index 929d871c3..3b0fd4a4c 100644 --- a/test/browser/features/lib/browser.rb +++ b/test/browser/features/lib/browser.rb @@ -15,6 +15,14 @@ def initialize(browser_spec) end end + def name + @name + end + + def version + @version + end + # is this a mobile device? # we assume that android devices are always using the latest version of chrome def mobile? @@ -63,6 +71,20 @@ def supported_web_vitals end end + # | browser | version | + # | chrome | 54 | + # | firefox | 45 | + # | edge | 17 | + # | safari | 16.4 | + def supports_performance_encoded_body_size? + case @name + when "safari" + @version >= 17 # we test on 16.3 - not sure what to do here? + else + true + end + end + def supports_performance_response_status? case @name when "chrome", "edge" diff --git a/test/browser/features/resource-load-spans.feature b/test/browser/features/resource-load-spans.feature index 2b4e415c6..13c42bd73 100644 --- a/test/browser/features/resource-load-spans.feature +++ b/test/browser/features/resource-load-spans.feature @@ -25,7 +25,8 @@ Feature: Resource Load Spans And the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" string attribute "http.url" matches the regex "^http:\/\/.*:[0-9]{4}\/favicon\.png\?height=100&width=100$" And the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" string attribute "http.flavor" equals "1.1" - # Image status code and body size have very patchy browser coverage - And if present, the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.status_code" equals 200 - And if present, the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length" equals 2202 - And if present, the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length_uncompressed" equals 2202 + # Image status code and body size have patchy browser coverage + And on the browsers Chrome 109: the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.status_code" equals 200 + + And on the browsers Chrome 73, Safari 13, Firefox 67: the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length" equals 2202 + And on the browsers Chrome 73, Safari 13, Firefox 67: the trace payload field "resourceSpans.0.scopeSpans.0.spans.1" integer attribute "http.response_content_length_uncompressed" equals 2202 diff --git a/test/browser/features/steps/browser-steps.rb b/test/browser/features/steps/browser-steps.rb index 7e7d170f3..bd41d3c97 100644 --- a/test/browser/features/steps/browser-steps.rb +++ b/test/browser/features/steps/browser-steps.rb @@ -182,15 +182,17 @@ end end -def check_attribute_equal_if_present(field, attribute, attr_type, expected) - actual = get_attribute_value field, attribute, attr_type - if actual != nil - Maze.check.equal(expected, actual) +Then(/^on the browsers (.*): (.+)/) do |spec, step_text| + current_platform = $browser.name + current_version = $browser.version + + browsers = spec.split(",") + + for browser in browsers do + name, version = browser.split(" ") + step(step_text) if current_platform.casecmp(name).zero? && !version || current_version >= version.to_i end -end -Then('if present, the trace payload field {string} integer attribute {string} equals {int}') do |field, attribute, expected| - check_attribute_equal_if_present field, attribute, 'intValue', expected end module Maze diff --git a/test/browser/features/support/requires-performance-body-size.rb b/test/browser/features/support/requires-performance-body-size.rb deleted file mode 100644 index 92b44ed7d..000000000 --- a/test/browser/features/support/requires-performance-body-size.rb +++ /dev/null @@ -1,4 +0,0 @@ -Before("@requires_performance_body_size") do - skip_this_scenario unless $browser.supports_performance_body_size? -end - \ No newline at end of file diff --git a/test/browser/features/support/requires-performance-response-status.rb b/test/browser/features/support/requires-performance-response-status.rb deleted file mode 100644 index ea9787365..000000000 --- a/test/browser/features/support/requires-performance-response-status.rb +++ /dev/null @@ -1,4 +0,0 @@ -Before("@requires_performance_response_status") do - skip_this_scenario unless $browser.supports_performance_response_status? -end - \ No newline at end of file