From 85153f5990802f20445a3500b0069e5210c8c5d1 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Wed, 26 Mar 2025 21:58:08 +0000 Subject: [PATCH 1/3] Do not use Maze.driver directly --- .../features/steps/react-native-steps.rb | 35 ++++++++----------- test/react-native/features/support/env.rb | 4 +-- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/test/react-native/features/steps/react-native-steps.rb b/test/react-native/features/steps/react-native-steps.rb index 3523382154..7eb162318c 100644 --- a/test/react-native/features/steps/react-native-steps.rb +++ b/test/react-native/features/steps/react-native-steps.rb @@ -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| @@ -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 diff --git a/test/react-native/features/support/env.rb b/test/react-native/features/support/env.rb index 63a3253da8..b71678a7c6 100644 --- a/test/react-native/features/support/env.rb +++ b/test/react-native/features/support/env.rb @@ -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| @@ -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 \ No newline at end of file +end From f9c4339e0ebb150e2f1874e5a67136ea6f5d861b Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Thu, 27 Mar 2025 10:49:45 +0000 Subject: [PATCH 2/3] Skip failing job pending further investigation --- .buildkite/basic/react-native-ios-full-pipeline.yml | 5 +++-- .buildkite/basic/react-native-ios-pipeline.yml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.buildkite/basic/react-native-ios-full-pipeline.yml b/.buildkite/basic/react-native-ios-full-pipeline.yml index 88eafdefc7..9bf1316d8d 100644 --- a/.buildkite/basic/react-native-ios-full-pipeline.yml +++ b/.buildkite/basic/react-native-ios-full-pipeline.yml @@ -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: "*" @@ -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 diff --git a/.buildkite/basic/react-native-ios-pipeline.yml b/.buildkite/basic/react-native-ios-pipeline.yml index ddf8500cd1..7f74d8cae4 100644 --- a/.buildkite/basic/react-native-ios-pipeline.yml +++ b/.buildkite/basic/react-native-ios-pipeline.yml @@ -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: "*" From 21af76ede2990052c0f31e578f27a6f8f1c88f55 Mon Sep 17 00:00:00 2001 From: Steve Kirkland-Walton Date: Thu, 27 Mar 2025 11:08:40 +0000 Subject: [PATCH 3/3] Missed steps on previous commit --- .buildkite/basic/react-native-ios-full-pipeline.yml | 3 ++- .buildkite/basic/react-native-ios-pipeline.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.buildkite/basic/react-native-ios-full-pipeline.yml b/.buildkite/basic/react-native-ios-full-pipeline.yml index 9bf1316d8d..ae7bb05e09 100644 --- a/.buildkite/basic/react-native-ios-full-pipeline.yml +++ b/.buildkite/basic/react-native-ios-full-pipeline.yml @@ -254,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" diff --git a/.buildkite/basic/react-native-ios-pipeline.yml b/.buildkite/basic/react-native-ios-pipeline.yml index 7f74d8cae4..47bc51a7e8 100644 --- a/.buildkite/basic/react-native-ios-pipeline.yml +++ b/.buildkite/basic/react-native-ios-pipeline.yml @@ -93,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"