How to use the appium-base-driver.errors.NotImplementedError function in appium-base-driver

To help you get started, we’ve selected a few appium-base-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-xcuitest-driver / lib / commands / context.js View on Github external
commands.getWindowHandle = async function getWindowHandle () { // eslint-disable-line require-await
  if (!this.isWebContext()) {
    throw new errors.NotImplementedError();
  }
  log.debug(`Getting current window handle`);
  return this.curContext;
};
github appium / appium-ios-driver / lib / commands / web.js View on Github external
commands.setCookie = async function setCookie (cookie) {
  if (!this.isWebContext()) {
    throw new errors.NotImplementedError();
  }

  cookie = _.clone(cookie);

  // if `path` field is not specified, Safari will not update cookies as expected; eg issue #1708
  if (!cookie.path) {
    cookie.path = '/';
  }

  const jsCookie = cookieUtils.createJSCookie(cookie.name, cookie.value, {
    expires: _.isNumber(cookie.expiry) ? (new Date(cookie.expiry * 1000)).toUTCString() :
      cookie.expiry,
    path: cookie.path,
    domain: cookie.domain,
    httpOnly: cookie.httpOnly,
    secure: cookie.secure
github appium / appium-ios-driver / lib / commands / web.js View on Github external
commands.deleteCookie = async function deleteCookie (cookieName) {
  if (!this.isWebContext()) {
    throw new errors.NotImplementedError();
  }

  // check cookie existence
  let cookies = await this.getCookies();
  if (_.indexOf(_.map(cookies, 'name'), cookieName) === -1) {
    logger.debug(`Cookie '${cookieName}' not found. Ignoring.`);
    return true;
  }

  return await this._deleteCookie(cookieName);
};
github appium / appium-xcuitest-driver / lib / commands / execute.js View on Github external
extensions.execute = async function execute (script, args) {
  if (!script.match(/^mobile:/) && !this.isWebContext()) {
    throw new errors.NotImplementedError();
  }

  return await iosExecute.call(this, script, args);
};
github appium / appium-xcuitest-driver / lib / commands / cookies.js View on Github external
commands.deleteCookies = async function deleteCookies () {
  if (!this.isWebContext()) {
    throw new errors.NotImplementedError();
  }

  const cookies = await this.getCookies();
  for (const cookie of cookies) {
    await this._deleteCookie(cookie);
  }
  return true;
};
github appium / appium-xcuitest-driver / lib / commands / execute.js View on Github external
extensions.executeAsync = async function executeAsync (script, args) {
  if (!this.isWebContext()) {
    throw new errors.NotImplementedError();
  }

  args = this.convertElementsForAtoms(args);
  this.asyncWaitMs = this.asyncWaitMs || 0;
  const promise = this.remote.executeAtomAsync('execute_async_script', [script, args, this.asyncWaitMs], this.curWebFrames);
  return await this.waitForAtom(promise);
};
github appium / appium-ios-driver / lib / commands / web.js View on Github external
commands.deleteCookies = async function deleteCookies () {
  if (!this.isWebContext()) {
    throw new errors.NotImplementedError();
  }

  let cookies = await this.getCookies();
  if (cookies.length) {
    for (let cookie of cookies) {
      await this._deleteCookie(cookie.name);
    }
  }
  return true;
};
github appium / appium-ios-driver / lib / commands / navigation.js View on Github external
commands.closeWindow = async function closeWindow () {
  if (this.isWebContext()) {
    let script = "return window.open('','_self').close();";
    return await this.executeAtom('execute_script', [script, []], true);
  } else {
    throw new errors.NotImplementedError();
  }
};
github appium / appium-ios-driver / lib / commands / web.js View on Github external
commands.submit = async function submit (el) {
  if (this.isWebContext()) {
    let atomsElement = this.useAtomsElement(el);
    await this.executeAtom('submit', [atomsElement]);
  } else {
    throw new errors.NotImplementedError();
  }
};
github appium / appium-android-driver / lib / commands / execute.js View on Github external
extensions.execute = async function execute (script, args) {
  if (script.match(/^mobile:/)) {
    logger.info(`Executing native command '${script}'`);
    script = script.replace(/^mobile:/, '').trim();
    return await this.executeMobile(script, _.isArray(args) ? args[0] : args);
  }
  if (!this.isWebContext()) {
    throw new errors.NotImplementedError();
  }
  const endpoint = this.chromedriver.jwproxy.downstreamProtocol === PROTOCOLS.MJSONWP
    ? '/execute'
    : '/execute/sync';
  return await this.chromedriver.jwproxy.command(endpoint, 'POST', {
    script,
    args,
  });
};