wix-incubator / DetoxRecorder

Detox Recorder is a utility for recordings steps for a Detox test as you use your app in Simulator. After recording the test, add expectations that check if interface elements are in the expected state.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

device.os field from the detox config isn't used correctly

yungkittty opened this issue · comments

Describe the Bug
The Detox Recorder CLI isn't matching "correctly" the OS field inside .detoxrc.json and the --byOS argument of applesimutils

To Reproduce
Use a similar detox configuration detoxrc.json to this one :

{
  "testRunner": "xxxx",
  "runnerConfig": "xxxx",
  "configurations": {
    "xxxx": {
      "type": "ios.simulator",
      "binaryPath": "xxxx",
      "build": "xxxx",
      "device": {
        "type": "iPhone 8",
        "os": "iOS 14.4"
      }
    }
  }
}

Expected Behavior
The Detox Recorder CLI should use --byOS argument.

Actual Behavior
The Detox Recorder CLI use --byOs argument (which doesn't exist).

Additional Context
This is due to the method used to determine the argument name here :
https://github.com/wix/DetoxRecorder/blob/b219928ebc3532ae3be8650c0a27c5ff2c8b317d/DetoxRecorder/DetoxRecorderCLI/main.swift#L330

The current workaround is to define the os like that :

{
  "testRunner": "xxxx",
  "runnerConfig": "xxxx",
  "configurations": {
    "xxxx": {
      "type": "ios.simulator",
      "binaryPath": "xxxx",
      "build": "xxxx",
      "device": {
        "type": "iPhone 8",
        "OS": "iOS 14.4"
      }
    }
  }
}

Good catch, thanks!

1.0.151 out with the fix.