How to use the appium-fake-driver.FakeDriver.prototype function in appium-fake-driver

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}` });
    });

appium-fake-driver

Description goes here.

Apache-2.0
Latest version published 3 years ago

Package Health Score

47 / 100
Full package analysis