From 296c1f190b2342a50efd47c820b05621c79795e9 Mon Sep 17 00:00:00 2001 From: Alex Moinet Date: Mon, 12 Dec 2022 15:23:25 +0000 Subject: [PATCH 1/5] Add oversized payload test to electron --- test/electron/features/delivery.feature | 20 +++++++++++++++++++ test/electron/fixtures/app/index.html | 1 + test/electron/fixtures/app/main.js | 19 ++++++++++++++++++ .../electron/fixtures/app/preloads/default.js | 3 +++ 4 files changed, 43 insertions(+) create mode 100644 test/electron/features/delivery.feature diff --git a/test/electron/features/delivery.feature b/test/electron/features/delivery.feature new file mode 100644 index 0000000000..a4a2491de6 --- /dev/null +++ b/test/electron/features/delivery.feature @@ -0,0 +1,20 @@ +Feature: Delivery of errors + + Scenario: Delivery for an oversized error is not retried + Given I launch an app + And I set the HTTP status code for the next "POST" request to 400 + And I click "main-oversized" + Then the total requests received by the server matches: + | events | 1 | + And the headers of every event request contains: + | Bugsnag-API-Key | 6425093c6530f554a9897d2d7d38e248 | + | Content-Type | application/json | + | Bugsnag-Integrity | {BODY_SHA1} | + # Check that resend is not attempted next load (e.g. for when persistence/retry is supported in node) + When I close the app + And I discard the oldest error + And I launch the app + Then I should receive no errors + Then the total requests received by the server matches: + | events | 0 | + | sessions | 0 | \ No newline at end of file diff --git a/test/electron/fixtures/app/index.html b/test/electron/fixtures/app/index.html index 4ca6f03f6a..3813992fcf 100644 --- a/test/electron/fixtures/app/index.html +++ b/test/electron/fixtures/app/index.html @@ -13,6 +13,7 @@

actions

  • Uncaught exception in main process
  • Unhandled promise rejection in main process
  • Handled error in main process
  • +
  • Handled error with oversized payload in main process
  • Crash in child process