Skip to content

Commit

Permalink
test: update testing device, iPhone 15 Pro Max.
Browse files Browse the repository at this point in the history
Comply with Xcode 15 upgrade on CI.

Co-authored-by: Yaroslav Serhieiev <[email protected]>
Co-authored-by: Asaf Korem <[email protected]>
  • Loading branch information
3 people authored Jan 11, 2024
1 parent 2032164 commit b9eb42c
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .xcoderc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
15.1
20 changes: 11 additions & 9 deletions detox/test/e2e/28.drag-and-drop.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand All @@ -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!");
}
}
});
});
Binary file modified detox/test/e2e/assets/elementScreenshot.ios.horiz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified detox/test/e2e/assets/elementScreenshot.ios.vert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion detox/test/e2e/detox.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},

Expand Down
2 changes: 1 addition & 1 deletion examples/demo-native-ios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"simulator": {
"type": "ios.simulator",
"device": {
"type": "iPhone 14 Pro"
"type": "iPhone 15 Pro Max"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-react-native-detox-instruments/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion examples/demo-react-native/detox.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
11 changes: 11 additions & 0 deletions examples/demo-react-native/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
13 changes: 13 additions & 0 deletions scripts/ci.ios.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down

0 comments on commit b9eb42c

Please sign in to comment.