https://github.com/axonivy/web-tester
Easy Web-Integration tests for your process automation projects (PrimeFaces widgets + Selenium)
https://github.com/axonivy/web-tester
axonivy java junit primefaces selenide selenium test-automation testing
Last synced: 4 months ago
JSON representation
Easy Web-Integration tests for your process automation projects (PrimeFaces widgets + Selenium)
- Host: GitHub
- URL: https://github.com/axonivy/web-tester
- Owner: axonivy
- License: apache-2.0
- Created: 2016-04-21T11:27:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-17T07:15:02.000Z (about 2 years ago)
- Last Synced: 2024-04-17T16:20:52.089Z (about 2 years ago)
- Topics: axonivy, java, junit, primefaces, selenide, selenium, test-automation, testing
- Language: Java
- Homepage:
- Size: 518 KB
- Stars: 3
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING
- Security: SECURITY.md
Awesome Lists containing this project
README
# web-tester
[![web-tester version][web-lts] ![web-le][web-le]][web-central]
[![primeui-tester version][prime-lts] ![prime-le][prime-le]][prime-central]
[![test-bom version][bom-lts] ![bom-le][bom-le]][bom-central]
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](https://developer.axonivy.com/download).
Checkout our official
[documentation](https://developer.axonivy.com/doc/9.2/concepts/testing/web-testing.html).
for more information.
## primeui-tester
If your JSF-Page contains [PrimeFaces](https://www.primefaces.org/showcase/)
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.
## test-bom
The `test-bom` artifact defines third-party dependencies that are used for testing.
* [JUnit 5](https://junit.org/junit5/)
* [AssertJ](https://assertj.github.io/doc/)
* [Selenide](https://selenide.org/documentation.html)
# How to use in your project
The web-tester runs with [Selenide](https://selenide.org/),
[Selenium](https://selenium.dev/projects/) and [JUnit
5](https://junit.org/junit5/). Simply add this library to your dependencies in
the pom.xml:
```xml
...
com.axonivy.ivy.webtest
web-tester
12.0.1
test
```
Add a new test class to test your process (e.g.
[WebTestRegistrationForm.java](https://github.com/axonivy/project-build-examples/blob/master/compile-test/crmIntegrationTests/src_test/ch/ivyteam/integrationtest/WebTestRegistrationFormIT.java))
or a PrimeFaces widget (e.g.
[TestPrimeUi.java](primeui-tester/src/test/java/com/axonivy/ivy/webtest/primeui/TestPrimeUi.java)):
```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
* See the [Releases](https://github.com/axonivy/web-tester/releases)
## Release new version
### Preparation
* Check/Update the changelog file above
### Release
Since 9.4: Releasing is only possible on a release branch.
* Verify:
- the consuming repos use the latest SNAPSHOT. To be sure run the raise build using, providing your current SNAPSHOT [build][raise-job].
- renovate dependencies are accurate; especially jersey-client must be sync with the current core!
* Create a release branch if it does not exist yet (e.g. release/13.2)
* Run the [release build](build/release/Jenkinsfile) on the release branch
* Confirm the publishing of the created release on the [Central Portal](https://central.sonatype.com/publishing/deployments)
* 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):
```bash
.ivy/raise-version.sh 13.2.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][raise-job]
- Publish the latest [draft release](https://github.com/axonivy/web-tester/releases) 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](https://developer.axonivy.com/)
[](http://www.axonivy.com)
## License
The Apache License, Version 2.0
[web-lts]: https://img.shields.io/maven-metadata/v.svg?versionPrefix=12&label=web-tester&logo=apachemaven&metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Faxonivy%2Fivy%2Fwebtest%2Fweb-tester%2Fmaven-metadata.xml
[web-le]: https://img.shields.io/maven-metadata/v.svg?label=LE&color=yellow&logo=apachemaven&metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Faxonivy%2Fivy%2Fwebtest%2Fweb-tester%2Fmaven-metadata.xml
[web-central]: https://repo1.maven.org/maven2/com/axonivy/ivy/webtest/web-tester/
[prime-lts]: https://img.shields.io/maven-metadata/v.svg?versionPrefix=12&label=primeui-tester&logo=apachemaven&metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Faxonivy%2Fivy%2Fwebtest%2Fprimeui-tester%2Fmaven-metadata.xml
[prime-le]: https://img.shields.io/maven-metadata/v.svg?label=LE&color=yellow&logo=apachemaven&metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Faxonivy%2Fivy%2Fwebtest%2Fprimeui-tester%2Fmaven-metadata.xml
[prime-central]: https://repo1.maven.org/maven2/com/axonivy/ivy/webtest/primeui-tester/
[bom-lts]: https://img.shields.io/maven-metadata/v.svg?versionPrefix=12&label=test-bom&logo=apachemaven&metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Faxonivy%2Fivy%2Ftest%2Ftest-bom%2Fmaven-metadata.xml
[bom-le]: https://img.shields.io/maven-metadata/v.svg?label=LE&color=yellow&logo=apachemaven&metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Fcom%2Faxonivy%2Fivy%2Ftest%2Ftest-bom%2Fmaven-metadata.xml
[bom-central]: https://repo1.maven.org/maven2/com/axonivy/ivy/test/test-bom/
[raise-job]: https://jenkins.ivyteam.io/view/jobs/job/github-repo-manager_raise-web-tester-version/job/master/