In the past, tests could be ported to mobile device emulators with the same desired capability key/value pairs as desktop browsers. It looks like this has now changed according to the documentation on saucelabs and chromedriver:
This issue was discovered when an execution against Android Chrome and IOS Safari failed due to an invalid screen resolution size. Scaffold is attempting to use a desktop browser configuration (via ChromeOptions or SafariOptions) on a mobile device emulator and it will fail every time.
Expected
We shouldn't need to specify a screen resolution size and instead should be able to select a device. After some additional research, we will need to do the following work to fix the mobile device emulation support:
Add DeviceName to DesiredCapabilitiesConfigurationProperties
Update WebDriverManager to first check RunPlatform. If RunPlatform is Android or IOS, follow a different configuration logic on WebDriverManager#configureBrowserOptions(). Otherwise, if RunPlatform != Android or IOS, follow the existing configuration logic.
Add some new error messaging when using RunPlatform as Android or IOS. We want to make sure that the required mobile emulator desired capabilities are set when initializing the browser and device.
After implementing the change, we will need to test and ensure the desired capabilities are being configured correctly.
Repro
Execute a run against sauce with run platform android and browser type chrome
Bug
In the past, tests could be ported to mobile device emulators with the same desired capability key/value pairs as desktop browsers. It looks like this has now changed according to the documentation on saucelabs and chromedriver:
This issue was discovered when an execution against
Android Chrome
andIOS Safari
failed due to an invalid screen resolution size. Scaffold is attempting to use a desktop browser configuration (viaChromeOptions
orSafariOptions
) on a mobile device emulator and it will fail every time.Expected
We shouldn't need to specify a screen resolution size and instead should be able to select a device. After some additional research, we will need to do the following work to fix the mobile device emulation support:
DeviceName
toDesiredCapabilitiesConfigurationProperties
WebDriverManager
to first checkRunPlatform
. IfRunPlatform
isAndroid
orIOS
, follow a different configuration logic onWebDriverManager#configureBrowserOptions()
. Otherwise, ifRunPlatform
!=Android
orIOS
, follow the existing configuration logic.RunPlatform
asAndroid
orIOS
. We want to make sure that the required mobile emulator desired capabilities are set when initializing the browser and device.After implementing the change, we will need to test and ensure the desired capabilities are being configured correctly.
Repro