docs: update READMEs (#19595)

* docs: update universal-xml-plugin readme

* chore: fix line lengths

* docs: update relaxed-caps-plugin readme

* docs: update images-plugin readme

* docs: update fake-plugin readme

* docs: add readme for execute-driver-plugin

* docs: update base-plugin readme

* docs: update test-support readme

* docs: update support readme

* docs: update opencv readme

* docs: update fake-driver readme

* docs: update docutils readme

* docs: update doctor readme

* docs: update base-driver readme

* docs: fix badge for base-driver

* docs: slightly improve base-driver/plugin readme

* docs: fix title for eslint-config-appium-ts

* docs: add badges for non-prerelease packages

* docs: update appium readme

* docs: update some readme links

* chore: address review comments
This commit is contained in:
Edgars Eglītis
2024-01-02 21:37:30 +02:00
committed by GitHub
parent bd88198a9a
commit 5070a34739
16 changed files with 441 additions and 385 deletions

289
README.md
View File

@@ -1,214 +1,185 @@
## Appium
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine/)
<p align="center">
<a href="https://appium.io/">
<img alt="Appium" src="https://raw.githubusercontent.com/appium/appium/master/packages/appium/docs/assets/images/appium-logo-horiz.png" width="500">
</a>
</p>
<p align="center">
Cross-platform test automation for native, hybrid, mobile web and desktop apps.
</p>
[![NPM version](https://badge.fury.io/js/appium.svg)](https://npmjs.org/package/appium)
[![Monthly Downloads](https://img.shields.io/npm/dm/appium.svg)](https://npmjs.org/package/appium)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium?ref=badge_shield)
[![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/)
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://vshymanskyy.github.io/StandWithUkraine/)
***
Appium is an open-source, cross-platform test automation tool for native,
hybrid, mobile web and desktop apps. Initially created to automate iOS and Android mobile
applications Appium has grown to a full-featured platform that provides [WebDriver](https://www.w3.org/TR/webdriver/)-based automation possibilities for the whole set of different mobile and desktop platforms.
See the full list of
[officially-supported](https://appium.io/docs/en/latest/ecosystem/#drivers) and
[third-party](https://appium.io/docs/en/latest/ecosystem/#other-drivers) drivers for more details.
<p align="center"><b>
<a href="https://appium.io">Documentation</a> |
<a href="https://appium.io/docs/en/latest/intro/">Get Started</a> |
<a href="https://appium.io/docs/en/latest/ecosystem/">Ecosystem</a> |
<a href="https://github.com/appium/appium/blob/master/packages/appium/CHANGELOG.md">Changelog</a> |
<a href="https://github.com/appium/appium/blob/master/ROADMAP.md">Roadmap</a> |
<a href="https://discuss.appium.io">Discussion Forum</a>
</b></p>
:bangbang: Appium core team does not maintain Appium 1.x anymore since the 1st of January 2022. All recent versions of officially supported platform drivers are not compatible to Appium 1.x, and require Appium 2 to run. [Please read the migration guide from 1.x to 2.0](https://appium.io/docs/en/latest/guides/migrating-1-to-2/) to manage the Appium server.
***
:bangbang: If you still use the deprecated Appium Desktop containing the built-in server then you won't be able to upgrade to Appium 2. Consider switching to [Appium Inspector](https://github.com/appium/appium-inspector) instead.
Appium is an open-source automation framework that provides
[WebDriver](https://www.w3.org/TR/webdriver/)-based automation possibilities for a wide range of
different mobile, desktop and IoT platforms. Appium is modular and extensible, and supports multiple
programming languages, which means there is an entire ecosystem of related software:
* [__Drivers__](#drivers) add support for automating specific platforms
* [__Clients__](#clients) allow writing Appium tests in your programming language of choice
* [__Plugins__](#plugins) allow to further extend Appium functionality
### Documentation
## Migrating From Appium 1 to Appium 2
The current Appium documentation is available at [__https://appium.io__](https://appium.io).
As of January 1st, 2022, the Appium team no longer maintains or supports Appium 1. All officially
supported platform drivers are only compatible with Appium 2.
### Requirements
__[Please read the Migration Guide](https://appium.io/docs/en/latest/guides/migrating-1-to-2/) if you
are still using Appium 1.__
- macOS, Linux or Windows operating system
- Node.js 16+. Any relevant [LTS release](https://nodejs.dev/en/about/releases/) should work just fine.
- NPM (Node Package Manager) 8+
> [!WARNING]
> If you use Appium Desktop or Appium Server GUI, you will not be able to upgrade to Appium 2, as
both of these tools have been deprecated. Please use [Appium Inspector](https://github.com/appium/appium-inspector)
in combination with a standalone Appium 2 server.
These are only server requirements. Each driver might have its own requirements. Consider checking the corresponding driver tutorial for more details.
## Installation
### Server
Appium can be installed using `npm` (other package managers are not currently supported). Please
check the [installation docs](http://appium.io/docs/en/latest/quickstart/install/) for the
system requirements and further information.
To install Appium 2 server using Node Package Manager (npm) run the following command:
If upgrading from Appium 1, make sure Appium 1 is fully uninstalled (`npm uninstall -g appium`).
Unexpected errors might appear if this has not been done.
```bash
npm i -g appium
```
To update Appium 2 server using Node Package Manager (npm) run the following command:
Note that this will only install the core Appium server, which cannot automate anything on its own.
Please install [drivers](#drivers) for your target platforms in order to automate them.
```bash
npm i -g appium@latest
```
## Drivers
:bangbang: Make sure Appium 1 is fully uninstalled before upgrading it to Appium 2 (`npm uninstall -g appium`). Unexpected errors might appear if this has not been done.
Appium supports app automation across a variety of platforms, like iOS, Android, macOS, Windows,
and more. Each platform is supported by one or more "drivers", which know how to automate that
particular platform. You can find a full list of officially-supported and third-party drivers in
[Appium Ecosystem's Drivers page](http://appium.io/docs/en/latest/ecosystem/drivers/).
### Drivers
Appium supports app automation across a variety of platforms, like iOS,
Android, and Windows. Each platform is supported by one or more "drivers",
which know how to automate that particular platform. Since version 2.0
all drivers have been isolated from the Appium server app and can
be managed independently using the [appium driver](https://appiumpro.com/editions/122-installing-appium-20-and-the-driver-and-plugins-cli) command line interface.
In general, the drivers management in Appium 2 is as simple as:
Driver management is done using [Appium's Extension command-line interface](http://appium.io/docs/en/latest/cli/extensions/):
```bash
# To install a new driver from npm
appium driver install --source=npm appium-xcuitest-driver[@<version>]
# To install a driver from a local folder (useful for developers)
appium driver install --source=local /Users/me/sources/appium-xcuitest-driver
# To install a new driver from github (hm, maybe it's time to publish it to NPM?)
appium driver install --source=github --package=appium-xcuitest-driver appium/appium-xcuitest-driver
# Install an official driver from npm (see documentation for a list of such drivers)
appium driver install <driver-name>
# Install any driver from npm
appium driver install --source=npm <driver-name>
# See documentation for installation from other sources
# To list already installed drivers
# List already installed drivers
appium driver list --installed
# To update a driver (it must be already installed)
appium driver update xcuitest
# To uninstall a driver (it won't last forever, wouldn't it?)
appium driver uninstall xcuitest
# Update a driver (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium driver update <driver-name>
# Update a driver to the most recent version (may include breaking changes)
appium driver update <driver-name> --unsafe
# Uninstall a driver (it won't last forever, will it?)
appium driver uninstall <driver-name>
```
You can find a full list of
[officially-supported](https://appium.io/docs/en/latest/ecosystem/#drivers) and
[third-party](https://appium.io/docs/en/latest/ecosystem/#other-drivers) drivers at
the current Appium 2.0 documentation.
## Clients
### Plugins
Client libraries enable writing Appium tests in different programming languages. There are
officially-supported clients for Java, Python, Ruby, and .NET C#, as well as third-party clients
for other languages. You can find a full list of clients in
[Appium Ecosystem's Clients page](http://appium.io/docs/en/latest/ecosystem/clients/).
The concept of plugins is something new that has been added exclusively to Appium2. Plugins allow you to extend server functionality without changing the server code. Plugins could be managed similarly to drivers:
## Plugins
Plugins allow you to extend server functionality without changing the server code. The main
difference between drivers and plugins is that the latter must be explicitly enabled on
Appium server startup (all installed drivers are enabled by default):
```bash
# To install an officially supported plugin
appium plugin install images
# To install a plugin from a local folder (useful for developers)
appium plugin install --source=local /Users/me/sources/images
# To install a new plugin from npm
appium plugin install --source=npm appium-device-farm
appium --use-plugins=<plugin-name>
```
# To list already installed plugins
You can find a full list of officially-supported and third-party plugins in
[Appium Ecosystem's Plugins page](http://appium.io/docs/en/latest/ecosystem/plugins/).
Similarly to drivers, plugin management is also done using
[Appium's Extension command-line interface](http://appium.io/docs/en/latest/cli/extensions/):
```bash
# Install an official plugin from npm (see documentation for a list of such plugins)
appium plugin install <plugin-name>
# Install any plugin from npm
appium plugin install --source=npm <plugin-name>
# See documentation for installation from other sources
# List already installed plugins
appium plugin list --installed
# To update a plugins (it must be already installed)
appium plugin update appium-device-farm
# To uninstall a plugin
appium plugin uninstall appium-device-farm
# Update a plugin (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium plugin update <plugin-name>
# Update a plugin to the most recent version (may include breaking changes)
appium plugin update <plugin-name> --unsafe
# Uninstall a plugin
appium plugin uninstall <plugin-name>
```
The main difference between drivers and plugins is that the latter must be explicitly enabled on server startup after it was installed (drivers are enabled by default after installation):
## Server Command Line Interface
In order to start sending commands to the Appium server, it must be running on the URL and port
where your client library expects it to listen. [Appium's command-line interface](http://appium.io/docs/en/latest/cli/args/)
is used to launch and configure the server:
```bash
appium server --use-plugins=device-farm,images
```
You can find a full list of
[officially-supported](https://appium.io/docs/en/latest/ecosystem/#plugins) and
[third-party](https://appium.io/docs/en/latest/ecosystem/#other-plugins) plugins at
the current Appium 2.0 documentation.
### Server Command Line Interface
In order to start sending commands to Appium over the wire it must be listening
on the URL where your client library expects it to listen.
Use the following commands to run and configure Appium server:
```bash
# Start the server on the default port and host (e.g. http://0.0.0.0:4723/)
# Start the server on the default host (0.0.0.0) and port (4723)
appium server
# Start the server on the given port, host and use the base path prefix (the default prefix is /)
appium server -p 9000 -a 127.0.0.1 -pa /wd/hub
# Get the list of all supported command line parameters.
# This list would also include descriptions of driver-specific
# command line arguments for all installed drivers.
# Each driver and plugin must have their command line arguments
# exposed in a special JSON schema declared as a part of the corresponding
# package.json file.
appium server --help
# You can also omit the 'server' subcommand
appium
# Start the server on the given host, port and use a custom base path prefix (the default prefix is '/')
appium --address 127.0.0.1 --port 9000 --base-path /wd/hub
```
Appium supports execution of parallel server processes as well as parallel driver sessions within
Appium supports execution of parallel server processes, as well as parallel driver sessions within a
single server process. Refer the corresponding driver documentations regarding which mode is optimal
for the particular driver or whether it supports parallel sessions.
### Why Appium?
## Why Appium?
1. You usually don't have to recompile your app or modify it in any way, due
to the use of standard automation APIs on all platforms.
2. You can write tests with your favorite dev tools using any
[WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html)-compatible
language such as [Java](https://github.com/appium/java-client),
[JavaScript](https://webdriver.io/), [Python](https://github.com/appium/python-client),
[Ruby](https://github.com/appium/ruby_lib), [C#](https://github.com/appium/dotnet-client)
with the Selenium WebDriver API. There are also various third party
client implementations for other languages.
1. You usually don't have to recompile your app or modify it in any way, due to the use of standard
automation APIs on all platforms.
2. You can write tests with your favorite dev tools using any WebDriver-compatible language such as
Java, Python, Ruby and C#. There are also third party client implementations for other languages.
3. You can use any testing framework.
4. Some drivers, like xcuitest and uiautomator2 ones have built-in mobile web and
hybrid app support. Within the same script, you can switch seamlessly between native
app automation and webview automation, all using the WebDriver model that's already
the standard for web automation.
5. You can run your automated tests locally and in a cloud. There are multiple
cloud providers that support various Appium drivers (mostly
targeting iOS and Android mobile automation).
6. [Appium Inspector](https://github.com/appium/appium-inspector) allows
visual debugging of automated tests and could be extremely useful for
beginners.
4. Some drivers like `xcuitest` and `uiautomator2` have built-in mobile web and hybrid app support.
Within the same script, you can switch seamlessly between native app automation and webview
automation, all using the WebDriver model that's already the standard for web automation.
5. You can run your automated tests locally and in a cloud. There are multiple cloud providers that
support various Appium drivers (mostly targeting iOS and Android mobile automation).
6. [Appium Inspector](https://github.com/appium/appium-inspector) can be used to visually inspect
the page source of applications across different platforms, facilitating easier test development.
Investing in the
[WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html) protocol means
you are betting on a single, free, and open protocol for testing that has become
a web standard. Don't lock yourself into a proprietary stack.
Investing in the [WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html) protocol means you
are betting on a single, free, and open protocol for testing that has become a web standard. Don't
lock yourself into a proprietary stack.
For example, if you use Apple's XCUITest library without Appium you can only
write tests using Obj-C/Swift, and you can only run tests through Xcode.
Similarly, with Google's UiAutomator or Espresso, you can only write tests in
Java/Kotlin. Appium opens up the possibility of true cross-platform native app
automation, for mobile and beyond. Finally!
For example, if you use Apple's XCUITest library without Appium, you can only write tests using
Obj-C/Swift, and you can only run tests through Xcode. Similarly, with Google's UiAutomator or
Espresso, you can only write tests in Java/Kotlin. Appium opens up the possibility of true
cross-platform native app automation, for mobile and beyond!
If you're new to Appium or want a more comprehensive description of what this is all
about, please read our [Intro to Appium](https://appium.io/docs/en/latest/intro/).
If you are looking for a more comprehensive description of what this is all about, please read our
documentation on [How Does Appium Work?](https://appium.io/docs/en/latest/intro/appium/).
### Quickstart
## License
Check out our [Quickstart](https://appium.io/docs/en/latest/quickstart/) guide
to get going with Appium.
There is also a sample code that contains [many examples of tests in a variety
of different languages](https://github.com/appium/appium/tree/1.x/sample-code)!
### Documentation
For prettily-rendered docs, please visit [Appium Documentation](https://appium.io).
You can always find the full list of Appium doc pages at [Appium's GitHub
Repo](https://github.com/appium/appium/tree/master/packages/appium/docs) as well.
### Contributing
Please take a look at our [contribution documentation](CONTRIBUTING.md)
for instructions on how to build, test, and run Appium from the source.
### Project History, Credits & Inspiration
* [History](https://appium.io/docs/en/latest/intro/history/)
### User Forums
Announcements and debates often take place on the [Discussion Group](https://discuss.appium.io),
be sure to sign up!
### Troubleshooting
Please find the troubleshooting guide at the corresponding driver repository/documentation.
### License
[Apache-2.0](./LICENSE)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium?ref=badge_large)

View File

@@ -1,16 +1,23 @@
appium-base-driver
===================
[![NPM version](http://img.shields.io/npm/v/appium-base-driver.svg)](https://npmjs.org/package/@appium/base-driver)
# @appium/base-driver
> Base class for creating other Appium drivers
[![NPM version](http://img.shields.io/npm/v/@appium/base-driver.svg)](https://npmjs.org/package/@appium/base-driver)
[![Downloads](http://img.shields.io/npm/dm/@appium/base-driver.svg)](https://npmjs.org/package/@appium/base-driver)
[![Dependency Status](https://david-dm.org/appium/@appium/base-driver.svg)](https://david-dm.org/appium/@appium/base-driver)
[![devDependency Status](https://david-dm.org/appium/@appium/base-driver/dev-status.svg)](https://david-dm.org/appium/@appium/base-driver#info=devDependencies)
[![Build Status](https://travis-ci.org/appium/@appium/base-driver.svg?branch=master)](https://travis-ci.org/appium/@appium/base-driver)
This is the parent class that all Appium drivers inherit from. This driver should not be installed
directly as it does nothing on its own. Instead, you should extend this driver when creating your
*own* Appium drivers. Check out the [Building Drivers](https://appium.io/docs/en/latest/developing/build-drivers/)
documentation for more details.
This is the parent class that all [appium](appium.io) drivers inherit from, along with a collection of globally-used Appium driver utilities. Each utility is documented in its own README in the code:
Each included utility is documented in its own README:
* [BaseDriver](lib/basedriver)
* [The Appium Express Server](lib/express)
* [The Mobile JSON Wire Protocol Encapsulation](lib/mjsonwp)
* [The JSONWP Proxy Library](lib/jsonwp-proxy)
* [The JSONWP Status Library](lib/jsonwp-status)
## License
Apache-2.0

View File

@@ -1,3 +1,15 @@
# Appium Base Plugin
# @appium/base-plugin
The base class used to create Appium plugins. This plugin should not be installed directly as it does nothing. Instead, you extend this plugin when creating your *own* Appium plugins. Check out the [Building Plugins](https://appium.io/docs/en/latest/ecosystem/build-plugins/) to learn how to make use of this base class to develop Appium plugins.
> Base class for creating other Appium plugins
[![NPM version](http://img.shields.io/npm/v/@appium/base-plugin.svg)](https://npmjs.org/package/@appium/base-plugin)
[![Downloads](http://img.shields.io/npm/dm/@appium/base-plugin.svg)](https://npmjs.org/package/@appium/base-plugin)
This is the parent class that all Appium plugins inherit from. This plugin should not be installed
directly as it does nothing on its own. Instead, you should extend this plugin when creating your
*own* Appium plugins. Check out the [Building Plugins](https://appium.io/docs/en/latest/developing/build-plugins/)
documentation for more details.
## License
Apache-2.0

View File

@@ -1,6 +1,9 @@
appium-doctor
===================
Attempts to diagnose and fix common Node, iOS and Android configuration issues before starting Appium.
# @appium/doctor
> Attempts to diagnose and fix common Appium configuration issues
[![NPM version](http://img.shields.io/npm/v/@appium/doctor.svg)](https://npmjs.org/package/@appium/doctor)
[![Downloads](http://img.shields.io/npm/dm/@appium/doctor.svg)](https://npmjs.org/package/@appium/doctor)
### Install
@@ -26,24 +29,6 @@ Options:
-h, --help Show help [boolean]
```
## Dev
## License
## Watch
```
npm run watch
```
## Test
```
npm test
```
## Hack Cli
Use the `--demo` option to simulate the fix process.
```
appium-doctor --demo
```
Apache-2.0

View File

@@ -2,21 +2,25 @@
> Documentation-building utilities for Appium
## Prerequisites
[![NPM version](http://img.shields.io/npm/v/@appium/docutils.svg)](https://npmjs.org/package/@appium/docutils)
[![Downloads](http://img.shields.io/npm/dm/@appium/docutils.svg)](https://npmjs.org/package/@appium/docutils)
- Node.js in the [semantic version range](https://semver.org) `^14.17.0 || ^16.13.0 || >=18.0.0`
- Python v3+ if building HTML documentation
## Setup for Main Appium Docs
## Running for Main Appium Docs
This package does not need to be run directly. Instead, execute this command in the `packages/appium` folder of [this monorepo](https://github.com/appium/appium):
This package does not need to be run directly. Instead, execute this command in the
`packages/appium` directory:
```bash
npm run dev:docs:en
````
```
See the `scripts` field of the `package.json` for other languages.
Note that this will only build the English docs. See the `scripts` field of the `package.json` for
other languages.
## Using in Appium Extensions
## Setup for Appium Drivers and Plugins
TODO: give an example of how this package is used in an extension outside the appium monorepo, for example when it's made a part of the XCUITest repo. Or link to the part of the Appium docs where this info will live.
See the Appium docs on [Building Documentation](http://appium.io/docs/en/latest/developing/build-docs/).
## License
Apache-2.0

View File

@@ -1,4 +1,4 @@
# @appium/eslint-config-appium
# @appium/eslint-config-appium-ts
> Provides a reusable [ESLint](http://eslint.org/) [shared configuration](http://eslint.org/docs/developer-guide/shareable-configs) for [Appium](https://github.com/appium/appium) and Appium-adjacent projects (for TypeScript)

View File

@@ -2,6 +2,9 @@
> Provides a reusable [ESLint](http://eslint.org/) [shared configuration](http://eslint.org/docs/developer-guide/shareable-configs) for [Appium](https://github.com/appium/appium) and Appium-adjacent projects.
[![NPM version](http://img.shields.io/npm/v/@appium/eslint-config-appium.svg)](https://npmjs.org/package/@appium/eslint-config-appium)
[![Downloads](http://img.shields.io/npm/dm/@appium/eslint-config-appium.svg)](https://npmjs.org/package/@appium/eslint-config-appium)
## Usage
Install the package with **`npm` v8 or newer**:

View File

@@ -0,0 +1,42 @@
# @appium/execute-driver-plugin
> Appium plugin for running a driver script in a child process
[![NPM version](http://img.shields.io/npm/v/@appium/execute-driver-plugin.svg)](https://npmjs.org/package/@appium/execute-driver-plugin)
[![Downloads](http://img.shields.io/npm/dm/@appium/execute-driver-plugin.svg)](https://npmjs.org/package/@appium/execute-driver-plugin)
This plugin adds a new driver command that allows executing scripts in a child process. Currently,
the only supported driver type is `webdriverio`, therefore the script must also be written in JS.
## Motivation
Running a driver script in a child process adds a degree of parallelisation, which may result in
faster test execution.
## Installation
```
appium plugin install execute-driver
```
The plugin must be explicitly activated when launching the Appium server. Since the input script
can be arbitrary JavaScript, this is an insecure feature, and must also be explicitly enabled:
```
appium --use-plugins=execute-driver --allow-insecure=execute_driver_script
```
## Usage
```js
const script = `return await driver.getTimeouts();`;
const {result, logs} = await driver.executeDriverScript(script);
// 'result' contains the data returned by the script (in this case, the response to 'getTimeouts')
// 'logs' contains everything logged to console during script execution
```
Refer to your Appium client documentation for the exact syntax of this command.
## License
Apache-2.0

View File

@@ -1,20 +1,7 @@
appium-fake-driver
===================
# @appium/fake-driver
[![Greenkeeper badge](https://badges.greenkeeper.io/appium/appium-fake-driver.svg)](https://greenkeeper.io/)
> Fake Appium driver for internal testing
Issues for this repo are disabled. Log any issues at the [main Appium repo's issue tracker](https://github.com/appium/appium/issues).
## License
Work in progress, stay tuned!
## Watch
```
npm run watch
```
## Test
```
npm test
```
Apache-2.0

View File

@@ -1,3 +1,7 @@
# Appium Fake Plugin
# @appium/fake-plugin
This is a "fake" Appium 2.0 plugin used for testing and examples. There's no point in documenting its functionality since it's not meant to be used. If you're here at all, it's probably because you want to peek at the source code to see how a plugin is designed. So go ahead and do that!
> Fake Appium plugin for internal testing
## License
Apache-2.0

View File

@@ -1,35 +1,27 @@
# Appium Images Plugin
# @appium/images-plugin
This is an official Appium plugin designed to facilitate image comparison, visual testing, and image-based functional testing.
> Appium plugin for image comparison, visual testing, and image-based functional testing
[![NPM version](http://img.shields.io/npm/v/@appium/images-plugin.svg)](https://npmjs.org/package/@appium/images-plugin)
[![Downloads](http://img.shields.io/npm/dm/@appium/images-plugin.svg)](https://npmjs.org/package/@appium/images-plugin)
## Features
1. **Image Comparison** ([docs](./docs/image-comparison.md)) - A new Appium command and route that allows sending in two different images and comparing them in various ways.
2. **Finding Elements by Image** ([docs](./docs/find-by-image.md)) - Using a template image, find a matching screen region of an app and interact with it via standard Appium element semantics.
## Prerequisites
* Appium Server 2.0+
## Installation - Server
Install the plugin using Appium's plugin CLI:
## Installation
```
appium plugin install images
```
## Installation - Client
No special action is needed to make the features available in the various Appium clients, as this plugin used to be a core Appium feature and its commands are already supported in the official clients.
## Activation
The plugin will not be active unless turned on when invoking the Appium server:
The plugin must be explicitly activated when launching the Appium server:
```
appium --use-plugins=images
```
## Usage
## License
Check the docs links above for usage for each of the features provided.
Apache-2.0

View File

@@ -1,7 +1,68 @@
# @appium/opencv
OpenCV-related helper methods
> OpenCV-related helper methods
[![NPM version](http://img.shields.io/npm/v/@appium/opencv.svg)](https://npmjs.org/package/@appium/opencv)
[![Downloads](http://img.shields.io/npm/dm/@appium/opencv.svg)](https://npmjs.org/package/@appium/opencv)
## Installation
`npm install @appium/opencv`
This package relies on opencv.js, which is WASMed into a ~7mb dependency and run "natively" in JS. It is therefore standalone without requiring C bindings.
## Usage
### initOpenCv
Loads the opencv bindings. You only need to explicitly call this if you want to use your own opencv
methods that are not included in this module.
```js
import {initOpenCv} from '@appium/opencv';
await initOpenCv();
```
### getImagesMatches
Calculates the count of common edges between two images. The images might be rotated or resized
relatively to each other. See the function definition for more details.
```js
import {getImagesMatches} from '@appium/opencv';
import {fs} from '@appium/support';
const image1 = await fs.readFile('image1.jpg')
const image2 = await fs.readFile('image2.jpg')
const {points1, rect1, points2, rect2, totalCount, count} = await getImagesMatches(image1, image2);
```
### getImagesSimilarity
Calculates the similarity score between two images. It is expected that both images have the same
resolution. See the function definition for more details.
```js
import {getImagesSimilarity} from '@appium/opencv';
import {fs} from '@appium/support';
const image1 = await fs.readFile('image1.jpg')
const image2 = await fs.readFile('image2.jpg')
const {score} = await getImagesSimilarity(image1, image2);
```
### getImageOccurrence
Calculates the occurrence position of a partial image in the full image. See the function definition
for more details.
```js
import {getImageOccurrence} from '@appium/opencv';
import {fs} from '@appium/support';
const fullImage = await fs.readFile('image1.jpg')
const partialImage = await fs.readFile('image2.jpg')
const {rect, score} = await getImageOccurrence(fullImage, partialImage);
```
## License
Apache-2.0

View File

@@ -1,26 +1,35 @@
# Appium Relaxed Caps Plugin
# @appium/relaxed-caps-plugin
With the advent of Appium 2.0, the Appium server begins to require that all capabilities conform to the W3C [requirements for capabilities](https://www.w3.org/TR/webdriver/#capabilities). Among these requirements is one that restricts capabilities to those found in a predetermined set. Appium supports many additional capabilities as extension capabilities, and these must be accessed with the prefix `appium:` in front of the capability name.
> Appium plugin for handling extension capabilities with no prefix
There are a lot of test scripts out there that don't conform to the requirement, and so this plugin is designed to make it easy to keep running these scripts even with the new stricter capabilities requirements beginning with Appium 2.0. Basically, it inserts the `appium:` prefix for you!
[![NPM version](http://img.shields.io/npm/v/@appium/relaxed-caps-plugin.svg)](https://npmjs.org/package/@appium/relaxed-caps-plugin)
[![Downloads](http://img.shields.io/npm/dm/@appium/relaxed-caps-plugin.svg)](https://npmjs.org/package/@appium/relaxed-caps-plugin)
## Installation - Server
Appium conforms to the W3C WebDriver Protocol [requirements for capabilities](https://www.w3.org/TR/webdriver/#capabilities),
which means that all non-standard (extension) capabilities used with Appium must have a prefix
(usually this prefix is `appium:`). Any non-standard capabilities without a prefix are rejected.
Install the plugin using Appium's plugin CLI, either as a named plugin or via NPM:
This plugin can be used to automatically add the `appium:` prefix to non-standard capabilities that
do not have a prefix.
## Motivation
There are a lot of test scripts out there that don't conform to the W3C capability requirements,
so this plugin is designed to make it easy to keep running these scripts even with the stricter
capability requirements in Appium 2.
## Installation
```
appium plugin install relaxed-caps
appium plugin install --source=npm @appium/relaxed-caps-plugin
```
## Installation - Client
No special action is needed to make things work on the client side. Just keep sending in your unprefixed caps!
## Activation
The plugin will not be active unless turned on when invoking the Appium server:
The plugin must be explicitly activated when launching the Appium server:
```
appium --use-plugins=relaxed-caps
```
## License
Apache-2.0

View File

@@ -1,11 +1,15 @@
# appium-support
# @appium/support
Utility functions used to support Appium drivers and plugins.
> Utility functions used to support Appium drivers and plugins
# Usage in drivers and plugins
[![NPM version](http://img.shields.io/npm/v/@appium/support.svg)](https://npmjs.org/package/@appium/support)
[![Downloads](http://img.shields.io/npm/dm/@appium/support.svg)](https://npmjs.org/package/@appium/support)
It is recommended to have Appium as a peer dependency in driver and plugin packages.
Add the following line to `peerDependencies` section of your module's `package.json`:
## Usage in drivers and plugins
Drivers and plugins are recommended to have Appium as a peer dependency, as it already includes
these utility functions. Add the following line to `peerDependencies` section of your module's
`package.json`:
```js
"peerDependencies": {
@@ -19,7 +23,7 @@ Afterwards import it in your code similarly to the below example:
import {timing, util} from 'appium/support';
```
# Usage in helper modules
## Usage in helper modules
If you want to use this module in a helper library, which is not a driver or a plugin,
then add the following line to `dependencies` section of your module's `package.json`:
@@ -36,98 +40,49 @@ Afterwards import it in your code similarly to the below example:
import {timing, util} from '@appium/support';
```
### Categories
## Categories
All utility functions are split into a bunch of different categories. Each category has its own file under the `lib` folder. All utility functions in these files are documented.
#### fs
|Category|Description|
|-|-|
|console|Wrappers for the command line interface abstraction used by the Appium server|
|doctor|Common doctor utilities that can be used by drivers and plugins|
|env|Several helpers needed by the server to cope with internal dependencies and manifests|
|fs|Most of the functions here are just thin wrappers over utility functions available in [Promises API](https://nodejs.org/api/fs.html#promises-api)|
|image-util|Utilities to work with images. Use [sharp](https://github.com/lovell/sharp) under the hood.<br>:bangbang: Node >=18.17 is required to use these utilities|
|log-internal|Utilities needed for internal Appium log config assistance|
|logging|See [the logging section below](#logging)|
|mjpeg|Helpers needed to implement [MJPEG streaming](https://en.wikipedia.org/wiki/Motion_JPEG#Video_streaming)|
|net|Helpers needed for network interactions, for example, upload and download of files|
|node|Set of Node.js-specific utility functions needed, for example, to ensure objects immutability or to calculate their sizes|
|npm|Set of `npm`-related helpers|
|plist|Set of utilities used to read and write data from [plist](https://en.wikipedia.org/wiki/Property_List) files in javascript|
|process|Helpers for interactions with system processes. These APIs don't support Windows.|
|system|Set of helper functions needed to determine properties of the current operating system|
|tempdir|Set of helpers that allow interactions with temporary folders|
|timing|Helpers that allow to measure execution time|
|util|Miscellaneous utilities|
|zip|Helpers that allow to work with archives in `.zip ` format|
Most of the functions there are just thin wrappers over utility functions available in [Promises API](https://nodejs.org/api/fs.html#promises-api).
## logging
#### env
Several helpers needed by the server to cope with internal dependencies and manifests.
#### console
Wrappers for the command line interface abstraction used by the Appium server.
#### image-util
Utilities to work with images. Use [sharp](https://github.com/lovell/sharp) under the hood.
:bangbang: Node >=18.17 is required to use these utilities
#### log-internal
Utilities needed for internal Appium log config assistance.
#### logging
See [below](#logger)
#### mjpeg
Helpers needed to implement [MJPEG streaming](https://en.wikipedia.org/wiki/Motion_JPEG#Video_streaming).
#### net
Helpers needed for network interactions, for example, upload and download of files.
#### node
Set of Node.js-specific utility functions needed, for example, to ensure objects immutability or to calculate their sizes.
#### npm
Set of [npm](https://en.wikipedia.org/wiki/Npm_(software))-related helpers.
#### plist
Set of utilities used to read and write data from [plist](https://en.wikipedia.org/wiki/Property_List) files in javascript.
#### process
Helpers for interactions with system processes. These APIs don't support Windows.
#### system
Set of helper functions needed to determine properties of the current operating system.
#### tempdir
Set of helpers that allow interactions with temporary folders.
#### timing
Helpers that allow to measure execution time.
#### util
Miscellaneous utilities.
#### zip
Helpers that allow to work with archives in .ZIP format.
## logger
Basic logger defaulting to [npmlog](https://github.com/npm/npmlog) with special consideration for running
tests (doesn't output logs when run with `_TESTING=1` in the env).
This is a basic logger defaulting to [npmlog](https://github.com/npm/npmlog) with special
consideration for running tests (doesn't output logs when run with `_TESTING=1`).
### Logging levels
There are a number of levels, exposed as methods on the log object, at which logging can be made. The built-in ones correspond to those of [npmlog](https://github.com/npm/npmlog#loglevelprefix-message-), and are:
`silly`, `verbose`, `info`, `http`, `warn`, and `error`. In addition there is a `debug` level.
There are a number of levels, exposed as methods on the log object, at which logging can be made.
The built-in ones correspond to those of [npmlog](https://github.com/npm/npmlog#loglevelprefix-message-),
and are: `silly`, `verbose`, `info`, `http`, `warn`, and `error`. There is also a `debug` level.
The default threshold level is `verbose`.
The logged output, by default, will be `level prefix message`. So
```js
import { logger } from 'appium-support';
let log = logger.getLogger('mymodule');
import {logging} from 'appium/support';
let log = logging.getLogger('mymodule');
log.warn('a warning');`
```
@@ -141,27 +96,25 @@ warn mymodule a warning
There are two environment variable flags that affect the way `logger` works.
`_TESTING`
- `_TESTING=1` stops output of logs when set to `1`.
`_FORCE_LOGS`
- This flag, when set to `1`, reverses the `_TESTING`
|Variable|Description|
|-|-|
|`_TESTING`|If set to `1`, logging output is stopped|
|`_FORCE_LOGS`|If set to `1`, overrides the value of `_TESTING`|
### Usage
`log.level`
- get and set the threshold level at which to display the logs. Any logs at or above this level will be displayed. The special level silent will prevent anything from being displayed ever. See [npmlog#level](https://github.com/npm/npmlog#loglevel).
- Get and set the threshold level at which to display the logs. Any logs at or above this level will
be displayed. The special level `silent` will prevent anything from being displayed ever. See
[npmlog#level](https://github.com/npm/npmlog#loglevel) for more details.
`log[level](message)`
- logs to `level`
- Logs `message` at the specified `level`
```js
import { logger } from 'appium-support';
let log = logger.getLogger('mymodule');
import {logging} from 'appium/support';
let log = logging.getLogger('mymodule');
log.info('hi!');
// => info mymodule hi!
@@ -169,11 +122,13 @@ log.info('hi!');
`log.unwrap()`
- retrieves the underlying [npmlog](https://github.com/npm/npmlog) object, in order to manage how logging is done at a low level (e.g., changing output streams, retrieving an array of messages, adding log levels, etc.).
- Retrieves the underlying [npmlog](https://github.com/npm/npmlog) object, in order to manage how
logging is done at a low level (e.g., changing output streams, retrieving an array of messages,
adding log levels, etc.).
```js
import { getLogger } from 'appium-base-driver';
let log = getLogger('mymodule');
import {logging} from 'appium/support';
let log = logging.getLogger('mymodule');
log.info('hi!');
@@ -186,11 +141,13 @@ let logs = npmlogger.record;
`log.errorWithException(error)`
- logs the error passed in, at `error` level, and then returns the error. If the error passed in is not an instance of [Error](https://nodejs.org/api/errors.html#errors_class_error) (either directly, or a subclass of `Error`) it will be wrapped in a generic `Error` object.
- Logs the error passed in, at `error` level, and then returns the error. If the error passed in is
not an instance of [Error](https://nodejs.org/api/errors.html#errors_class_error) (either directly,
or a subclass of `Error`), it will be wrapped in a generic `Error` object.
```js
import { getLogger } from 'appium-base-driver';
let log = getLogger('mymodule');
import {logging} from 'appium/support';
let log = logging.getLogger('mymodule');
// previously there would be two lines
log.error('This is an error');
@@ -199,3 +156,7 @@ throw new Error('This is an error');
// now is compacted
throw log.errorWithException('This is an error');
```
## License
Apache-2.0

View File

@@ -1,17 +1,17 @@
@appium/test-support
===================
# @appium/test-support
A collection of test utility lib used across Appium packages.
> A collection of test utility libs used across Appium packages
[![Build Status](https://travis-ci.org/appium/@appium/test-support.svg?branch=master)](https://travis-ci.org/appium/@appium/test-support)
[![NPM version](http://img.shields.io/npm/v/@appium/test-support.svg)](https://npmjs.org/package/@appium/test-support)
[![Downloads](http://img.shields.io/npm/dm/@appium/test-support.svg)](https://npmjs.org/package/@appium/test-support)
## Install
## Installation
```
npm install @appium/test-support --save-dev
```
## Api
## Usage
### stubEnv
@@ -59,7 +59,7 @@ describe('myTest', () => {
### withSandbox
Use when mixing up sinon apis (mocks, spies stubs).
Use when mixing up `sinon` APIs (mocks, spies, stubs).
```js
import { withSandbox } from '@appium/test-support';
@@ -145,14 +145,6 @@ can be scripted. Toward that, there are two scripts:
* `android-emu-travis-post` - waits for the device to be booted, and then goes
to its home screen
## Watch
## License
```
npm run watch
```
## Test
```
npm test
```
Apache-2.0

View File

@@ -1,27 +1,53 @@
# Appium Universal XML Plugin
# @appium/universal-xml-plugin
This is an official Appium plugin designed to make XML source retrieved from iOS and Android use the same node and attribute names, to facilitate cross-platform test writing.
> Appium plugin for transforming platform-specific XML into a universal syntax
## Features
[![NPM version](http://img.shields.io/npm/v/@appium/universal-xml-plugin.svg)](https://npmjs.org/package/@appium/universal-xml-plugin)
[![Downloads](http://img.shields.io/npm/dm/@appium/universal-xml-plugin.svg)](https://npmjs.org/package/@appium/universal-xml-plugin)
TODO
This plugin takes the XML page source retrieved using an iOS or Android driver, and changes various
node and attribute names to use common terminology that can apply to both platforms. This is
achieved by altering the behavior of the `getPageSource` and `findElement` methods.
## Installation - Server
## Motivation
TODO
Having compatibility between iOS and Android XML sources can simplify creation of cross-platform tests.
## Installation - Client
## Installation
No special action is needed to make the features available in the various Appium clients, as this plugin simply alters the behavior of the existing "get page source" and "find element" methods.
```
appium plugin install universal-xml
```
## Activation
The plugin will not be active unless turned on when invoking the Appium server:
The plugin must be explicitly activated when launching the Appium server:
```
appium --use-plugins=universal-xml
```
## Usage
## Examples
TODO
### Node names
|iOS|Android|Transformed|
|-|-|-|
|`XCUIElementTypeButton`|`android.widget.Button`|`Button`|
|`XCUIElementTypeAlert`|`android.widget.Toast`|`Alert`|
|`XCUIElementTypeSwitch`|`android.widget.Switch`|`SwitchInput`|
See [the mapping file](./lib/node-map.js) for a full list of node name translations. Any names not
specified are left as-is.
### Attribute names
|iOS|Android|Transformed|
|-|-|-|
|`name`|`content-desc`|`axId`|
|`label`|`text`|`text`|
|`visible`|`displayed`|`visible`|
Note that this plugin also removes a few attributes from the transformed XML. See
[the mapping file](./lib/attr-map.js) for a full list of attribute name translations and removed
attributes. Any names not specified are left as-is.
## License
Apache-2.0