To provide an integration and regression test suite for PrimeFaces.
This project uses selenium webdriver for web browser automation. Currently, a native installation of Firefox and/or Chrome and/or Safari is required. Additionally, the selenium webdriver corresponding to the browser(s) must also be installed. These can be downloaded from the following locations:
Safari already comes with webdriver OOTB - look for more information into https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari
- Build by source:
mvn clean package - Run "integration tests" with the verify phase:
mvn verify - Run a single test with
mvn verify -Dit.test=org.primefaces.extensions.integrationtests.datepicker.DatePicker001Test
The default configuration of the project runs tests with a visible Firefox browser. This requires geckodriver in order to allow selenium to control the browser.
This is a binary file that can be downloaded via the link above, and can be placed in the base directory of the project where it will be accessed by selenium
for running the tests. The default location for the binary is the base directory of the project with an assumed file name of geckodriver
for Linux/MacOS and geckodriver.exe for Windows, but a non-default path can be specified via a system property:
mvn verify -Dwebdriver.firefoxDriverBinary=$HOME/.selenium/drivers/firefox/geckodriver
The tests will be run by default in a visible browser UI, but can be run in headless mode by activating the headless-mode maven profile:
mvn verify -Pheadless-mode
Google Chrome may also be used to run the tests by activating the "chrome" maven profile. This can be done on the commandline with the -P maven parameter:
mvn verify -Pchrome
Using Chrome to run the tests requires the "chromedriver" binary which can be downloaded via the link above, and can be placed in the base directory of the
project. Selenium will access the binary from the base directory with an assumed file name of chromedriver for Linux/MacOS and geckodriver.exe for Windows,
but a non-default path can be specified via a system property:
mvn verify -Dwebdriver.chromeDriverBinary=$HOME/.selenium/drivers/chrome/chromedriver -Pchrome
When using Chrome, the headless-mode maven profile may be activated to run chrome in headless mode:
mvn verify -Pchrome,headless-mode
Safari may also be used to run the tests by activating the "safari" maven profile. This can be done on the commandline with the -P maven parameter:
mvn verify -Psafari
Keep in mind there are - as of january 2021 - following limitations for Safari webdriver:
- headless-mode ist not available (SeleniumHQ/selenium#5985)
- no parallel test-execution because Safari does not allow for concurrent sessions (SeleniumHQ/selenium#2172)
- Safari is only available on MacOS (and iOS / iPadOS)