![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@wdio/appium-service
Advanced tools
@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.
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();
})();
Appium is an open-source tool for automating mobile applications. It allows you to write tests for multiple platforms (iOS, Android) using the same API. Compared to @wdio/appium-service, Appium is the core server that @wdio/appium-service interacts with to manage mobile testing.
The wdio-selenium-standalone-service is a WebdriverIO service that helps you run a standalone Selenium server seamlessly when running your WebdriverIO tests. It is similar to @wdio/appium-service but is used for web browser automation instead of mobile app automation.
WebdriverIO is a popular testing framework for Node.js that allows you to write and run tests for web and mobile applications. While WebdriverIO provides the framework and API for writing tests, @wdio/appium-service specifically helps manage the Appium server for mobile testing.
Handling the Appium server is out of scope of the actual WebdriverIO project. This service helps you to run the Appium server seamlessly when running tests with the WDIO testrunner. It starts the Appium Server in in a child process.
The easiest way is to keep @wdio/appium-service
as a devDependency in your package.json
.
{
"devDependencies": {
"@wdio/appium-service": "^5.0.0"
}
}
You can simple do it by:
npm install @wdio/appium-service --save-dev
Instructions on how to install WebdriverIO
can be found here.
In order to use the service you need to add appium
to your service array:
// wdio.conf.js
export.config = {
// ...
services: ['appium'],
// ...
};
The following options can be added to the wdio.conf.js file.
Path where all logs from the Appium server should be stored.
Type: String
Default: {}
Example:
export.config = {
appium: {
logPath : "./",
}
}
The name of the command which should be started.
Type: String
Default: {}
Example:
export.config = {
appium: {
command: "myAppium",
}
}
Map of arguments for the Appium server, passed directly to appium
.
See the documentation for possible arguments.
The arguments should be supplied in lower camel case, so --pre-launch true
becomes preLaunch: true
.
Type: Object
Default: {}
Example:
export.config = {
appium: {
args: {
// ...
debugLogSpacing: true,
platformName: 'iOS',
// ...
}
}
},
For more information on WebdriverIO see the homepage.
FAQs
A WebdriverIO service to start & stop Appium Server
The npm package @wdio/appium-service receives a total of 101,577 weekly downloads. As such, @wdio/appium-service popularity was classified as popular.
We found that @wdio/appium-service demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.