How to use appium-fake-driver - 2 common examples

To help you get started, we’ve selected a few appium-fake-driver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium / test / driver-e2e-specs.js View on Github external
it('should fall back to MJSONWP if Inner Driver is not ready for W3C', async function () {
      const combinedCaps = {
        desiredCapabilities: {
          ...caps,
        },
        capabilities: {
          alwaysMatch: {
            ...caps,
            deviceName: null,
          },
        },
      };
      const createSessionStub = sinon.stub(FakeDriver.prototype, 'createSession').callsFake(async function (jsonwpCaps) {
        const res = await BaseDriver.prototype.createSession.call(this, jsonwpCaps);
        this.protocol.should.equal('MJSONWP');
        return res;
      });

      const {value, sessionId, status} = await request.post({url: baseUrl, json: combinedCaps});
      status.should.exist;
      sessionId.should.exist;
      value.should.deep.equal(caps);

      createSessionStub.restore();

      // End session
      await request.delete({ url: `${baseUrl}/${sessionId}` });
    });
github appium / appium / test / driver-specs.js View on Github external
function getDriverAndFakeDriver () {
      const appium = new AppiumDriver({});
      const fakeDriver = new FakeDriver();
      const mockFakeDriver = sinon.mock(fakeDriver);
      appium.getDriverAndVersionForCaps = function (/*args*/) {
        return {
          driver: function Driver () {
            return fakeDriver;
          },
          version: '1.2.3',
        };
      };
      return [appium, mockFakeDriver];
    }
    describe('createSession', function () {

appium-fake-driver

Description goes here.

Apache-2.0
Latest version published 3 years ago

Package Health Score

47 / 100
Full package analysis