Prerequisites

To be able to run the basic tutorial, you first need to have carried out the installation instructions for the base installation.


1. Downloading the example project

Download the example project from the afor automation project on github.
Place the example in a directory such as ~/dev/afor-example or c:\dev\afor-example

2. Import the project using your IDE

Open your IDE and import the project, as a Maven project.

Note
Choose the pom.xml file when importing.

3. Create a run configuration

To run the automation features from your IDE, create a new JUnit run configuration against the RunTest unit test.

The parameters for the test allow different scenarios to be run.
To run a full regression run, use the configuration -Dspring.profiles.active=dev -Dcucumber.options="-t ~@wip -t ~@opendefect" -Dbrowser=chrome

Description Example

Run all scenarios which have test tags
In dev environment,
using chrome as the browser

-Dspring.profiles.active=dev -Dcucumber.options="-t @test" -Dbrowser=chrome

Run all scenarios which don’t
have wip or opendefect tags
In dev environment,
using chrome as the browser

-Dspring.profiles.active=dev -Dcucumber.options="-t ~@wip -t ~@opendefect" -Dbrowser=chrome

Rerun all failed scenarios
In dev environment,
using chrome as the browser

-Dspring.profiles.active=dev -Dcucumber.options="@target/afor/rerun.txt" -Dbrowser=chrome

Run the scenario on line 7 of
GoogleSearch.feature
In dev environment,
using chrome as the browser

-Dspring.profiles.active=dev -Dcucumber.options="classpath:features/web/GoogleSearch.feature:7" -Dbrowser=chrome

Running a scenario, using maven
from the command line
or from a build server

mvn test -Dspring.profiles.active=dev -Dcucumber.options="-t ~@wip -t ~@opendefect" -Dbrowser=chrome

Running scenarios, specifiying
proxy settings for API
based testing

-Dspring.profiles.active=dev -Dcucumber.options="-t ~@wip -t ~@opendefect" -Dbrowser=chrome
-Dproxy.username=yourusername -Dproxy.password=yourpassword -Dproxy.address=http://yourproxyserver:80 -Dproxy.domain=yourproxydomain

4. Run the automation

Run the automation using the run configuration from the previous step.
If your run configuration contains browser based scenarios, then you should see your chosen web browser open and run a few example scenarios.

Your IDE should have log output throughout the automation run. You should see be able to see information regarding service calls in the output.

5. Viewing reports

The reports should be available in your projects target/afor folder.
The reports show high level information at the top of the report, with in depth details further down.

The reports can be stored as artifacts in your continuous integration server. Within your development team, these reports can be used as part of your dashboards Take a look at the reports page to view some samples of reports.


Next steps

Now that you have completed the basic automation run, you can continue to install for the mobile automation.