From b9eb42c9904bc0d4d8d4b4bf6f362b17493a3616 Mon Sep 17 00:00:00 2001 From: igorgn <50628426+igorgn@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:45:14 +0200 Subject: [PATCH] test: update testing device, iPhone 15 Pro Max. Comply with Xcode 15 upgrade on CI. Co-authored-by: Yaroslav Serhieiev Co-authored-by: Asaf Korem --- .buildkite/pipeline_common.sh | 4 ++-- .xcoderc | 1 + detox/test/e2e/28.drag-and-drop.test.js | 20 ++++++++++-------- .../assets/elementScreenshot.ios.horiz.png | Bin 11288 -> 11300 bytes .../e2e/assets/elementScreenshot.ios.vert.png | Bin 37148 -> 37160 bytes detox/test/e2e/detox.config.js | 3 ++- examples/demo-native-ios/package.json | 2 +- .../package.json | 2 +- examples/demo-react-native/detox.config.js | 3 ++- examples/demo-react-native/ios/Podfile | 11 ++++++++++ scripts/ci.ios.sh | 13 ++++++++++++ 11 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 .xcoderc diff --git a/.buildkite/pipeline_common.sh b/.buildkite/pipeline_common.sh index 1d9e7afc93..7e49ac8a45 100755 --- a/.buildkite/pipeline_common.sh +++ b/.buildkite/pipeline_common.sh @@ -4,9 +4,9 @@ echo "steps:" cat .buildkite/jobs/pipeline.ios_rn_71.yml cat .buildkite/jobs/pipeline.ios_rn_70.yml +cat .buildkite/jobs/pipeline.ios_demo_app_rn_71.yml +cat .buildkite/jobs/pipeline.ios_demo_app_rn_70.yml cat .buildkite/jobs/pipeline.android_rn_71.yml cat .buildkite/jobs/pipeline.android_rn_70.yml cat .buildkite/jobs/pipeline.android_demo_app_rn_71.yml -cat .buildkite/jobs/pipeline.ios_demo_app_rn_71.yml -cat .buildkite/jobs/pipeline.ios_demo_app_rn_70.yml cat .buildkite/pipeline.post_processing.yml diff --git a/.xcoderc b/.xcoderc new file mode 100644 index 0000000000..ccc2f3b87f --- /dev/null +++ b/.xcoderc @@ -0,0 +1 @@ +15.1 \ No newline at end of file diff --git a/detox/test/e2e/28.drag-and-drop.test.js b/detox/test/e2e/28.drag-and-drop.test.js index f6a7b1442b..f326257a6e 100644 --- a/detox/test/e2e/28.drag-and-drop.test.js +++ b/detox/test/e2e/28.drag-and-drop.test.js @@ -3,7 +3,7 @@ describe(':ios: Drag And Drop', () => { await device.reloadReactNative(); await element(by.text('Drag And Drop')).tap(); }); - + afterEach(async () => { await element(by.id('closeButton')).tap(); }); @@ -14,20 +14,22 @@ describe(':ios: Drag And Drop', () => { await assertCellText(2, '10'); }); - it('should drag the second cell and drop before the ten cell position', async () => { - await assertCellText(9, '9'); - await element(by.id('cell2')).longPressAndDrag(1000, 0.9, NaN, element(by.id('cell10')), 0.9, 0.01, 'slow', 0); + it('should drag the second cell and drop on the ten cell position', async () => { + await assertCellText(2, '2'); await assertCellText(10, '10'); - //Because we used 0.001 as the drop Y point, the `cell2` actually landed at cell9, not cell10. - await assertCellText(9, '2'); + + await element(by.id('cell2')).longPressAndDrag(1000, 0.9, NaN, element(by.id('cell10')), 0.9, 0.01, 'slow', 0); + + await assertCellText(2, '3'); + await assertCellText(10, '2'); }); - + async function assertCellText(idx, value) { const attribs = await element(by.id('cellTextLabel')).getAttributes(); const cellStrings = attribs.elements.map(x => x.text); - + if(cellStrings[idx - 1] !== value) { throw new Error("Failed!"); } } -}); \ No newline at end of file +}); diff --git a/detox/test/e2e/assets/elementScreenshot.ios.horiz.png b/detox/test/e2e/assets/elementScreenshot.ios.horiz.png index eafb96ec814e7b6dffd86b3235ba09373af40aad..062771b1e4c7f32dba4978f73875499a76108a5b 100644 GIT binary patch delta 94 zcmbOcu_R)Gp?5`UglC$sFM}2X0|N&GE29ttGmymygba*Q46I-_1A`Z%G@Kp8r~y^O a#K6#=$-n|t6E(5Gh^0wgYyZY&McM#gs0`o$ delta 82 zcmZ1yF(YDvp?ywjglC$sFM}2X0|N&G3!@YRE0Dzq#CD9*aJCzx1_Lu#oQZ*W|(jS-9QGwF{THx+3E01f92Pyhe` diff --git a/detox/test/e2e/assets/elementScreenshot.ios.vert.png b/detox/test/e2e/assets/elementScreenshot.ios.vert.png index 8631a3398992d29b1f3051831713cc08a13a8961..93fbc3953c5a100329f461d10440a3286894866b 100644 GIT binary patch delta 96 zcmbQUh-t+lrU{1L6{!)PX}-P;S_}*f91N_CLJZ7679$WcFiJ77g4qlVUX0Rkb`YZm dR1FgYLwhCz3sg79$YbF-pVPZj2fX%wTaQ28Q-b W1{SCqzlk+QEWAm@nj1HjO#lEqz6~V+ diff --git a/detox/test/e2e/detox.config.js b/detox/test/e2e/detox.config.js index 8f7ba6b3fd..e8762e625d 100644 --- a/detox/test/e2e/detox.config.js +++ b/detox/test/e2e/detox.config.js @@ -99,7 +99,8 @@ const config = { type: 'ios.simulator', headless: Boolean(process.env.CI), device: { - type: 'iPhone 14 Pro Max', + type: 'iPhone 15 Pro Max', + os: "17.2", }, }, diff --git a/examples/demo-native-ios/package.json b/examples/demo-native-ios/package.json index f7fa7fb433..0bfaf0891d 100644 --- a/examples/demo-native-ios/package.json +++ b/examples/demo-native-ios/package.json @@ -23,7 +23,7 @@ "simulator": { "type": "ios.simulator", "device": { - "type": "iPhone 14 Pro" + "type": "iPhone 15 Pro Max" } } }, diff --git a/examples/demo-react-native-detox-instruments/package.json b/examples/demo-react-native-detox-instruments/package.json index d3a9e07600..2105485e46 100644 --- a/examples/demo-react-native-detox-instruments/package.json +++ b/examples/demo-react-native-detox-instruments/package.json @@ -11,7 +11,7 @@ "ios.sim.release": { "binaryPath": "../demo-react-native/ios/build/Build/Products/Release-iphonesimulator/example.app", "type": "ios.simulator", - "name": "iPhone 14" + "name": "iPhone 15 Pro Max" } } } diff --git a/examples/demo-react-native/detox.config.js b/examples/demo-react-native/detox.config.js index 58b4ff0bb8..2103e8bfcb 100644 --- a/examples/demo-react-native/detox.config.js +++ b/examples/demo-react-native/detox.config.js @@ -45,7 +45,8 @@ module.exports = { type: "ios.simulator", headless: Boolean(process.env.CI), device: { - type: "iPhone 14 Pro" + type: "iPhone 15 Pro Max", + os: "17.2", } }, emulator: { diff --git a/examples/demo-react-native/ios/Podfile b/examples/demo-react-native/ios/Podfile index e00e5f624b..09efef4fda 100644 --- a/examples/demo-react-native/ios/Podfile +++ b/examples/demo-react-native/ios/Podfile @@ -15,6 +15,7 @@ target 'example' do post_install do |installer| __apply_update_deployment_target_workaround(installer) + __apply_Xcode_15_workaround(installer) react_native_post_install( installer, @@ -37,3 +38,13 @@ def __apply_update_deployment_target_workaround(installer) end end end + +def __apply_Xcode_15_workaround(installer) + # This is a workaround for Xcode 15, see: https://github.com/facebook/react-native/issues/37748. + puts "Applying Xcode 15 post install workaround" + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION'] + end + end +end diff --git a/scripts/ci.ios.sh b/scripts/ci.ios.sh index 21ad56aeeb..90670a3e79 100755 --- a/scripts/ci.ios.sh +++ b/scripts/ci.ios.sh @@ -1,5 +1,14 @@ #!/bin/bash -ex +#Set xcode version from .xcoderc file +if [[ -f .xcoderc ]];then + xc_version=$(cat .xcoderc) + echo "Setting $xc_version" + export DEVELOPER_DIR="/Applications/Xcode_$xc_version.app/" +else + echo ".xcoderc not found. Xcode is default" +fi + UPLOAD_ARTIFACT="$(pwd)/scripts/upload_artifact.sh" trap "$UPLOAD_ARTIFACT" EXIT @@ -9,6 +18,10 @@ mkdir -p coverage pushd detox/test +## For some reason iOS simulators are not shown after resetting builder env +## After this command sims are available again +xcrun simctl list > /dev/null + run_f "npm run build:ios" run_f "npm run e2e:ios" cp coverage/lcov.info ../../coverage/e2e-ios-ci.lcov