Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wdio/appium-service

Package Overview
Dependencies
Maintainers
3
Versions
371
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wdio/appium-service

A WebdriverIO service to start & stop Appium Server

  • 9.2.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created

What is @wdio/appium-service?

@wdio/appium-service is a WebdriverIO service that helps you run Appium seamlessly when running your WebdriverIO tests. It simplifies the process of starting and stopping the Appium server, making it easier to manage mobile testing environments.

What are @wdio/appium-service's main functionalities?

Starting Appium Server

This code sample demonstrates how to start an Appium server using WebdriverIO with the @wdio/appium-service. It sets up the desired capabilities for an Android device and starts a session.

const { remote } = require('webdriverio');

const opts = {
  path: '/wd/hub',
  port: 4723,
  capabilities: {
    platformName: 'Android',
    platformVersion: '9',
    deviceName: 'emulator-5554',
    app: '/path/to/the/app.apk',
    automationName: 'UiAutomator2'
  }
};

(async () => {
  const client = await remote(opts);
  await client.deleteSession();
})();

Stopping Appium Server

This code sample shows how to stop the Appium server after the test session ends. The @wdio/appium-service handles the stopping of the server automatically when the session is deleted.

const { remote } = require('webdriverio');

const opts = {
  path: '/wd/hub',
  port: 4723,
  capabilities: {
    platformName: 'Android',
    platformVersion: '9',
    deviceName: 'emulator-5554',
    app: '/path/to/the/app.apk',
    automationName: 'UiAutomator2'
  }
};

(async () => {
  const client = await remote(opts);
  await client.deleteSession();
  // Appium server will stop automatically after the session ends
})();

Custom Appium Server Arguments

This code sample demonstrates how to pass custom arguments to the Appium server using the @wdio/appium-service. It configures the server to run on a specific address and port, and to log output to a file.

const { remote } = require('webdriverio');

const opts = {
  path: '/wd/hub',
  port: 4723,
  capabilities: {
    platformName: 'Android',
    platformVersion: '9',
    deviceName: 'emulator-5554',
    app: '/path/to/the/app.apk',
    automationName: 'UiAutomator2'
  },
  services: [['appium', {
    args: {
      address: '127.0.0.1',
      port: 4723,
      log: './appium.log'
    }
  }]]
};

(async () => {
  const client = await remote(opts);
  await client.deleteSession();
})();

Other packages similar to @wdio/appium-service

Keywords

FAQs

Package last updated on 28 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc