mirror of
https://github.com/appium/appium.git
synced 2026-10-26 02:29:38 +08:00
* fix: Use correct property to figure out LRU cache size (#435) * 7.3.2 * chore: Bump axios from 0.20.0 to 0.21.0 (#436) Bumps [axios](https://github.com/axios/axios) from 0.20.0 to 0.21.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v0.20.0...v0.21.0) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: Never destroy sockets explicitly (#437) * 7.3.3 * make vendor prefix mondatory * accept only w3c spec * tweak tests * tweak protocol e2e test * update e2e for w3c base * tweak * fix todo * update wording, add todo Co-authored-by: Mykola Mokhnach <mokhnach@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
53 lines
1.7 KiB
JavaScript
53 lines
1.7 KiB
JavaScript
import chai from 'chai';
|
|
import chaiAsPromised from 'chai-as-promised';
|
|
import { JWProxy, server, routeConfiguringFunction } from '../..';
|
|
import { FakeDriver } from '../protocol/fake-driver';
|
|
|
|
const should = chai.should();
|
|
chai.use(chaiAsPromised);
|
|
|
|
describe('proxy', function () {
|
|
const jwproxy = new JWProxy();
|
|
let baseServer;
|
|
before(async function () {
|
|
baseServer = await server({
|
|
routeConfiguringFunction: routeConfiguringFunction(new FakeDriver()),
|
|
port: 4444,
|
|
});
|
|
});
|
|
after(async function () {
|
|
await baseServer.close();
|
|
});
|
|
|
|
it('should proxy status straight', async function () {
|
|
let [res, resBody] = await jwproxy.proxy('/status', 'GET');
|
|
res.statusCode.should.equal(200);
|
|
resBody.status.should.equal(0);
|
|
resBody.value.should.equal(`I'm fine`);
|
|
});
|
|
it('should proxy status as command', async function () {
|
|
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 () {
|
|
const caps = {browserName: 'fake'};
|
|
const res = await jwproxy.command('/session', 'POST', {capabilities: {alwaysMatch: caps}});
|
|
res.capabilities.alwaysMatch.should.have.property('browserName');
|
|
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 () {
|
|
const res = await jwproxy.command('', 'DELETE');
|
|
should.not.exist(res);
|
|
});
|
|
});
|
|
});
|