ProcessMaker 4 Tests Documentation
PM4 Selenium Tests consist of a series of Selenium tests that will be used to automatically validate changes in ProcessMaker 4 releases.
These tests will be executed within a PM4 custom instance dubbed "Trogdor". Trogdor processes will be initiated via CI/API or manual requests and then will execute the tests in this repository against the environment specified in the request configuration. Once the tests have completed a report of the results will be provided.
In Trogdor, a custom selenium docker container is initialized with the contents of the repository. The script which executes the tests inside of this container, is setup to add the inludes/ dir of this repository into the PYTHONPATH, so that those classes may be reused across individual tests.
In Trogdor, it will parse the config.json file of this repository in order to determine which tests to run. Once you are satisfied with the test, add it to the config file in order to execute it within Trogdor.
You can develop and run tests locally. In order to do so, you must have the following:
-
Python 3.6.9 or above
-
ChromeDriver 80.0.3987.106 or above
-
Homebrew (macOS only)
- Install pip &&
pip install selenium
brew cask install chromedriver
(macOS only)- Add chromedriver to PATH
- Clone the repository into a directory
- Create
__init__.py
in /includes directory - Write and save this lines:
data = {"server_url": "your/pm4/server/url/here", "username": "your/username/here", "password": "your/password/here"}
- Navigate to
/tests
folder - Execute test with
ENVIRONMENT='local' .path/to/test_you_want_to_run.py
- Note: If test is not executable, run
chmod +x test_you_want_to_run.py
- Note: If test is not executable, run
Notes:
- If you want to view the tests running in the browser, comment out this line in
/includes/test_parent.py
:# chrome_options.add_argument("--headless")
- If you want to view python unittest results in your terminal, add this line to the bottom of the test file:
print(output)
Inside each test file:
- Add these lines to the top of your imports:
from os import getenv, path
if getenv('ENVIRONMENT') == 'local':
from sys import path
path.append('../includes')
from __init__ import data
Inside of config.json
:
- Add a dictionary item containing a
"name"
and the test"path"
relative to the repo root directory: {
"name": "brief-summary-of-test-case",
"path": "tests/test_name.py"
}
- Subclasses of
unittest
classes BaseTest
from which test files inherit- Helper methods
BasePageShell
andBasePage
classes, from with other Page classes inherit, and Page class skeletonBasePageElement
from which Page Element classes inherit- Locator classes containing page element locators and locator types
- Test cases and Test case skeleton
- Add a new feature request here.
- Add a new bug report here.