Детокс - iOS - launchApp никогда не запускает приложение - PullRequest
0 голосов
/ 02 мая 2020

У меня есть базовое c приложение, которое может быть запущено и работает на iOS симуляторе, но , когда я пытаюсь запустить Детокс тесты, запускается приложение не работать . Приложение представляет собой базовый калькулятор c, который я могу использовать и выполнить любой ручной тест. Все ручные тесты работают нормально, но это не удается:

Система ( Я знаю, что есть более новая версия, но я должен работать с этой, если это возможно)

  • Детокс: 12.11.3
  • реактив-нативный-Cli: 2.0.1
  • реактив-нативный: 0,31,0
  • Узел: 12.16.3
  • Устройство: iOS Симулятор (iPhone 8, iOS 13.4)
  • Xcode: 11.4.1
  • iOS: 13.4
  • macOS: 10.15.4

init. js

const detox = require('detox');
const config = require('../package.json').detox;

before(async () => {
  console.log("before init");
  await detox.init(config, { launchApp: false });
  console.log("after init");
});

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

sampleTest.spe c. js

describe('Basic test', function () {

  beforeEach(async () => {
    console.log("before app launched");
    await device.launchApp({
      newInstance: true,
      launchArgs: { 'detoxPrintBusyIdleResources': 'YES' }
    });
    console.log("After app launched");
  });

  it('2 + 2 = 4', async () => {
    console.error("Test case running");
    await element(by.id('input-button-2')).tap();
    await element(by.id('input-button-+')).tap();
    await element(by.id('input-button-2')).tap();
    await element(by.id('input-button-=')).tap();
    await expect(element(by.id('display-text'))).toHaveText('4');
  })
});

пакет. json

{
  "name": "ReactCalculator",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "postinstall": "make postinstall"
  },
  "dependencies": {
    "react": "15.2.1",
    "react-native": "0.31.0",
    "detox": "^12.11.0",
    "mocha": "^6.1.4"
  },
  "detox": {
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/ReactCalculator.app",
        "build": "xcodebuild -project ios/ReactCalculator.xcodeproj -scheme ReactCalculator -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
        "type": "ios.simulator",
        "name": "iPhone 8,iOS 13.4"
      }
    },
    "test-runner": "mocha",
    "runner-config": "./mocha.opts",
    "specs": ""
  }
}

Журнал вижу в консоли

detox test
detox[4407] INFO:  [test.js] node_modules/.bin/mocha --opts ./mocha.opts --configuration ios.sim.debug --grep :android: --invert --artifacts-location "artifacts/ios.sim.debug.2020-05-02 16-48-45Z" "e2e"


before init
detox[4408] INFO:  [DetoxServer.js] server listening on localhost:53253...
after init
  Basic test
before app launched
detox[4408] INFO:  [AppleSimUtils.js] org.reactjs.native.example.ReactCalculator launched. To watch simulator logs, run:
        /usr/bin/xcrun simctl spawn 410A2B91-5C4B-4DA8-97C9-F16E4EE2A3FB log stream --level debug --style compact --predicate 'processImagePath beginsWith "/Users/myuser/Library/Developer/CoreSimulator/Devices/410A2B91-5C4B-4DA8-97C9-F16E4EE2A3FB/data/Containers/Bundle/Application/FF32A1C3-F0C5-4847-AD0A-B559FCC4D78E/ReactCalculator.app"'
    1) "before each" hook for "2 + 2 = 4"


  0 passing (2m)
  1 failing

  1) Basic test
       "before each" hook for "2 + 2 = 4":
     Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/myuser/Desktop/ReactCalculator 2/e2e/sampleTest.spec.js)
      at listOnTimeout (internal/timers.js:549:17)
      at processTimers (internal/timers.js:492:7)



detox[4407] ERROR: [cli.js] Error: Command failed: node_modules/.bin/mocha --opts ./mocha.opts --configuration ios.sim.debug --grep :android: --invert --artifacts-location "artifacts/ios.sim.debug.2020-05-02 16-48-45Z" "e2e"

Я следовал пошаговому руководству, чтобы установить его: Детокс, начало работы

Кто-то знает, что происходит? Я знаю, что не использую последние версии многих зависимостей , но предполагается, что так и будет.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...