Skip to content

Commit

Permalink
Ensure the Bugsnag-Integrity header is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Nov 18, 2020
1 parent 5a8c923 commit 9cee021
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/expo/features/app.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Scenario: App data is included by default
And the event "app.duration" is not null
And the event "app.durationInForeground" is not null
And the event "app.inForeground" is true
And the Bugsnag-Integrity header is valid

Scenario: App data can be modified by a callback
Given the element "enhancedAppButton" is present
Expand All @@ -23,4 +24,4 @@ Scenario: App data can be modified by a callback
And the event "app.duration" is not null
And the event "app.durationInForeground" is not null
And the event "app.inForeground" is true

And the Bugsnag-Integrity header is valid
12 changes: 12 additions & 0 deletions test/expo/features/auto_breadcrumbs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Scenario: App-state breadcrumbs are captured by default
And the exception "errorClass" equals "Error"
And the exception "message" equals "defaultAppStateBreadcrumbsBehaviour"
And the event has a "state" breadcrumb named "App state changed"
And the Bugsnag-Integrity header is valid

@skip_android_5
Scenario: App-state breadcrumbs can be disabled specifically
Expand All @@ -27,6 +28,7 @@ Scenario: App-state breadcrumbs can be disabled specifically
And the exception "errorClass" equals "Error"
And the exception "message" equals "disabledAppStateBreadcrumbsBehaviour"
And the event does not have a "state" breadcrumb named "App state changed"
And the Bugsnag-Integrity header is valid

@skip_android_5
Scenario: App-state breadcrumbs are disabled with other auto-breadcrumbs
Expand All @@ -41,6 +43,7 @@ Scenario: App-state breadcrumbs are disabled with other auto-breadcrumbs
And the exception "errorClass" equals "Error"
And the exception "message" equals "disabledAllAppStateBreadcrumbsBehaviour"
And the event does not have a "state" breadcrumb named "App state changed"
And the Bugsnag-Integrity header is valid

@skip_android_5
Scenario: App-state breadcrumbs overrides auto-breadcrumbs
Expand All @@ -55,6 +58,7 @@ Scenario: App-state breadcrumbs overrides auto-breadcrumbs
And the exception "errorClass" equals "Error"
And the exception "message" equals "overrideAppStateBreadcrumbsBehaviour"
And the event has a "state" breadcrumb named "App state changed"
And the Bugsnag-Integrity header is valid

Scenario: Console breadcrumbs are captured by default
Given the element "consoleBreadcrumbs" is present
Expand All @@ -65,6 +69,7 @@ Scenario: Console breadcrumbs are captured by default
And the exception "errorClass" equals "Error"
And the exception "message" equals "defaultConsoleBreadcrumbsBehaviour"
And the event has a "log" breadcrumb named "Console output"
And the Bugsnag-Integrity header is valid

Scenario: Console breadcrumbs can be disabled explicitly
Given the element "consoleBreadcrumbs" is present
Expand All @@ -75,6 +80,7 @@ Scenario: Console breadcrumbs can be disabled explicitly
And the exception "errorClass" equals "Error"
And the exception "message" equals "disabledConsoleBreadcrumbsBehaviour"
And the event does not have a "log" breadcrumb named "Console output"
And the Bugsnag-Integrity header is valid

Scenario: Console breadcrumbs are disabled with other auto-breadcrumbs
Given the element "consoleBreadcrumbs" is present
Expand All @@ -85,6 +91,7 @@ Scenario: Console breadcrumbs are disabled with other auto-breadcrumbs
And the exception "errorClass" equals "Error"
And the exception "message" equals "disabledAllConsoleBreadcrumbsBehaviour"
And the event does not have a "log" breadcrumb named "Console output"
And the Bugsnag-Integrity header is valid

Scenario: Console breadcrumbs overrides auto-breadcrumbs
Given the element "consoleBreadcrumbs" is present
Expand All @@ -95,6 +102,7 @@ Scenario: Console breadcrumbs overrides auto-breadcrumbs
And the exception "errorClass" equals "Error"
And the exception "message" equals "overrideConsoleBreadcrumbsBehaviour"
And the event has a "log" breadcrumb named "Console output"
And the Bugsnag-Integrity header is valid

Scenario: Network breadcrumbs are captured by default
Given the element "networkBreadcrumbs" is present
Expand All @@ -107,6 +115,7 @@ Scenario: Network breadcrumbs are captured by default
And the event has a "request" breadcrumb named "XMLHttpRequest succeeded"
And the event "breadcrumbs.1.metaData.status" equals 200
And the event "breadcrumbs.1.metaData.request" equals "GET http://postman-echo.com/get"
And the Bugsnag-Integrity header is valid

Scenario: Network breadcrumbs can be disabled explicitly
Given the element "networkBreadcrumbs" is present
Expand All @@ -117,6 +126,7 @@ Scenario: Network breadcrumbs can be disabled explicitly
And the exception "errorClass" equals "Error"
And the exception "message" equals "disabledNetworkBreadcrumbsBehaviour"
And the event does not have a "request" breadcrumb named "XMLHttpRequest succeeded"
And the Bugsnag-Integrity header is valid

Scenario: Network breadcrumbs are disabled with other auto-breadcrumbs
Given the element "networkBreadcrumbs" is present
Expand All @@ -127,6 +137,7 @@ Scenario: Network breadcrumbs are disabled with other auto-breadcrumbs
And the exception "errorClass" equals "Error"
And the exception "message" equals "disabledAllNetworkBreadcrumbsBehaviour"
And the event does not have a "request" breadcrumb named "XMLHttpRequest succeeded"
And the Bugsnag-Integrity header is valid

Scenario: Network breadcrumbs overrides auto-breadcrumbs
Given the element "networkBreadcrumbs" is present
Expand All @@ -139,3 +150,4 @@ Scenario: Network breadcrumbs overrides auto-breadcrumbs
And the event has a "request" breadcrumb named "XMLHttpRequest succeeded"
And the event "breadcrumbs.0.metaData.status" equals 200
And the event "breadcrumbs.0.metaData.request" equals "GET http://postman-echo.com/get"
And the Bugsnag-Integrity header is valid
2 changes: 2 additions & 0 deletions test/expo/features/device.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Scenario: Device data is included by default
And the event "device.totalMemory" is not null
And the event "metaData.device.isDevice" is true
And the event "metaData.device.appOwnership" equals "standalone"
And the Bugsnag-Integrity header is valid

Scenario: Device data can be modified by a callback
Given the element "deviceCallbackButton" is present
Expand All @@ -47,3 +48,4 @@ Scenario: Device data can be modified by a callback
And the event "device.totalMemory" is not null
And the event "metaData.device.isDevice" is true
And the event "metaData.device.appOwnership" equals "standalone"
And the Bugsnag-Integrity header is valid
2 changes: 2 additions & 0 deletions test/expo/features/error_boundary.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Scenario: A render error is captured by an error boundary
And the exception "errorClass" equals "Error"
And the exception "message" starts with "An error has occurred in Buggy component!"
And the event "metaData.react.componentStack" is not null
And the Bugsnag-Integrity header is valid

@skip_android_7 @skip_android_8
Scenario: When a render error occurs, a fallback is presented
Expand All @@ -19,3 +20,4 @@ Scenario: When a render error occurs, a fallback is presented
Then I wait to receive a request
And the exception "errorClass" equals "Error"
And the element "errorBoundaryFallback" is present
And the Bugsnag-Integrity header is valid
4 changes: 3 additions & 1 deletion test/expo/features/handled.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Scenario: Calling notify() with an Error
Then I wait to receive a request
And the exception "errorClass" equals "Error"
And the exception "message" equals "HandledError"
And the Bugsnag-Integrity header is valid

Scenario: Calling notify() with a caught Error
Given the element "handledCaughtErrorButton" is present
When I click the element "handledCaughtErrorButton"
Then I wait to receive a request
And the exception "errorClass" equals "Error"
And the exception "message" equals "HandledCaughtError"
And the exception "message" equals "HandledCaughtError"
And the Bugsnag-Integrity header is valid
3 changes: 2 additions & 1 deletion test/expo/features/manual_breadcrumbs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Scenario: Manual breadcrumbs are enabled when automatic breadcrumbs are disabled
Then I wait to receive a request
And the exception "message" equals "ManualBreadcrumbError"
And the event has a "manual" breadcrumb named "manualBreadcrumb"
And the event "breadcrumbs.0.metaData.reason" equals "testing"
And the event "breadcrumbs.0.metaData.reason" equals "testing"
And the Bugsnag-Integrity header is valid
2 changes: 2 additions & 0 deletions test/expo/features/metadata.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Scenario: Meta data can be set via the client
And the exception "errorClass" equals "Error"
And the exception "message" equals "MetadataClientError"
And the event "metaData.extra.reason" equals "metadataClientName"
And the Bugsnag-Integrity header is valid

Scenario: Meta data can be set via a callback
Given the element "metadataCallbackButton" is present
Expand All @@ -19,3 +20,4 @@ Scenario: Meta data can be set via a callback
And the exception "errorClass" equals "Error"
And the exception "message" equals "MetadataCallbackError"
And the event "metaData.extra.reason" equals "metadataCallbackName"
And the Bugsnag-Integrity header is valid
4 changes: 3 additions & 1 deletion test/expo/features/sessions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Scenario: Sessions can be automatically delivered
And the payload field "app" is not null
And the payload field "device" is not null
And the payload has a valid sessions array
And the Bugsnag-Integrity header is valid

Scenario: Sessions can be manually delivered
Given the element "manualSessionButton" is present
Expand All @@ -40,4 +41,5 @@ Scenario: Sessions can be manually delivered
And the payload field "notifier.version" is not null
And the payload field "app" is not null
And the payload field "device" is not null
And the payload has a valid sessions array
And the payload has a valid sessions array
And the Bugsnag-Integrity header is valid
2 changes: 2 additions & 0 deletions test/expo/features/unhandled.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ Scenario: Catching an Unhandled error
Then I wait to receive a request
And the exception "errorClass" equals "Error"
And the exception "message" equals "UnhandledError"
And the Bugsnag-Integrity header is valid

Scenario: Catching an Unhandled promise rejection
Given the element "unhandledPromiseRejectionButton" is present
When I click the element "unhandledPromiseRejectionButton"
Then I wait to receive a request
And the exception "errorClass" equals "Error"
And the exception "message" equals "UnhandledPromiseRejection"
And the Bugsnag-Integrity header is valid
2 changes: 2 additions & 0 deletions test/expo/features/user.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Scenario: User data can be set via the client
And the exception "errorClass" equals "Error"
And the exception "message" equals "UserClientError"
And the event "user.name" equals "userClientName"
And the Bugsnag-Integrity header is valid

Scenario: User data can be set via a callback
Given the element "userCallbackButton" is present
Expand All @@ -19,3 +20,4 @@ Scenario: User data can be set via a callback
And the exception "errorClass" equals "Error"
And the exception "message" equals "UserCallbackError"
And the event "user.name" equals "userCallbackName"
And the Bugsnag-Integrity header is valid

0 comments on commit 9cee021

Please sign in to comment.