Remove chromedriver dev dep
MODIFY
package.json
package.json
"es6-error": "^4.1.1",
"express": "^4.16.2",
"http-status-codes": "^1.3.0",
- "jimp": "^0.6.0",
"lodash": "^4.0.0",
"lru-cache": "^5.0.0",
"method-override": "^3.0.0",
"sanitize-filename": "^1.6.1",
"serve-favicon": "^2.4.5",
"source-map-support": "^0.5.5",
- "teen_process": "^1.11.0",
"uuid-js": "^0.7.5",
"validate.js": "^0.12.0",
"ws": "^6.0.0"
"appium-gulp-plugins": "^3.1.0",
"chai": "^4.1.2",
"chai-as-promised": "^7.1.1",
- "chromedriver": "^74.0.0",
"content-disposition": "^0.5.0",
"eslint-config-appium": "^4.0.1",
"finalhandler": "^1.1.1",
"gulp": "^4.0.0",
"mocha": "^6.0.0",
- "mock-fs": "^4.5.0",
"pre-commit": "^1.1.3",
"serve-static": "^1.13.1",
"sinon": "^7.2.3"

MODIFY
test/jsonwp-proxy/proxy-e2e-specs.js
test/jsonwp-proxy/proxy-e2e-specs.js
-// transpile:mocha
-/* global describe:true, it:true, before:true, after:true */
-
-import { JWProxy } from '../..';
-import cp from 'child_process';
import chai from 'chai';
-import { sleep } from 'asyncbox';
-import chromedriver from 'chromedriver';
import chaiAsPromised from 'chai-as-promised';
+import { JWProxy, server, routeConfiguringFunction } from '../..';
+import { FakeDriver } from '../protocol/fake-driver';
-
-let should = chai.should();
+const should = chai.should();
chai.use(chaiAsPromised);
describe('proxy', function () {
- let cdProc = null;
- let j = new JWProxy();
+ const jwproxy = new JWProxy();
+ let baseServer;
before(async function () {
- cdProc = cp.spawn(chromedriver.path, ['--url-base=/wd/hub', '--port=4444']);
- await sleep(1000);
+ baseServer = await server(routeConfiguringFunction(new FakeDriver()), 4444);
});
after(async function () {
- cdProc.kill();
- await sleep(500);
+ await baseServer.close();
});
it('should proxy status straight', async function () {
- let [res, resBody] = await j.proxy('/status', 'GET');
+ let [res, resBody] = await jwproxy.proxy('/status', 'GET');
resBody = JSON.parse(resBody);
res.statusCode.should.equal(200);
resBody.status.should.equal(0);
- resBody.value.should.have.property('build');
+ resBody.value.should.equal(`I'm fine`);
});
it('should proxy status as command', async function () {
- let res = await j.command('/status', 'GET');
- res.should.have.property('build');
+ const res = await jwproxy.command('/status', 'GET');
+ res.should.eql(`I'm fine`);
+ });
+ describe('new session', function () {
+ afterEach(async function () {
+ await jwproxy.command('', 'DELETE');
});
it('should start a new session', async function () {
- let caps = {browserName: 'chrome'};
- let res = await j.command('/session', 'POST', {desiredCapabilities: caps});
+ const caps = {browserName: 'fake'};
+ const res = await jwproxy.command('/session', 'POST', {desiredCapabilities: caps});
res.should.have.property('browserName');
- j.sessionId.should.have.length(32);
+ jwproxy.sessionId.should.have.length(48);
+ });
+ });
+ describe('delete session', function () {
+ beforeEach(async function () {
+ await jwproxy.command('/session', 'POST', {desiredCapabilities: {}});
});
it('should quit a session', async function () {
- let res = await j.command('', 'DELETE');
+ const res = await jwproxy.command('', 'DELETE');
should.not.exist(res);
});
});
+});

Remove chromedriver dev dep (#320)