TestArmada / magellan-nightwatch-plugin

Magellan plugin to provide Nightwatch.js support
MIT License
11 stars 15 forks source link

desiredCapabilities cross-profile pollution #33

Closed esimons closed 6 years ago

esimons commented 6 years ago

Given the following profile configuration in magellan.json:

[
  {
    "browser": "iphone_11_2_iOS_iPhone_7_Simulator",
    "orientation": "portrait"
  },
  {
    "browser": "android_6_0_Android_Android_Emulator",
    "orientation": "portrait"
  },
  {
    "browser": "ipad_11_2_iOS_iPad_Simulator",
    "orientation": "portrait"
  },
  {
    "browser": "chrome_latest_Windows_10_Desktop",
    "resolution": "1280x960"
  },
  {
    "browser": "MicrosoftEdge_latest_Windows_10_Desktop",
    "resolution": "1280x960"
  },
  {
    "browser": "IE_11_Windows_10_Desktop",
    "resolution": "1280x960"
  },
  {
    "browser": "IE_10_Windows_7_Desktop",
    "resolution": "1280x960"
  },
  {
    "browser": "firefox_latest_Windows_10_Desktop",
    "resolution": "1280x960"
  },
  {
    "browser": "safari_latest_OS_X_10_13_Desktop",
    "resolution": "1280x960"
  }
]

I'm seeing incorrect sauce desiredCapabilities written to my various nightwatch.json temp files. Here's an example output from the iPhone 7 Simulator profile:

"desiredCapabilities": {
  "browserName": "iphone",
  "platform": "iOS",
  "version": "11.2",
  "screenResolution": "1280x960",
  "marionette": true,
  "javascriptEnabled": true,
  "deviceName": "iPhone 7 Simulator",
  "deviceOrientation": "portrait",
  "platformVersion": "6.0",
  "platformName": "Android"
}

Note that the screenResolution setting is desktop-sized, the Firefox-specific marionette option is selected, and the platformName and platformVersion look to have spilled over from the Android profile.

Expected output here for the iPhone 7 Simulator:

"desiredCapabilities": {
  "browserName": "iphone",
  "platform": "iOS",
  "version": "11.2",
  "deviceName": "iPhone 7 Simulator",
  "deviceOrientation": "portrait"
}

When I make the changes from #32 locally, Magellan provides the latter (expected) output.

archlichking commented 6 years ago

32 is merged and testarmada-magellan-nightwatch-plugin@8.0.1 is out. thanks for the fix.