Skip to content

Commit

Permalink
Ignore invalid sessions in all crashing scenarios (#1414)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell committed Jun 23, 2022
1 parent c8c0c39 commit 986f8f6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
1 change: 0 additions & 1 deletion features/barebone_tests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion features/last_run_info.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 1 addition & 23 deletions features/steps/app_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 986f8f6

Please sign in to comment.