From 986f8f6d545f7c530de470fb08cbfbbd699d810c Mon Sep 17 00:00:00 2001 From: Nick Dowell Date: Thu, 23 Jun 2022 14:32:47 +0100 Subject: [PATCH] Ignore invalid sessions in all crashing scenarios (#1414) --- features/barebone_tests.feature | 1 - features/last_run_info.feature | 1 - features/steps/app_steps.rb | 24 +----------------------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/features/barebone_tests.feature b/features/barebone_tests.feature index bbd23e2ad..d6befeb99 100644 --- a/features/barebone_tests.feature +++ b/features/barebone_tests.feature @@ -121,7 +121,6 @@ Feature: Barebone tests @watchos Scenario: Barebone test: unhandled error - Given I ignore invalid sessions When I run "BareboneTestUnhandledErrorScenario" and relaunch the crashed app And I set the app to "report" mode And I configure Bugsnag for "BareboneTestUnhandledErrorScenario" diff --git a/features/last_run_info.feature b/features/last_run_info.feature index 9d3780cd5..73af5d450 100644 --- a/features/last_run_info.feature +++ b/features/last_run_info.feature @@ -2,7 +2,6 @@ Feature: Launch detection Background: Given I clear all persistent data - And I ignore invalid sessions Scenario: LastRunInfo consecutiveLaunchCrashes increments when isLaunching is true When I run "LastRunInfoScenario" and relaunch the crashed app diff --git a/features/steps/app_steps.rb b/features/steps/app_steps.rb index cc09cf0fb..3f192d025 100644 --- a/features/steps/app_steps.rb +++ b/features/steps/app_steps.rb @@ -4,34 +4,12 @@ When("I run {string} and relaunch the crashed app") do |event_type| steps %( + Given I ignore invalid sessions Given I run \"#{event_type}\" And I relaunch the app after a crash ) end -When("I run the configured scenario and relaunch the crashed app") do - case Maze::Helper.get_current_platform - when 'ios' - run_and_relaunch - when 'macos' - $scenario_mode = $last_scenario[:scenario_mode] - execute_command($last_scenario[:action], $last_scenario[:scenario_name]) - when 'watchos' - run_watchos_app - sleep 10 # we don't have a way to check if the app is still running - else - raise "Unsupported platform: #{Maze::Helper.get_current_platform}" - end -end - -def run_and_relaunch - steps %( - Given I click the element "run_scenario" - And the app is not running - Then I kill and relaunch the app - ) -end - When('I clear all persistent data') do $reset_data = true end