This repository is supposed to be used as a template for test automation projects using Neodymium Library. It contains both a pure Java and a Cucumber approach. It is a test automation template based on best practice libraries and added missing functionalities designed to aid test automation done by Xceptance.
Please perform the Hello World tutorial first to get a first insight and feeling for test automation with Neodymium. Afterwards you will be ready to deep dive into more complex scenarios. Our Neodymium-example project demonstrates all the cool stuff that's possible with Neodymium. Furthermore, we've set up a Neodymium Wiki to explain different concepts and use cases.
- Fork this project
- Rename the project (Open the
pom.xml
and adjust the name tag) - Import the project into an IDE of your choice. (It should be able to handle Maven project in order to sort all the dependencies for you)
-
Set up WebDrivers and Browsers
- Open
config\neodymium.properties
- Set and uncomment the property
neodymium.webDriver.chrome.pathToDriverServer
- Set and uncomment the property
neodymium.webDriver.chrome.pathToBrowser
if you want don't want to use the default - Chrome
- Open
-
Change the URL (or try with https://www.xceptance.com:443/en/ (already set) for demo purposes)
- Open
config\neodymium.properties
- Set
neodymium.url.protocol
to the protocol, i.e.https
- Set
neodymium.url.host
to the host, i.e.www.xceptance.com
- Set
neodymium.url.site
to the path, i.e.en
- Set
neodymium.url.port
to the port with a colon in front, i.e.:443
Within the configuration, those values are combined using the following rule:
${neodymium.url.protocol}://${neodymium.url.host}${neodymium.url.port}/${neodymium.url.site}/
Instead of setting all these single values, the property
neodymium.url
could also simply be changed to the desired URL. However, since the Owner framework allows reading and especially mutating properties, it is often more helpful to separate the URL in its respective parts. - Open
- Run the
template.neodymium.tests.smoke.HomePageTest.java
from the Neodymium package as JUnit test
- Adjust the validation within the
template.pageObjects.pages.HomePage.java
to match the site that is going to be tested (only if you changed it) - Run the
template.neodymium.tests.smoke.HomePageTest.java
again
- Run the
template.cucumber.tests.RunAllFeatures.java
from the Cucumber package as JUnit test
If you want to adopt the template for your own project, you'll want to change the template folder to something more project specific. Please perform the following steps to rename it:
- Rename the
template
package to a name of your choice - Update the
pom.xml
(especially the Surefire configuration that states which tests should be executed) - Update the
@CucumberOptions
withintemplate.cucumber.tests.RunAllTests.java
to have the new path in features and glue
After you have decided whether you want to go the pure Java or the Cucumber way. You can simply delete the folder of the unused approach (either src/test/java/template/neodymium
or src/test/java/template/cucumber
).
If you like you can also clean up the Surefire configuration in the pom.xml
by removing the now unused <include>
path.
<includes>
<!-- Neodymium (pure Java) test cases -->
<include>template/neodymium/tests/**/*Test.java</include>
<!-- Cucumber test cases -->
<include>template/cucumber/tests/RunAllFeaturesTest.java</include>
</includes>
In case you want to use both approaches you are free to do so and take advantage of both of their strengths.
With Version 5.0.0 of Neodymium we introduced JUnit 5 as our standard way of doing things. But since JUnit 4 is still very popular we decided to keep a backwards compability to JUnit 4. Hot to use this can be seen in the branch update-to-neo-5-junit-4
MIT