使用带有 frameit 和 detox 的 fastlane 在 ios 和 android 设备上为我的 react native 应用程序运行测试和截屏(https://dev.to/jeevankishore/e2e-detox-react-native-161o)
iOS 运行良好,能够构建、运行模拟器、抓取屏幕截图并使用 iPhone 11 进行构图。
Android 构建并从模拟器中获取屏幕截图,但是当我运行fastlane frameit
它时,它并没有构建我的 android 屏幕截图。我尝试了一些模拟器(像素 3 xl 和 3a),但不断得到:
Unsupported screen size [1440, 2960] for path './screenshots/SCREENSHOT.png'
(像素 3 xl 尺寸)和
Unsupported screen size [1080, 2220] for path './screenshots/SCREENSHOT.png
(像素 3a 尺寸)
因为它在 frameit 的偏移列表中说支持像素 3 xl 设备而感到困惑?我发现很难找到有关受支持设备的信息。我在这里做错了什么。
https://fastlane.github.io/frameit-frames/latest/offsets.json
我跑了fastlane frameit download_frames
以供参考:
.detoxrc.json
"testRunner": "jest",
"runnerConfig": "e2e/config.json",
"configurations": {
"ios": {
"type": "ios.simulator",
"binaryPath": "ios/build/Build/Products/Release-iphonesimulator/APP.app",
"build": "xcodebuild -workspace ios/APP.xcworkspace -scheme APP -configuration Release -sdk iphonesimulator -derivedDataPath ios/build",
"device": {
"type": "iPhone 11"
}
},
"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew app:assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"device": {
"avdName": "Pixel_3_XL_API_29"
}
},
"android.emu.release": {
"binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
"build": "cd android && ./gradlew app:assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
"type": "android.emulator",
"device": {
"avdName": "Pixel_3_XL_API_29"
}
}
}
}
帧文件.json
{
"device_frame_version": "latest",
"default": {
"background": "./background.jpg",
"keyword": {
"font": "../../assets/fonts/Lato-Black.ttf",
"font_size": 124,
"font_weight": 900,
"color": "#FFF"
},
"title": {
"font": "../../assets/fonts/LatoBold.ttf",
"font_weight": 400,
"font_size": 36,
"color": "#D72429"
},
"title_min_height": "52%",
"padding": 50,
"interline_spacing": -2,
"show_complete_frame": false,
"stack_title": true
},
"data": [
{
"filter": "SCREENSHOT",
"title": {
"text": "More text here"
},
"keyword": {
"text": "Text"
}
}
]
}