Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore invalid sessions in all crashing scenarios #1414

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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