- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 750
Description
The fix #5107 doesn't work in the WebDriver methods (e.g. in checkOption()) if the config has set platform: "Android" instead of platform: "android"
    helpers: {
        Appium: {
            appiumV2: true,
            platform: "Android",
            ...
        }
    }Note that the upper case form is allowed according to the docs https://codecept.io/helpers/Appium/#appium and here:
CodeceptJS/lib/helper/Appium.js
Lines 16 to 19 in cef6e01
| const supportedPlatform = { | |
| android: 'Android', | |
| iOS: 'iOS', | |
| } | 
The platformName is normalized in the WebDriver helper's method _startBrowser, but it's used only if you use WebDriver directly, not when using Appium.
CodeceptJS/lib/helper/WebDriver.js
Lines 626 to 628 in cef6e01
| if (this.browser.capabilities && this.browser.capabilities.platformName) { | |
| this.browser.capabilities.platformName = this.browser.capabilities.platformName.toLowerCase() | |
| } | 
So a solution should be normalization of the attribute in Appium. Adding of config.capabilities.platformName = config.capabilities.platformName.toLowerCase() under this condition (as the 2nd line) helps (advised by Copilot)
CodeceptJS/lib/helper/Appium.js
Lines 267 to 269 in cef6e01
| if (config.capabilities.platformName) { | |
| this.platform = config.capabilities.platformName.toLowerCase() | |
| } | 
A workaround is using platform: "android" instead of platform: "Android" in your CodeceptJS config