Metadata-Version: 2.4
Name: positivo-appium-extensions
Version: 1.2.0
Summary: Additional keywords for Robot Framework's AppiumLibrary. Developed within the Technology Residency Program executed by CEPEDI, coordinated by SOFTEX, and supported by MCTI, with the participation of Positivo Tecnologia as the partner company that proposed the development challenge.
Author: Equipe de QA - CEPEDI / RESTIC36
Maintainer-email: Diogo Dorea <diogodorea@gmail.com>, Eduardo Takeshi <wattksh@gmail.com>, Fabio Nilo <fabionilosoares@gmail.com>, Gabriel Cerqueira <gcacarvalho.cic@uesc.br>, Geovane Glória <geovaneglorialima@gmail.com>, Henio Pedro <henioslv@gmail.com>, Marya Fernandes <marya_matos@hotmail.com>, Thalles Cardoso <thallescard@gmail.com>, Lucas de Eiroz Rodrigues <lucas.de.eiroz@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/lucasdeeiroz/positivo-appium-extensions
Project-URL: Documentation, https://github.com/lucasdeeiroz/positivo-appium-extensions/blob/develop/README.md
Project-URL: Changelog, https://github.com/lucasdeeiroz/positivo-appium-extensions/blob/develop/docs/CHANGELOG.md
Keywords: robotframework,appium,mobile,automation,android,testing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: Robot Framework
Classifier: Framework :: Robot Framework :: Library
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: <3.15,>=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: robotframework>=7.0
Requires-Dist: robotframework-appiumlibrary<4.0.0,>=2.0.0
Requires-Dist: Appium-Python-Client<6.0.0,>=3.1.0
Requires-Dist: selenium<5.0.0,>=4.14.0
Requires-Dist: kitchen>=1.2.6
Requires-Dist: geopy>=2.4.1
Requires-Dist: urllib3>=2.0.7
Requires-Dist: certifi>=2024.2.2
Requires-Dist: idna>=3.7
Requires-Dist: six>=1.16.0
Requires-Dist: trio>=0.26.2
Requires-Dist: trio-websocket>=0.11.1
Requires-Dist: sniffio>=1.3.0
Requires-Dist: sortedcontainers>=2.4.0
Requires-Dist: attrs>=23.2.0
Requires-Dist: websocket-client>=1.8.0
Requires-Dist: wsproto>=1.2.0
Requires-Dist: PySocks>=1.7.1
Requires-Dist: outcome>=1.3.0
Requires-Dist: decorator>=5.1.1
Requires-Dist: docutils>=0.20.1
Requires-Dist: opencv-python-headless>=4.8.0
Requires-Dist: numpy>=1.26.0
Dynamic: license-file

# Robot Framework - Appium Extensions (Android)

Custom keywords extending [Robot Framework’s AppiumLibrary](https://github.com/serhatbolsu/robotframework-appiumlibrary), optimized for **mobile automation on Android**.

This library enhances the native AppiumLibrary with new gestures, UI utilities, and validation features designed for **QA teams automating Android applications**.  
It aims to serve as an open-source reference for improving test reliability, coverage, and maintainability in mobile test automation.

[![PyPI version](https://img.shields.io/pypi/v/positivo-appium-extensions.svg)](https://pypi.org/project/positivo-appium-extensions/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/Python-3.9%2B-3776AB.svg?logo=python&logoColor=white)](https://www.python.org/downloads/)

---

## Available Keywords

- Gestures:
    - Scroll Inside
    - Scroll To Element
    - Swipe Element
    - Perform Long Press
    - Perform Pinch
    - Perform Zoom

- Touch utilities:
    - Click Elements
    - Tap At Percentage
    - Tap Element At Coordinates

- Visibility & Lookup:
    - Compare Screenshots
    - Get Visible Elements On Screen
    - Wait Multiple Elements

- System/App:
    - Change Theme
    - Get Readable Network Status
    - Terminate Application Extension

Individual documentation are in keyword docstrings.

---

## Technology Stack

- **Python 3.9+**
- **Robot Framework 4.0+**
- **Appium Server 2.0+**
- **UiAutomator2 driver (Android)**
- **Appium-Python-Client 5.1.1+**
- **Selenium W3C Actions**
- **OpenCV + scikit-image + NumPy** (for visual comparison)
- **ADB + Android SDK tools**

---

## Prerequisites and Requirements

- Android device or emulator connected with ADB
- Dependencies listed in `requirements.txt`
- Appium Server running (`appium` or `appium --allow-cors`)
    ```bash
  npm install -g appium
    ```
- UiAutomator2 driver installed (`appium driver install uiautomator2`)
    ```bash
  appium driver install uiautomator2
    ```

---

## Installation

You can install the package directly from **PyPI** (recommended):
```bash
pip install positivo-appium-extensions
```

Or, if you prefer to work with the latest development version:
```bash
git clone https://github.com/<....>.git
cd robotframework-appium-extensions
pip install .
```

---

## How To Run Tests

Run any .robot test suite using Robot Framework’s CLI:
```bash
robot -d results tests/robot/perform_zoom.robot
```
- `-d results` saves logs, reports, and screenshots in a dedicated folder.
- You can adapt paths for your test files or custom resources.

---

## Emulator / Device Setup

To successfully run the automated tests included in this repository, ensure that the test environment (emulator or physical device) meets the following conditions:
- Use an **Android device or emulator** running **Android 11 or higher**.  
- Before executing the test suites, **verify which applications are required** by the selected tests and ensure they are **properly installed** on the device.  
  > For example: some suites may require system apps such as Calculator, Google Maps, or Play Store.
- Using a **Google APIs emulator image** is recommended, as minimal system images may lack these default apps.

---

## Usage Example

```robot
*** Settings ***
Library    AppiumLibrary
Library    robotframework_appium_extensions.keywords.PerformPinch

*** Test Cases ***
Pinch Example
    Open Application    http://localhost:4723    platformName=Android    automationName=UiAutomator2
    Perform Pinch    locator=id=map_view    scale=0.6
```

---

## Known Limitations

- Platform: tested on Android 7.0+; iOS not supported.
- Multi-touch gestures: Android 9+ recommended for reliable Pinch/Zoom (W3C Actions).
- Device fragmentation: differences between manufacturers (Samsung/Xiaomi, etc.) may affect gesture behavior.
- Dynamic elements: fast-moving/animated elements may require explicit waits.
- Power saving mode: can cause inconsistencies; disable during tests.
- Performance: image comparison may be slow on high-resolution screens.

---

## Troubleshooting

- Device not detected: run adb devices → enable USB Debugging; restart ADB (`adb kill-server && adb start-server`).
- Appium session not starting: ensure Appium 2.x is running and uiautomator2 driver installed (`appium driver install uiautomator2`).
- Element not found: validate selectors in Appium Inspector; prefer `id/accessibility_id`; use explicit waits.
- Inconsistent gestures: increase `duration/steps`; add pauses (`pause_before/pause_after`); prefer Android 9+.
- Slow/timeouts: use a good-quality USB cable; disable Android animations; increase timeouts; close background apps.
- ADB errors: ensure `adb` is in your PATH; restart ADB; reconnect the device; check permissions.

---

## Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on:

- Code style
- Commit messages
- Tests and documentation
- PR process

---

## License

Licensed under Apache 2.0 [LICENSE](LICENSE)

---

### Acknowledgments

This open-source repository was developed within the scope of the **Technology Residency Program**,  
executed by **CEPEDI**, coordinated by **SOFTEX**, and supported by the **Ministry of Science, Technology and Innovation (MCTI)**.

The development challenge addressed in this repository was proposed by **Positivo Tecnologia**,  
a partner company of the program, as part of its collaboration with the Technology Residency initiative.

We acknowledge and thank all the institutions involved for their support in the execution and dissemination of this open-source project.
