Reactjs 排毒e2e测试分配给未定义和跳过的所有测试
在我们的react native项目中,我们使用解毒药进行e2e测试。这些都工作得很好,直到我们突然体验到测试套件被分配到未定义的。奇怪的是,这个问题在恢复到以前排毒有效的状态时仍然存在。iOS和Android配置都存在问题 (这个问题类似于问题,但是,到目前为止,解毒应该与我们的react原生版本一起工作。) MyReactjs 排毒e2e测试分配给未定义和跳过的所有测试,reactjs,react-native,jestjs,detox,Reactjs,React Native,Jestjs,Detox,在我们的react native项目中,我们使用解毒药进行e2e测试。这些都工作得很好,直到我们突然体验到测试套件被分配到未定义的。奇怪的是,这个问题在恢复到以前排毒有效的状态时仍然存在。iOS和Android配置都存在问题 (这个问题类似于问题,但是,到目前为止,解毒应该与我们的react原生版本一起工作。) Myrc.json: { "testRunner": "jest", "runnerConfig": "e
rc.json
:
{
"testRunner": "jest",
"runnerConfig": "e2e/config.json",
"configurations": {
"ios": {
"type": "ios.simulator",
"binaryPath": "ios/build/Build/Products/Test-iphonesimulator/Cliniserve One.app",
"build": "xcodebuild -workspace ios/shiftapp.xcworkspace -scheme shiftapp.test -configuration Test -sdk iphonesimulator -derivedDataPath ios/build",
"device": {
"type": "iPhone 11"
}
},
"android": {
"type": "android.emulator",
"binaryPath": "android/app/build/outputs/apk/development/debug/shiftapp_development_debug.apk",
"build": "cd android && ./gradlew assembleDevelopmentDebug assembleDevelopmentDebugAndroidTest -DtestBuildType=debug && cd ..",
"device": {
"avdName": "Pixel_API_29_AOSP"
}
}
}
}
Mye2e/config.json
{
"setupFilesAfterEnv" : ["./init.js"],
"testEnvironment": "./environment",
"testRunner": "jest-circus/runner",
"testTimeout": 120000,
"testRegex": "\\.e2e\\.js$",
"reporters": ["detox/runners/jest/streamlineReporter"],
"verbose": true
}
和e2e/environment.js
const {
DetoxCircusEnvironment,
SpecReporter,
WorkerAssignReporter,
} = require('detox/runners/jest-circus');
class CustomDetoxEnvironment extends DetoxCircusEnvironment {
constructor(config) {
super(config);
// 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,
});
}
}
module.exports = CustomDetoxEnvironment;
如果您有任何关于如何使其重新工作的帮助或想法,我们将不胜感激。关于
$adb devices
和$xcrun simctl list
的输出是什么?您看到配置中列出的设备了吗?$adb devices
和$xcrun simctl list
的输出是什么?您看到配置中列出的设备了吗?