Testing is necessary to create bug free and stable product. Nowadays, We have many testing tools available in the market such as Selenium, JUnit, Apache JMeter, Mockito and Arquillian.
In this blog, I will explain how to configure Arquillian test tool with Liferay DXP. Arquillian has many features such as.
Managing the lifecycle of the container (start/stop)
Write a test case to assert the behavior of a CDI bean
Execute the Arquillian test case in multiple compatible containers
Work outside of a real environment.
Prerequisite : Basic knowledge of Liferay DXP/7
To configure arquillian with Liferay DXP/7 follow below steps:
Step 1 : JMX Configuration In Liferay DXP/7
Install Apache Aries JMX
Run startTestableTomcat Gradle task in Liferay workspace to install the Apache Aries JMX modules automatically.
Note : If you are using Liferay CE 7.0 GA4 or earlier version of Liferay DXP Then you need to install following modules manually.
set "JMX_OPTS=-Dcom.sun.management.jmxremote-Dcom.sun.management.jmxremote.authenticate=false-Dcom.sun.management.jmxremote.port=8099-Dcom.sun.management.jmxremote.ssl=false"
set "CATALINA_OPTS=%CATALINA_OPTS% %JMX_OPTS%"
Step 2: Add following Property in portal-ext.properties
browser.launcher.url= #To launching a browser on its own
setup.wizard.enabled=false #To bypasses launching the Setup Wizard
Step 3: Add browser driver for functional testing
We need to install “ chromedriver ” to configure chrome browser for function testing.
For Ubuntu:
To install chromedriver to ubuntu run following command
sudo apt-get install chromium-chromedriver
For Windows:
We can download and install a chrome driver from following link.
We use cookies to deliver personalized content, analyze trends, administer the site, track user movements on the site, and collect demographic information about our user base as a whole. Accept all cookies for the best possible experience on our website or manage your preferences.
What For?