应用程序未响应以下网络请求:在运行排毒测试时 (Detox + Jest)

问题描述

我的设置

排毒:18.0.0 开玩笑:26.6.3 反应原生cli:2.0.1 节点:14.15.4 npm : 6.14.10 纱线:1.22.10 操作系统:Ubuntu 18.04 真实连接设备:Samsung M 01

Please find the image on below url,after initialise the app by detox its not loading properly and this error screen is coming on connected device

My init.js 

const detox = require('detox');
const adapter = require('detox/runners/jest/adapter');
const specReporter = require('detox/runners/jest/specReporter');

// Set the default timeout
jest.setTimeout(2000);

jasmine.getEnv().addReporter(adapter);`enter code he`enter code here`re`

// This takes care of generating status logs on a per-spec basis. By default,jest only reports at file-level.
// This is strictly optional.
jasmine.getEnv().addReporter(specReporter);

beforeAll(async () => {
  await detox.init();
  device.launchApp();
},300000);

beforeEach(async () => {
  try {
    await adapter.beforeEach();
  } catch (err) {
    // Workaround for the 'jest-jasmine' runner (default one): if 'beforeAll' hook above fails with a timeout,// unfortunately,'jest' might continue running other hooks and test suites. To prevent that behavior,// adapter.beforeEach() will throw if detox.init() is still running; that allows us to run detox.cleanup()
    // in that emergency case and disable calling 'device','element','expect','by' and other Detox globals.
    // If you switch to 'jest-circus' runner,you can omit this try-catch workaround at all.

    await detox.cleanup();
    throw err;
  }
});

afterall(async () => {
  await adapter.afterall();
  await detox.cleanup();
});




My Package.json :


  "detox": {
    "configurations": {
      "android.emu.debug": {
        "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk","build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..","type": "android.attached","device": {
          "adbname":"R9BN90441KJ"
        }
      },"android.emu.release": {
        "binaryPath": "android/app/build/outputs/apk/release/app-release.apk","build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..","type": "android.emulator","name": "Test Kirana"
      }
    },"specs": "e2e","test-runner": "jest"
  },"rnpm": {
    "assets": [
      "android/app/src/main/assets/fonts/Roboto/Roboto-Regular.ttf"
    ]
  }

请在下面找到错误消息:

detox[10532] WARN:[Client.js/PENDING_REQUESTS] 应用没有响应以下网络请求:

提示:很可能,您的测试在等待来自检测过程的“就绪”消息(通过 WebSocket)时已超时并调用了 detox.cleanup()。 (使用 node --trace-warnings ... 显示警告的创建位置)

测试运行完成后,Jest 没有退出一秒。

detox[10520] 错误:[cli.js] 错误:命令失败:jest --config e2e/config.json --testNamePattern '^((?!:ios:).)*$' --maxWorkers 1 e2e/01-placeorder_from_all_page.spec.js

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)