-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f44dd5
commit 804a370
Showing
6 changed files
with
88 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...narios-bugsnag/src/main/java/com/bugsnag/android/mazerunner/scenarios/ExitInfoScenario.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.bugsnag.android.mazerunner.scenarios | ||
|
||
import android.content.Context | ||
import android.os.Handler | ||
import android.os.Looper | ||
import android.util.Log | ||
|
||
import com.bugsnag.android.Bugsnag | ||
import com.bugsnag.android.Configuration | ||
|
||
class ExitInfoScenario( | ||
config: com.bugsnag.android.Configuration, | ||
context: android.content.Context, | ||
eventMetadata: String? | ||
) : Scenario(config, context, eventMetadata) { | ||
external fun crash(value: Int): Int | ||
override fun startScenario() { | ||
super.startScenario() | ||
Bugsnag.startSession() | ||
val main: android.os.Handler = android.os.Handler(android.os.Looper.getMainLooper()) | ||
main.postDelayed(object : java.lang.Runnable { | ||
override fun run() { | ||
crash(2726) | ||
} | ||
}, 500) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Application exitInfo is reported in crashes | ||
|
||
Background: | ||
Given I clear all persistent data | ||
|
||
@skip_below_android_11 | ||
Scenario: Application exitInfo is reported in crashes | ||
When I set the screen orientation to portrait | ||
And I run "ExitInfoScenario" and relaunch the crashed app | ||
And I configure Bugsnag for "ExitInfoScenario" | ||
And I wait to receive an error | ||
Then the error is valid for the error reporting API version "4.0" for the "Android Bugsnag Notifier" notifier | ||
And the error payload field "events.0.metaData.app.processImportance" equals "foreground" | ||
And the error payload field "events.0.metaData.app.exitReason" equals "crash" | ||
|