test(base-driver): use
MODIFY
packages/base-driver/test/e2e/basedriver/driver.e2e.spec.js
packages/base-driver/test/e2e/basedriver/driver.e2e.spec.js
@@ -4,7 +4,7 @@ import {
getTestPort,
TEST_HOST,
createSessionHelpers,
-} from '@appium/test-support';
+} from '@appium/driver-test-support';
const {expect} = chai;
@@ -68,5 +68,5 @@ describe('BaseDriver', function () {
});
/**
- * @typedef {import('@appium/test-support').SessionHelpers} SessionHelpers
+ * @typedef {import('@appium/driver-test-support').SessionHelpers} SessionHelpers
*/

MODIFY
packages/base-driver/test/e2e/basedriver/helpers.e2e.spec.js
packages/base-driver/test/e2e/basedriver/helpers.e2e.spec.js
@@ -7,7 +7,7 @@ import finalhandler from 'finalhandler';
import serveStatic from 'serve-static';
import contentDisposition from 'content-disposition';
import B from 'bluebird';
-import {TEST_HOST, getTestPort} from '@appium/test-support';
+import {TEST_HOST, getTestPort} from '@appium/driver-test-support';
function getFixture(file) {
// XXX: __dirname disallowed in native ESM

MODIFY
packages/base-driver/test/e2e/basedriver/websockets.e2e.spec.js
packages/base-driver/test/e2e/basedriver/websockets.e2e.spec.js
@@ -3,7 +3,7 @@ import {server, routeConfiguringFunction, DEFAULT_WS_PATHNAME_PREFIX} from '../.
import {FakeDriver} from '../protocol/fake-driver';
import WebSocket from 'ws';
import B from 'bluebird';
-import {TEST_HOST, getTestPort} from '@appium/test-support';
+import {TEST_HOST, getTestPort} from '@appium/driver-test-support';
describe('Websockets (e2e)', function () {
let baseServer;

MODIFY
packages/base-driver/test/e2e/express/server.e2e.spec.js
packages/base-driver/test/e2e/express/server.e2e.spec.js
-// transpile:mocha
-
import {server} from '../../../lib';
import axios from 'axios';
import {createSandbox} from 'sinon';
import B from 'bluebird';
import _ from 'lodash';
-import {TEST_HOST, getTestPort} from '@appium/test-support';
+import {TEST_HOST, getTestPort} from '@appium/driver-test-support';
describe('server', function () {
let hwServer;

MODIFY
packages/base-driver/test/e2e/protocol/protocol.e2e.spec.js
packages/base-driver/test/e2e/protocol/protocol.e2e.spec.js
-// transpile:mocha
-
import {server, routeConfiguringFunction, errors, JWProxy, BaseDriver} from '../../../lib';
import {FakeDriver} from './fake-driver';
import axios from 'axios';
@@ -7,7 +5,7 @@ import {createSandbox} from 'sinon';
import {StatusCodes as HTTPStatusCodes} from 'http-status-codes';
import {createProxyServer} from './helpers';
import {MJSONWP_ELEMENT_KEY, W3C_ELEMENT_KEY} from '../../../lib/constants';
-import {TEST_HOST, getTestPort} from '@appium/test-support';
+import {TEST_HOST, getTestPort} from '@appium/driver-test-support';
let port;
let baseUrl;

MODIFY
packages/base-driver/test/unit/basedriver/device-settings.spec.js
packages/base-driver/test/unit/basedriver/device-settings.spec.js
@@ -22,6 +22,14 @@ describe('DeviceSettings', function () {
expect(() => new DeviceSettings()).not.to.throw();
});
});
+
+ it('should not hold on to reference of defaults in constructor', function () {
+ let obj = {foo: 'bar'};
+ let d1 = new DeviceSettings(obj);
+ let d2 = new DeviceSettings(obj);
+ d1.getSettings().foo = 'baz';
+ expect(d1.getSettings()).to.not.eql(d2.getSettings());
+ });
});
describe('instance method', function () {

MODIFY
packages/base-driver/test/unit/basedriver/driver.spec.js
packages/base-driver/test/unit/basedriver/driver.spec.js
import BaseDriver from '../../../lib';
-import {driverUnitTestSuite} from '@appium/test-support';
+import {driverUnitTestSuite} from '@appium/driver-test-support';
driverUnitTestSuite(BaseDriver, {
platformName: 'iOS',

MODIFY
packages/base-driver/test/unit/express/server.spec.js
packages/base-driver/test/unit/express/server.spec.js
import {server, routeConfiguringFunction} from '../../../lib';
import {configureServer, normalizeBasePath} from '../../../lib/express/server';
import {createSandbox} from 'sinon';
-import {getTestPort} from '@appium/test-support';
+import {getTestPort} from '@appium/driver-test-support';
const newMethodMap = {
'/session/:sessionId/fake': {

MODIFY
packages/base-driver/test/unit/jsonwp-proxy/proxy.spec.js
packages/base-driver/test/unit/jsonwp-proxy/proxy.spec.js
-// transpile:mocha
-
import {JWProxy} from '../../../lib';
import request from './mock-request';
import {isErrorType, errors} from '../../../lib/protocol/errors';
-import {getTestPort, TEST_HOST} from '@appium/test-support';
+import {getTestPort, TEST_HOST} from '@appium/driver-test-support';
function buildReqRes(url, method, body) {
let req = {originalUrl: url, method, body};

MODIFY
packages/base-driver/test/unit/jsonwp-proxy/url.spec.js
packages/base-driver/test/unit/jsonwp-proxy/url.spec.js
import {JWProxy} from '../../../lib';
-import {getTestPort, TEST_HOST, createAppiumURL} from '@appium/test-support';
+import {getTestPort, TEST_HOST, createAppiumURL} from '@appium/driver-test-support';
import _ from 'lodash';
describe('JWProxy', function () {

MODIFY
packages/base-driver/tsconfig.json
packages/base-driver/tsconfig.json
"paths": {
"@appium/base-driver": ["."],
"@appium/support": ["../support"],
- "@appium/types": ["../types"]
+ "@appium/types": ["../types"],
+ "@appium/driver-test-support": ["../driver-test-support"]
},
"checkJs": true
},
"include": ["lib"],
- "references": [{"path": "../support"}, {"path": "../types"}]
+ "references": [
+ {"path": "../support"},
+ {"path": "../types"}
+ ]
}

test(base-driver): use @appium/driver-test-support