Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Write Unit Tests for Primefaces/JSF Apps [closed]

Does anyone know of a simple way that I can write Java unit tests for Primefaces or other JSF-based web applications? I found this blog from Primefaces' creator:

https://cagataycivici.wordpress.com/2009/09/08/easy-unit-testing-jsf-backing-beans/

... but it's from 2009, and recommends using Java with Mockito and JUnit. I'm not sure if there have been any new fangled advances in unit test coding since that time which make creating unit tests for Primefaces even easier.

Other sources recommend using Java with JSFUnit, which looks like it has some issues and is not intuitive for myself to set up.

Thanks for the replies.

like image 485
Fuzzy Analysis Avatar asked Apr 20 '15 22:04

Fuzzy Analysis


1 Answers

You can try Selenium.

Selenium client API:
As an alternative to writing tests in Selenese, tests can also be written in various programming languages. These tests then communicate with Selenium by calling methods in the Selenium Client API. Selenium currently provides client APIs for Java, C#, Ruby and Python. Read More...

Examples :
Testing JSF applications with Arquillian and Selenium
Java testing with Selenium and dynamic ids in html

like image 194
vels4j Avatar answered Nov 19 '22 14:11

vels4j