No hardcoded automation names
MODIFY
lib/appium.js
lib/appium.js
@@ -65,19 +65,19 @@ class AppiumDriver extends BaseDriver {
// we don't necessarily have an `automationName` capability,
if (caps.automationName) {
- if (caps.automationName.toLowerCase() === 'selendroid') {
+ if (caps.automationName.toLowerCase() === this.validAutomations.SELENDROID.toLowerCase()) {
// but if we do and it is 'Selendroid', act on it
return SelendroidDriver;
- } else if (caps.automationName.toLowerCase() === 'uiautomator2') {
+ } else if (caps.automationName.toLowerCase() === this.validAutomations.UIAUTOMATOR2.toLowerCase()) {
// but if we do and it is 'Uiautomator2', act on it
return AndroidUiautomator2Driver;
- } else if (caps.automationName.toLowerCase() === 'xcuitest') {
+ } else if (caps.automationName.toLowerCase() === this.validAutomations.XCUITEST.toLowerCase()) {
// but if we do and it is 'XCUITest', act on it
return XCUITestDriver;
- } else if (caps.automationName.toLowerCase() === 'youiengine') {
+ } else if (caps.automationName.toLowerCase() === this.validAutomations.YOUIENGINE.toLowerCase()) {
// but if we do and it is 'YouiEngine', act on it
return YouiEngineDriver;
- } else if (caps.automationName.toLowerCase() === 'espresso') {
+ } else if (caps.automationName.toLowerCase() === this.validAutomations.ESPRESSO.toLowerCase()) {
log.warn('The Appium Espresso driver is currently in early beta and meant only for experimental usage. Its API is not yet complete or guaranteed to work. Please report bugs to the Appium team on GitHub.');
return EspressoDriver;
}

No hardcoded automation names (#10002)