DetoxRecorder icon indicating copy to clipboard operation
DetoxRecorder copied to clipboard

"detox recorder" can not be used as script with npm/yarn

Open fabianbru opened this issue 3 years ago • 5 comments

Describe the Bug When using a "detox recorder ..." command through the package.json "scripts" section nothing happens and process exits immediately without error/logs.

To Reproduce package.json

  "scripts": {
    "detox:ios:recorder": "detox recorder -b \"<APP_ID>\" -s booted -r --outputTestFile \"./test/e2e/NewTest.e2e.js\" --testName \"New Test\""
  },
  • run yarn detox:ios:recorder or npm run detox:ios:recorder
  • process will exit and no output is shown
» yarn detox:ios:recorder
yarn run v1.22.10
$ detox recorder -b "<APP_ID>" -s booted -r --outputTestFile "./test/e2e/NewTest.e2e.js" --testName "New Test"
✨  Done in 0.55s.

On the other hand copying the command above out of the package.json scripts and run it directly in the terminal will start the recording without problems.

Expected Behavior Running a "detox recorder ..." command as package.json script has the same effect as running it directly in the console.

Actual Behavior Running a "detox recorder ..." command as package.json script does nothing.

Screenshots no screens needed

Environment

  • macOS: 11.4
  • Xcode: 12.5
  • iOS Simulator Runtime: 14.5
  • Detox CLI version: 18.18.1
  • Detox Recorder Version: 1.0.151 (via package.json and also in "node_modules/detox-recorder/package.json), but detox recorder -v outputs 1.0.146

Logs no output is shown in log stream if run as script.

Additional Context

  • nvm installed
  • global yarn through brew

fabianbru avatar Jun 23 '21 09:06 fabianbru

Also facing the same issue. Anyone know of a fix?

RayKay91 avatar Sep 17 '21 09:09 RayKay91

Same here, any fix for this ?

MilanMalovic avatar Feb 09 '22 21:02 MilanMalovic

I am also facing this

karimdjemai avatar Feb 18 '22 13:02 karimdjemai

same here

isaac-tribal avatar May 03 '22 19:05 isaac-tribal

Workaround: "scripts": { "detox:ios:recorder": "node_modules/detox-recorder/DetoxRecorderCLI --bundleId com.example.app --simulatorId booted --outputTestFile 'temp/testFile.ts' --record" }

DenianFossatti avatar May 20 '22 18:05 DenianFossatti