This is a sample project which utilises frameworkium-core, a framework for writing maintainable Selenium and REST API tests that also makes integrating with other test things (e.g. JIRA) much easier.
Please see the Frameworkium usage guide for more details.
As a result:
- Please raise issues against the frameworkium-core project, not this one
- See the frameworkium-core releases page for information about changes and new features
- This example project is not updated as regularly as the core project
- To keep up to date with the latest releases of core, modify the following block in the
pom.xml
:
<dependencies>
<dependency>
<groupId>com.github.frameworkium</groupId>
<artifactId>frameworkium-core</artifactId>
<!-- Update this with the latest from the frameworkium-core releases page -->
<version>3.0.0</version>
</dependency>
</dependencies>
The Frameworkium project is based on Ardesco's Selenium-Maven-Template and Joe VDW's Bootstrapium. We have extended it with some handy extras for getting started quickly with Selenium, Appium and Rest Assured.
After setting up apache maven, open the frameworkium-examples
directory in a
terminal/command prompt and run mvn clean verify
to run the example tests using Firefox.
You will need the geckodriver on your path if you are using Firefox version 48 or above.
You can provide the -Dbrowser
argument to chose a browser to run the tests in.
Each browser requires a "driver".
For chrome, ChromeDriver needs to be on your path or specified as an argument:
mvn clean verify -Dbrowser=chrome -Dwebdriver.chrome.driver=c:\path\to\chromedriver.exe
For Firefox 48 and above, geckodriver needs to be on your path or specified as an argument:
mvn clean verify -Dbrowser=firefox -Dwebdriver.gecko.driver=c:\path\to\geckodriver.exe
Want to run tests using a grid and in parallel?
mvn clean verify -Dbrowser=chrome -DgridURL=http://localhost:4444/wd/hub -Dthreads=4
All you need to do is ensure the browser is installed in the default location and that the driver is on the path.
Running mobile web tests using Appium on Sauce Labs is only slightly more involved:
export SAUCE_USERNAME=username
export SAUCE_ACCESS_KEY=access_key
mvn clean verify -Dplatform=ios -Dbrowser=safari -Dsauce=true
Running mobile web tests using Appium on BrowserStack:
export BROWSER_STACK_USERNAME=username
export BROWSER_STACK_ACCESS_KEY=access_key
mvn clean verify -Dplatform=ios -Dbrowser=safari -DbrowserStack=true
A full list of arguments can be found on the guidance page.
After running your tests, you can generate an Allure test report by simply running:
mvn allure:report
Frameworkium sets you up for other stuff too - check out the guidance page for further info.