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

ci: fixed detox tests. #1446

Merged
merged 41 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
104e4c1
build: pin specific expo version.
zhyd1997 Nov 26, 2023
c2e8d11
test: remove listener.
zhyd1997 Nov 26, 2023
78dbdfa
test: pass empty listener.
zhyd1997 Nov 26, 2023
96bf14e
Merge branch 'jhipster:main' into ci/ticket-889-1700974455106
zhyd1997 Dec 1, 2023
200440c
test: jest mock expo.
zhyd1997 Dec 2, 2023
2948cfd
ci: updated config.
zhyd1997 Dec 2, 2023
db086d9
fix: get IOS_DEVICE_NAME from new detox config.
zhyd1997 Dec 2, 2023
051de88
e2e: removed outdated test enviroment config.
zhyd1997 Dec 3, 2023
ff330f4
fix: added sb config in metro.config.js.ejs
zhyd1997 Dec 6, 2023
a88adac
Merge branch 'main' into ci/ticket-889-1700974455106
zhyd1997 Dec 10, 2023
a5ebc51
Merge branch 'main' into ci/ticket-889-1700974455106
zhyd1997 Dec 16, 2023
dea496a
e2e: updated ios device to iPhone 15.
zhyd1997 Dec 16, 2023
dcaa9a2
fix: rewrite reloadApp.
zhyd1997 Dec 16, 2023
0d7fa2d
e2e: use latest expo go sdk.
zhyd1997 Dec 16, 2023
dadd92e
e2e: use iPhone 14 as ios simulator.
zhyd1997 Dec 16, 2023
31cc211
e2e: disable synchronization and close developer menu.
zhyd1997 Dec 17, 2023
1597428
ci: added circle ci config for OAuth app e2e.
zhyd1997 Dec 17, 2023
9c2590f
fix: removed expo-detox-hook deps.
zhyd1997 Dec 17, 2023
0ed0dc1
e2e: bypass save password prompt.
zhyd1997 Dec 18, 2023
7433646
e2e: reload app with new instance.
zhyd1997 Dec 18, 2023
b50a2ac
fix: import HeaderBackButton from '@react-navigation/elements'
zhyd1997 Dec 19, 2023
e5a4592
ci: removed circle ci integration.
zhyd1997 Dec 19, 2023
02fe277
try to change abi version
mshima Dec 19, 2023
e465372
Update utils.js.ejs
mshima Dec 19, 2023
d89acdd
Merge branch 'main' into ci/ticket-889-1700974455106
zhyd1997 Dec 21, 2023
4bd9c03
e2e: ignore failing tests.
zhyd1997 Dec 21, 2023
ddff361
e2e: skip failing tests.
zhyd1997 Dec 21, 2023
1853a4e
Merge branch 'main' into ci/ticket-889-1700974455106
zhyd1997 Dec 23, 2023
fde2c17
e2e: enabled login screen test.
zhyd1997 Dec 23, 2023
4175235
e2e: enabled setting screen test.
zhyd1997 Dec 23, 2023
2fea726
ci: setup Xcode 15.
zhyd1997 Dec 23, 2023
0a60cc6
e2e: upgraded simulator from iPhone 14 with iPhone 15.
zhyd1997 Dec 23, 2023
563748b
ci: setup JwtHealthPointsApp circle ci config.
zhyd1997 Dec 23, 2023
ecc4e79
e2e: enabled change password test.
zhyd1997 Dec 23, 2023
51ed7e4
e2e: wait 2s to open drawer. (#7)
zhyd1997 Dec 23, 2023
fb9b3dd
e2e: enabled chat screen test. (#9)
zhyd1997 Dec 23, 2023
e034d30
Merge branch 'main' into ci/ticket-889-1700974455106
mshima Jan 3, 2024
e41073c
Merge branch 'main' into ci/ticket-889-1700974455106
zhyd1997 Feb 21, 2024
df1dd43
bump react-native
mshima Feb 22, 2024
5133f0e
disable change passa
mshima Feb 22, 2024
03d824c
add iOS summary for ci auto-merge requirement
mshima Feb 22, 2024
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
6 changes: 3 additions & 3 deletions generators/app/resources/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"react-native-web": "~0.19.6"
},
"devDependencies": {
"expo": "49.0.6",
"expo-template-blank-typescript": "49.0.14",
"jest-expo": "^49.0.0",
"expo": "48.0.6",
"expo-template-blank-typescript": "48.0.6",
"jest-expo": "48.0.2",
"typescript": "^5.1.3"
}
}
26 changes: 21 additions & 5 deletions generators/app/templates/.detoxrc.json.ejs
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
{
"configurations": {
"ios.sim.release": {
"device": "simulator",
"app": "myApp.ios",
}
},
"apps": {
"myApp.ios": {
"type": "ios.app",
"binaryPath": "e2e/Exponent.app",
},
},
"devices": {
"simulator": {
"type": "ios.simulator",
"device": {
"type": "iPhone 12"
}
}
"type": "iPhone 12",
},
},
},
"artifacts": {
"rootDir": ".artifacts",
Expand All @@ -20,6 +31,11 @@
}
}
},
"test-runner": "jest",
"runner-config": "./e2e/config.json"
"testRunner": {
"$0": "jest",
"args": {
"config": "./e2e/config.json"
},
"_": ["e2e"]
}
}
10 changes: 7 additions & 3 deletions generators/app/templates/e2e/config.json.ejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{
"testEnvironment": "./environment",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considering rewrite reloadApp, or maybe occur an issue: wix/Detox#3992

"rootDir": "..",
"testMatch": ["<rootDir>/e2e/**/*.spec.js"],
"reporters": ["detox/runners/jest/reporter"],
"testEnvironment": "<rootDir>/e2e/environment",
"globalSetup": "detox/runners/jest/globalSetup",
"globalTeardown": "detox/runners/jest/globalTeardown",
"testRunner": "jest-circus/runner",
"testTimeout": 300000,
"testRegex": "\\.spec\\.js$",
"reporters": ["detox/runners/jest/streamlineReporter"],
"maxWorkers": 1,
"verbose": true
}
11 changes: 1 addition & 10 deletions generators/app/templates/e2e/environment.js.ejs
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
const { DetoxCircusEnvironment, SpecReporter, WorkerAssignReporter } = require('detox/runners/jest-circus');
const { DetoxCircusEnvironment } = require('detox/runners/jest');
const { init: initExpo } = require('@ruddell/detox-expo-helpers');

class CustomDetoxEnvironment extends DetoxCircusEnvironment {
constructor(config, context) {
super(config, context);

initExpo();
// Can be safely removed, if you are content with the default value (=300000ms)
this.initTimeout = 300000;

// This takes care of generating status logs on a per-spec basis. By default, Jest only reports at file-level.
// This is strictly optional.
this.registerListeners({
SpecReporter,
WorkerAssignReporter,
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/e2e/scripts/setup.sh.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo 'Checking for Expo App...'
./e2e/scripts/download-expo.sh

# get ios device name from detox config
IOS_DEVICE_NAME=$(cat .detoxrc.json | jq -rc '.configurations | .[] | .device | .type')
IOS_DEVICE_NAME=$(cat .detoxrc.json | jq -rc '.devices | .[] | .device | .type')
# get simulator matching that name
DEVICE_ID=$(xcrun simctl list devices -j | jq -rc ".[] | .[] | .[] | select( .name == \"$IOS_DEVICE_NAME\" ) | select( .isAvailable == true ) | .udid")

Expand Down
3 changes: 3 additions & 0 deletions generators/app/templates/test/setup.js.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ jest
.mock('@storybook/react-native', () => {
return { getStorybookUI: jest.fn(), configure: jest.fn() }
})
// https://github.com/expo/expo/issues/23591#issuecomment-1652548059
.mock('expo-font')
.mock('expo-asset')
2 changes: 1 addition & 1 deletion lib/patch-babel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function patchBabel() {
this.patchInFile('babel.config.js', {
after: 'presets',
insert: "plugins: ['react-native-reanimated/plugin'],",
insert: "plugins: ['@babel/plugin-transform-export-namespace-from', 'react-native-reanimated/plugin'],",
ignoreIfContains: 'react-native-reanimated',
});
}
Expand Down
3 changes: 3 additions & 0 deletions test/scripts/generate-react-native-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ else
--defaults --no-insight --skip-git
fi

# pin specific version of expo
npm i expo@48.0.6

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an issue in the latest expo, which mean e2e will fails in the local env as well:

Screenshot 2023-12-03 at 10 44 05

expo/expo#25551

Copy link
Contributor Author

@zhyd1997 zhyd1997 Dec 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it failed with downgraded `expo`: Screenshot 2023-12-03 at 19 47 48

Copy link
Contributor Author

@zhyd1997 zhyd1997 Dec 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with the latest `expo`: Screenshot 2023-12-03 at 19 51 51

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recorded video in CI:
test.mp4

# list files
ls -al