Skip to content
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
8 changes: 5 additions & 3 deletions .buildkite/basic/react-native-ios-full-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ steps:
- "0.72"
- "0.74"
- "0.76"
- "0.77"
# TODO: 0.77 moved to the basic pipeline (where 0.78 has been skipped) pending PLAT-14005
#- "0.77"
retry:
automatic:
- exit_status: "*"
Expand Down Expand Up @@ -216,7 +217,7 @@ steps:
concurrency: 5
concurrency_group: "browserstack-app"
concurrency_method: eager

- label: ":bitbar: :mac: RN {{matrix}} iOS (Old Arch) end-to-end tests"
depends_on: "build-react-native-ios-fixture-old-arch-full"
timeout_in_minutes: 40
Expand Down Expand Up @@ -253,7 +254,8 @@ steps:
- "0.72"
- "0.74"
- "0.76"
- "0.77"
# TODO: 0.77 moved to the basic pipeline (where 0.78 has been skipped) pending PLAT-14005
#- "0.77"

- label: ":bitbar: :mac: RN {{matrix}} iOS (New Arch) end-to-end tests"
depends_on: "build-react-native-ios-fixture-new-arch-full"
Expand Down
6 changes: 4 additions & 2 deletions .buildkite/basic/react-native-ios-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ steps:
- "bundle install"
- "node scripts/generate-react-native-fixture.js"
matrix:
- "0.78"
# TODO: 0.78 moved back to 0.77 pending PLAT-14005
- "0.77"
retry:
automatic:
- exit_status: "*"
Expand Down Expand Up @@ -92,7 +93,8 @@ steps:
concurrency_group: "bitbar"
concurrency_method: eager
matrix:
- "0.78"
# TODO: 0.78 moved back to 0.77 pending PLAT-14005
- "0.77"

- label: ":bitbar: :mac: RN {{matrix}} iOS (New Arch) end-to-end tests"
depends_on: "build-react-native-ios-fixture-new-arch"
Expand Down
35 changes: 14 additions & 21 deletions test/react-native/features/steps/react-native-steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,46 +50,39 @@ def execute_command(action, scenario_name = '', scenario_data = '')
def wait_for_app_state(expected_state)
max_attempts = 20
attempts = 0
state = get_app_state
manager = Maze::Api::Appium::AppManager.new
state = manager.state
until (attempts >= max_attempts) || state == expected_state
attempts += 1
state = get_app_state
state = manager.state
sleep 0.5
end
$logger.warn "App state #{state} instead of #{expected_state} after 10s" unless state == expected_state
state
end

def get_app_state
case Maze::Helper.get_current_platform
when 'ios'
Maze.driver.app_state('com.bugsnag.fixtures.reactnative')
when 'android'
Maze.driver.app_state('com.reactnative')
end
end

When('I relaunch the app after a crash') do
state = wait_for_app_state :not_running
# TODO: Really we should be using terminate_app/activate_app with the newer Appium client,
# but for some reason they seem to make some scenarios flaky (presumably due to the
# nature of how/when they close the app).
manager = Maze::Api::Appium::AppManager.new
if state != :not_running
Maze.driver.close_app
# Maze.driver.terminate_app Maze.driver.app_id
manager.close
# manager.terminate
end
Maze.driver.launch_app
# Maze.driver.activate_app Maze.driver.app_id
manager.launch
# manager.activate
end

When('I clear any error dialogue') do
# Error dialogue is auto-cleared on IOS
next unless Maze.driver.capabilities['os'] == 'android'
next unless Maze::Helper.get_current_platform == 'android'

driver = Maze.driver
driver.click_element('android:id/button1') if driver.wait_for_element('android:id/button1', 3)
driver.click_element('android:id/aerr_close') if driver.wait_for_element('android:id/aerr_close', 3)
driver.click_element('android:id/aerr_restart') if driver.wait_for_element('android:id/aerr_restart', 3)
manager = Maze::Api::Appium::UiManager.new
manager.click_element('android:id/button1') if manager.wait_for_element('android:id/button1', 3)
manager.click_element('android:id/aerr_close') if manager.wait_for_element('android:id/aerr_close', 3)
manager.click_element('android:id/aerr_restart') if manager.wait_for_element('android:id/aerr_restart', 3)
end

When('I configure Bugsnag for {string}') do |scenario_name|
Expand Down Expand Up @@ -170,7 +163,7 @@ def get_app_state
payload_value = Maze::Helper.read_key_path(payload, "events.0.#{field_path}")

expected_value = get_value_for_arch_and_version(table)

unless expected_value.eql?('@skip')
assert_equal_with_nullability(expected_value, payload_value)
end
Expand Down
4 changes: 2 additions & 2 deletions test/react-native/features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Before do
# See https://www.browserstack.com/docs/app-automate/appium/troubleshooting/app-orientation-issues
Maze.driver.set_rotation(:portrait)
Maze::Api::Appium::DeviceManager.new.set_rotation(:portrait)
end

Before('@android_only') do |_scenario|
Expand Down Expand Up @@ -45,4 +45,4 @@
Before('@skip_new_arch_below_074') do |scenario|
current_version = ENV['RN_VERSION'].nil? ? 0 : ENV['RN_VERSION'].to_f
skip_this_scenario("Skipping scenario") if ENV['RCT_NEW_ARCH_ENABLED'].eql?('1') && current_version < 0.74
end
end