Skip to content

Easy Web-Integration tests for your process automation projects (PrimeFaces widgets + Selenium)

License

Notifications You must be signed in to change notification settings

axonivy/web-tester

web-tester

web-tester version primeui-tester version unit-tester version

The web-tester artifact provides you a API which helps you test your JSF-Page. With this API it is easy to setup your test environment and send requests against your Axon Ivy Engine.

Checkout our official documentation. for more information.

primeui-tester

If your JSF-Page contains PrimeFaces widgets, the primeui-tester gives you the possibility to interact with those widgets and check if it's in the condition you expected it to be.

unit-tester

The unit-tester artifact provides you the following APIs for unit testing:

How to use in your project

The web-tester runs with Selenide, Selenium and JUnit 5. Simply add this library to your dependencies in the pom.xml:

<dependencies>
...
  <dependency>
    <groupId>com.axonivy.ivy.webtest</groupId>
    <artifactId>web-tester</artifactId>
    <version>9.2.2</version>
    <scope>test</scope>
  </dependency>
</dependencies>

Add a new test class to test your process (e.g. WebTestRegistrationForm.java) or a PrimeFaces widget (e.g. TestPrimeUi.java):

@IvyWebTest
class WebTest {

  @Test
  void registerNewCustomer() {
    open(EngineUrl.createProcessUrl("myWorkflow/154616078A1D629D/start.ivp"));
    $(By.id("form:firstname")).sendKeys("Unit");
    $(By.id("form:lastname")).sendKeys("Test");
    $(By.id("form:submit")).shouldBe(enabled).click();
    $(By.id("form:newCustomer")).shouldBe(visible, text("Unit Test"));
  }

  @Test
  void selectOneMenu() {
    open("https://primefaces.org/showcase/ui/input/oneMenu.xhtml");
    var selectOne = PrimeUi.selectOne(selectMenuForLabel("Basic:"));
    assertThat(selectOne.getSelectedItem()).isEqualTo("Select One");
    var ps4 = "PS4";
    selectOne.selectItemByLabel(ps4);
    assertThat(selectOne.getSelectedItem()).isEqualTo(ps4);
  }
}

Changelog

Release new version

Preparation

  • Check/Update the changelog file above

Release

Since 9.4: Releasing is only possible on a release branch.

  • Create a release branch if it does not exist yet (e.g. release/10.0)
  • Run the release build on the release branch
  • Merge the Pull Request for next development iteration
  • If you have created a new release branch, then manually raise the version on the master branch to the next major or minor version by executing the following command in the root of this project (adjust version number accordingly):
.ivy/raise-version.sh 10.0.0-SNAPSHOT

Post-Release

Wait until the maven central release is available: this may take several hours until it's fully distributed.

  • Raise web-tester in other repos by triggering this build
  • Publish the latest draft release do preserve the current changelog.
    • Select the tag which was created for this release by the release-pipeline
    • Verify that the title is correct
    • Set the release as 'latest release'
    • Publish it

Authors

ivyTeam

Axon Ivy

License

The Apache License, Version 2.0