chore: Import uuid from appium-suuport
MODIFY
lib/basedriver/commands/session.js
lib/basedriver/commands/session.js
import _ from 'lodash';
import log from '../logger';
import { errors } from '../../protocol';
-import UUID from 'uuid-js';
+import { util } from 'appium-support';
import { processCapabilities } from '../capabilities';
let commands = {};
@@ -45,7 +45,7 @@ commands.createSession = async function createSession (jsonwpDesiredCapabilities
caps = fixCaps(caps, this.desiredCapConstraints);
this.validateDesiredCaps(caps);
- this.sessionId = UUID.create().hex;
+ this.sessionId = util.uuidV4();
this.caps = caps;
this.opts = _.cloneDeep(this.initialOpts);

MODIFY
lib/basedriver/image-element.js
lib/basedriver/image-element.js
@@ -3,7 +3,7 @@ import { errors } from '../..';
import LRU from 'lru-cache';
import { IMAGE_ELEMENT_PREFIX } from '../protocol/protocol';
import log from './logger';
-import UUID from 'uuid-js';
+import { util } from 'appium-support';
const MAX_CACHE_SIZE = 1024 * 1024 * 40; // 40mb
const TAP_DURATION_MS = 125;
@@ -53,7 +53,7 @@ class ImageElement {
constructor (b64Template, rect, b64Result = null) {
this.template = b64Template;
this.rect = rect;
- this.id = `${IMAGE_ELEMENT_PREFIX}${UUID.create().hex}`;
+ this.id = `${IMAGE_ELEMENT_PREFIX}${util.uuidV4()}`;
this.b64MatchedImage = b64Result;
}

MODIFY
package.json
package.json
],
"dependencies": {
"@babel/runtime": "^7.0.0",
- "appium-support": "^2.39.0",
+ "appium-support": "^2.41.0",
"async-lock": "^1.0.0",
"asyncbox": "^2.3.1",
"bluebird": "^3.5.3",
"sanitize-filename": "^1.6.1",
"serve-favicon": "^2.4.5",
"source-map-support": "^0.5.5",
- "uuid-js": "^0.7.5",
"validate.js": "^0.13.0",
"webdriverio": "^5.10.9",
"ws": "^7.0.0"

MODIFY
test/protocol/fake-driver.js
test/protocol/fake-driver.js
/* eslint-disable require-await */
import { errors, BaseDriver, determineProtocol, PROTOCOLS } from '../..';
import _ from 'lodash';
-import UUID from 'uuid-js';
+import { util } from 'appium-support';
+
class FakeDriver extends BaseDriver {
@@ -25,7 +26,7 @@ class FakeDriver extends BaseDriver {
async createSession (desiredCapabilities, requiredCapabilities, capabilities) {
// Use a counter to make sure each session has a unique id
- this.sessionId = `fakeSession_${UUID.create().hex}`;
+ this.sessionId = `fakeSession_${util.uuidV4()}`;
if (capabilities) {
return [this.sessionId, capabilities];
} else {

chore: Import uuid from appium-suuport (#391)