Remove list of valid automation names
DELETE
lib/basedriver/automation-names.js
-// Lists all the names of automations that Appium supports
-const automationNames = {
- APPIUM: 'Appium',
- SELENDROID: 'Selendroid',
- UIAUTOMATOR2: 'UiAutomator2',
- XCUITEST: 'XCUITest',
- YOUIENGINE: 'YouiEngine',
- ESPRESSO: 'Espresso',
- FAKE: 'Fake',
-};
-
-export { automationNames };
\ No newline at end of file

MODIFY
lib/basedriver/desired-caps.js
lib/basedriver/desired-caps.js
import log from './logger';
-import _ from 'lodash';
import validator from 'validate.js';
import B from 'bluebird';
-import { automationNames } from './automation-names';
let desiredCapabilityConstraints = {
@@ -28,7 +26,7 @@ let desiredCapabilityConstraints = {
isNumber: true
},
automationName: {
- inclusionCaseInsensitive: _.values(automationNames)
+ isString: true
},
autoLaunch: {
isBoolean: true

MODIFY
lib/basedriver/driver.js
lib/basedriver/driver.js
@@ -8,7 +8,6 @@ import { validateCaps } from './capabilities';
import B from 'bluebird';
import _ from 'lodash';
import { util } from 'appium-support';
-import { automationNames } from './automation-names';
const NEW_COMMAND_TIMEOUT_MS = 60 * 1000;
@@ -161,10 +160,6 @@ class BaseDriver extends Protocol {
return this._constraints;
}
- get validAutomations () {
- return automationNames;
- }
-
// method required by MJSONWP in order to determine whether it should
// respond with an invalid session response
sessionExists (sessionId) {

MODIFY
test/basedriver/capabilities-specs.js
test/basedriver/capabilities-specs.js
@@ -357,16 +357,6 @@ describe('caps', function () {
(() => processCapabilities(caps, constraints)).should.throw(/'deviceName' can't be blank/);
});
- it('should fail when a bad automation name is provided', function () {
- caps = {
- alwaysMatch: {
- ...matchingCaps,
- automationName: 'NotAValidAutomationName',
- },
- };
- (() => processCapabilities(caps, constraints)).should.throw(/'automationName' NotAValidAutomationName not part of/);
- });
-
it('should fail when bad parameters are passed in more than one firstMatch capability', function () {
caps = {
alwaysMatch: {},

Remove list of valid automation names (#229)