How to use the appium-base-driver.routeConfiguringFunction 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-ios-driver / test / e2e / setup-base.js View on Github external
async function startServer (session) {
  // start the server before start the session, so startup can use it if necessary
  server = await baseServer({
    routeConfiguringFunction: routeConfiguringFunction(session.rawDriver),
    port: env.APPIUM_PORT,
    hostname: 'localhost',
  });
  log.info(`IosDriver server listening on http://localhost:${env.APPIUM_PORT}`);
}
github appium / appium-xcuitest-driver / lib / server.js View on Github external
async function startServer (port, address) {
  const driver = new XCUITestDriver({port, address});
  const server = await baseServer({
    routeConfiguringFunction: routeConfiguringFunction(driver),
    port,
    hostname: address,
    allowCors: false,
  });
  // make the driver available
  server.driver = driver;
  log.info(`XCUITestDriver server listening on http://${address}:${port}`);
  return server;
}
github appium / appium / lib / main.js View on Github external
// that package might not appreciate us calling 'process.exit' willy-
    // nilly, so give it the option to have us throw instead of exit
    if (args.throwInsteadOfExit) {
      throwInsteadOfExit = true;
      // but remove it since it's not a real server arg per se
      delete args.throwInsteadOfExit;
    }
  } else {
    // otherwise parse from CLI
    args = parser.parseArgs();
  }
  await logsinkInit(args);
  await preflightChecks(parser, args, throwInsteadOfExit);
  await logStartupInfo(parser, args);
  let appiumDriver = new AppiumDriver(args);
  let routeConfiguringFunction = makeRouter(appiumDriver);
  let server = await baseServer({
    routeConfiguringFunction,
    port: args.port,
    hostname: args.address,
    allowCors: args.allowCors,
    basePath: args.basePath,
  });
  if (args.allowCors) {
    logger.warn('You have enabled CORS requests from any host. Be careful not ' +
                'to visit sites which could maliciously try to start Appium ' +
                'sessions on your machine');
  }
  appiumDriver.server = server;
  try {
    // TODO prelaunch if args.launch is set
    // TODO: startAlertSocket(server, appiumServer);
github appium / appium-android-driver / lib / server.js View on Github external
async function startServer (port, host) {
  let d = new AndroidDriver();
  let routeConfiguringFunction = makeRouter(d);
  let server = await baseServer({routeConfiguringFunction, port, hostname: host});
  log.info(`AndroidDriver server listening on http://${host}:${port}`);
  d.server = server;
  return server;
}
github appium / appium-uiautomator2-driver / lib / server.js View on Github external
async function startServer (port = 4884, host = 'localhost') {
  let d = new AndroidUiautomator2Driver({port, host});
  let routeConfiguringFunction = makeRouter(d);
  let server = baseServer({routeConfiguringFunction, port, hostname: host});
  log.info(`Android Uiautomator2 server listening on http://${host}:${port}`);
  d.server = server;
  return await server;
}
github appium / appium-ios-driver / lib / server.js View on Github external
async function startServer (port, host) {
  let driver = new IosDriver();
  let routeConfiguringFunction = makeRouter(driver);
  let server = await baseServer({routeConfiguringFunction, port, hostname: host});
  log.info(`IosDriver server listening on http://${host}:${port}`);
  return server;
}
github Samsung / appium-tizen-driver / lib / server.js View on Github external
async function startServer (port, host) {
  let d = new TizenDriver();
  let router = routeConfiguringFunction(d);
  let server = await baseServer(router, port, host);
  log.info(`TizenDriver server listening on http://${host}:${port}`);
  return server;
}
github christian-bromann / appium-hbbtv-driver / lib / server.js View on Github external
async function startServer (port, host) {
    const driver = new HbbTVDriver()
    const router = routeConfiguringFunction(driver)
    const server = baseServer((app) => {
        /**
         * register driver specific endpoints to backend server
         */
        DriverViews.create(app, driver)

        return router(app)
    }, port, host)

    log.info(`HbbTVDriver server listening on http://${host}:${port}`)
    return server
}
github appium / appium-mac-driver / lib / server.js View on Github external
async function startServer (port, address) {
  const driver = new MacDriver({port, address});
  const server = await baseServer({
    routeConfiguringFunction: routeConfiguringFunction(driver),
    port,
    hostname: address,
  });
  log.info(`MacDriver server listening on http://${address}:${port}`);
  return server;
}