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.
MIT License
300 stars 17 forks source link

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

Closed yungkittty closed 3 years ago

yungkittty commented 3 years ago

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

yungkittty commented 3 years ago

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"
      }
    }
  }
}
LeoNatan commented 3 years ago

Good catch, thanks!

LeoNatan commented 3 years ago

1.0.151 out with the fix.