ArquillianPrimeFaces

To make Arquillian - Graphene - Selenium - JUnit life easier on PrimeFaces components

License

License

Categories

Categories

Arquillian Application Testing & Monitoring PrimeFaces Jakarta EE The Web Tier Jakarta Server Faces
GroupId

GroupId

org.omnifaces
ArtifactId

ArtifactId

arquillian-primefaces
Last Version

Last Version

0.3
Release Date

Release Date

Type

Type

jar
Description

Description

ArquillianPrimeFaces
To make Arquillian - Graphene - Selenium - JUnit life easier on PrimeFaces components
Project URL

Project URL

https://github.com/omnifaces/arquillian-primefaces
Project Organization

Project Organization

OmniFaces
Source Code Management

Source Code Management

https://github.com/omnifaces/arquillian-primefaces

Download arquillian-primefaces

How to add to project

<!-- https://jarcasting.com/artifacts/org.omnifaces/arquillian-primefaces/ -->
<dependency>
    <groupId>org.omnifaces</groupId>
    <artifactId>arquillian-primefaces</artifactId>
    <version>0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.omnifaces/arquillian-primefaces/
implementation 'org.omnifaces:arquillian-primefaces:0.3'
// https://jarcasting.com/artifacts/org.omnifaces/arquillian-primefaces/
implementation ("org.omnifaces:arquillian-primefaces:0.3")
'org.omnifaces:arquillian-primefaces:jar:0.3'
<dependency org="org.omnifaces" name="arquillian-primefaces" rev="0.3">
  <artifact name="arquillian-primefaces" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.omnifaces', module='arquillian-primefaces', version='0.3')
)
libraryDependencies += "org.omnifaces" % "arquillian-primefaces" % "0.3"
[org.omnifaces/arquillian-primefaces "0.3"]

Dependencies

provided (3)

Group / Artifact Type Version
javax : javaee-api jar 8.0
junit : junit jar 4.12
org.jboss.arquillian.graphene : graphene-webdriver pom 2.3.2

test (3)

Group / Artifact Type Version
org.jboss.arquillian.junit : arquillian-junit-container jar
org.jboss.shrinkwrap.resolver : shrinkwrap-resolver-impl-maven-archive jar
org.primefaces : primefaces jar 6.2

Project Modules

There are no modules declared in this project.

arquillian-primefaces

To make Arquillian - Graphene - Selenium - JUnit life easier on PrimeFaces components

Prerequirements

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.13.1</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.jboss.arquillian.graphene</groupId>
    <artifactId>graphene-webdriver</artifactId>
    <version>2.3.2</version>
    <type>pom</type>
    <scope>test</scope>
</dependency>

Installation

<dependency>
    <groupId>org.omnifaces</groupId>
    <artifactId>arquillian-primefaces</artifactId>
    <version>0.3</version>
    <scope>test</scope>
</dependency>

Usage example

<h:form id="form">
    <p:inputText id="inputText" ... />
    <p:inputNumber id="inputNumber" ... />
    <p:spinner id="spinner" ... />
    <p:autoComplete id="autoComplete" ... />
    <p:selectOneMenu id="selectOneMenu" ... />
    <p:selectOneRadio id="selectOneRadio" ... />
    <p:selectBooleanCheckbox id="selectBooleanCheckbox" ... />
    <p:commandButton id="commandButton" ... />
</h:form>
@FindBy(id="form:inputText")
private WebElement inputText;

@FindBy(id="form:inputNumber")
private WebElement inputNumber;

@FindBy(id="form:spinner")
private WebElement spinner;

@FindBy(id="form:autoComplete")
private WebElement autoComplete;

@FindBy(id="form:selectOneMenu")
private WebElement selectOneMenu;

@FindBy(id="form:selectOneRadio")
private WebElement selectOneRadio;

@FindBy(id="form:selectBooleanCheckbox")
private WebElement selectBooleanCheckbox;

@FindBy(id="form:commandButton")
private WebElement commandButton;

@Test
public void testSomeJSFPageWithPrimeFacesComponents() {
    ArquillianPrimeFaces.setInputTextValue(inputText, "new input text value");
    ArquillianPrimeFaces.setInputNumberValue(inputText, 42);
    ArquillianPrimeFaces.setSpinnerValue(inputText, 7);
    ArquillianPrimeFaces.setAutoCompleteValue(autoComplete, "search query", "option value");
    ArquillianPrimeFaces.setSelectOneMenuValue(selectOneMenu, "option value");
    ArquillianPrimeFaces.setSelectOneRadioValue(selectOneMenu, "option value");
    ArquillianPrimeFaces.setSelectBooleanCheckboxChecked(selectBooleanCheckbox, true);
    ArquillianPrimeFaces.clickCommandButton(commandButton);
    
    // ...
}

Supported PrimeFaces 6.x components as of version 0.3

  • <p:inputText>
  • <p:inputMask>
  • <p:inputNumber>
  • <p:spinner>
  • <p:slider>
  • <p:autoComplete>
  • <p:selectOneMenu> (also with <p:ajax>)
  • <p:selectOneRadio> (also with <p:ajax>)
  • <p:selectOneButton>
  • <p:selectBooleanCheckbox>
  • <p:commandButton> (also with ajax=false)
  • <p:commandLink> (also with ajax=false)
  • <p:link>

NOTE: PrimeFaces 5.x is not necessarily supported. This might be worked on later. Currently, the integration tests run on PrimeFaces 6.0, 6.1 and 6.2.

org.omnifaces

Versions

Version
0.3
0.2
0.1