DEPRECATED - A Python 3 automation test tool for desktop applications
Перейти к файлу
Kimberly 5e33c6cc2c removed debugging output 2019-11-04 17:56:41 -07:00
bootstrap Ensure Python 3.7 and dependencies are installed with win_bootstrap 2019-10-29 16:30:34 -07:00
moziris removed debugging output 2019-11-04 17:56:41 -07:00
targets Merge dev to master (#588) 2019-09-24 16:55:16 -07:00
tests/sample Shrinking bounding box behind text on debug images 2019-10-17 15:22:44 -07:00
tools Merge dev to master (#588) 2019-09-24 16:55:16 -07:00
.gitignore Merge dev to master (#588) 2019-09-24 16:55:16 -07:00
.pre-commit-config.yaml More changes to README 2019-10-09 08:49:26 -07:00
.travis.yml renamed smoke stage to unit, renamed config tests slightly 2019-11-04 14:57:42 -07:00
CODE_OF_CONDUCT.md
LICENSE
MANIFEST.in Merge dev to master (#588) 2019-09-24 16:55:16 -07:00
Pipfile Update mozrunner and mozversion libraries to latest releases 2019-10-28 12:19:46 -07:00
README.md More changes to README 2019-10-09 08:49:26 -07:00
setup.cfg Merge dev to master (#588) 2019-09-24 16:55:16 -07:00
setup.py Reinstate better screenshot logic (#636) 2019-10-29 16:30:34 -07:00
tox.ini renamed smoke stage to unit, renamed config tests slightly 2019-11-04 14:57:42 -07:00

README.md

moziris

Travis (.com) PyPI - Python Version GitHub GitHub repo size GitHub issues

Mozilla Iris is a tool that uses on-screen pattern and text matching, while manipulating a machine's mouse and keyboard, to test visual and interactive states of an application. For more detailed information and troubleshooting tips, please view our wiki.

Installation

Mac instructions:

System Requirements

Setup

git clone https://github.com/mozilla/iris
# Run the Mac bootstrap script
cd iris
./bootstrap/bootstrap.sh
# Run this command to agree to xcode terms of service
sudo xcodebuild -license accept
  • Restart your Mac in order for certain libraries to be recognized
  • In System Preferences, go to Mission Control and change the keyboard shortcut for "Application Windows" to "-", or none
  • Launch Iris
cd iris
pipenv install
pipenv shell
iris sample

Windows 7 / Windows 10 Professional instructions:

System Requirements

Setup

git clone https://github.com/mozilla/iris
cd iris
bootstrap\bootstrap.sh
# Install project requirements and activate the virtualenv
pipenv install
pipenv shell
# Run Iris
iris sample

Ubuntu Linux 16.04 instructions:

System Requirements

Setup

git clone https://github.com/mozilla/iris
cd iris
./bootstrap/bootstrap.sh
# Note: This will take around 10 minutes to download, compile, and install dependencies
# Run the following commands to complete installation and launch Iris
pipenv install
pipenv shell
iris sample

Usage

The Iris project is meant to be used with your own "target" and tests. A target is basically a pytest plugin invoked by Iris, which will then gather data during the run to present in a web-based interface known as the Iris Control Center.

Iris is available as a PyPI library named moziris. It requires system dependencies that are installed using the bootstrap script from this repo.

Once your system is configured, and the setup instructions have been followed, you can test some of Iris' functionality.

To invoke the "sample" target - which is just a placeholder project for demonstration purposes:

iris sample

To open the Control Center, which is the web-based UI for managing local Iris runs:

iris -k

To verify that the Iris API itself exists, without running tests, this command will move your mouse on screen:

api-test

A complete list of command-line options is available when invoking the -h flag.

For more detailed examples, see the project wiki.

Contributing

See our project wiki for more information on contributing to Iris.

Enable Pre-Commit Hooks

Iris has pre-commit hooks for flake8 linting and black code formatting. These hooks will run black and flake8 prior to committing your changes.

This means that black will format all python files in-place, and flake8 will lint your code for any errors. If there are flake8 violations, your changes will not be committed. The list of ignored rules is documented in the tox.ini file. There should be a compelling reason to do so before adding to this list.

If you already have Iris installed on your system prior to this patch, you will need to run pipenv install again to install the pre-commit module.

# Install dependencies, including pre-commit
pipenv install
# Install pre-commit hooks defined in .pre-commit-config.yaml
pre-commit install

That's it! Here's an example of how it works:

# make some changes
git add -A
git commit -m 'detailed commit message'
[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /Users/ksereduck/.cache/pre-commit/patch1570121459.
black....................................................................Passed
Flake8...................................................................Failed
hookid: flake8

targets/firefox/bug_manager.py:11:1: E402 module level import not at top of file
targets/firefox/bug_manager.py:12:1: E402 module level import not at top of file
targets/firefox/bug_manager.py:14:1: E402 module level import not at top of file
targets/firefox/bug_manager.py:15:1: E402 module level import not at top of file
targets/firefox/bug_manager.py:16:1: E402 module level import not at top of file

[INFO] Restored changes from /Users/ksereduck/.cache/pre-commit/patch1570121459.