top of page
Concrete

Introduction to a modern testing framework - Anax

  • Writer: Georgios Kogketsof
    Georgios Kogketsof
  • Dec 16, 2020
  • 2 min read

Updated: Feb 15, 2021


ree

Anax is a testing framework that closely resembles JUnit and TestNG. It does not depend on any of those and prefers to be launched as a standalone, spring boot application. Of course, you can always run Anax projects within your maven build.


Anax "under the hood" uses the following software:

  • SpringBoot

  • Selenium

Anax follows a long-established strategy for creating tests, based on the Page Objects methodology. In addition, Anax uses custom Annotations to remove any XML configuration or external testing framework dependencies. Finally, Anax uses maven modules to execute tests for Web-based apps, Desktop apps, API based tests, and Cross-browser testing.

The Anax design has various plugin points and the following plugins already exist:

  • Reporter plugins: Allure Reporter, Zephyr Reporter.

  • Video Recorder plugin: Video Recorder.

Anax Setup


The guide for setting up and using Anax will be based on IntelliJ, please feel free to use your preferred IDE.


Create a parent project

The first step is to create a new project in IntelliJ:

ree

Select maven and java SDK 1.8

ree

Select GroupId, ArtifactId, and Version

ree

Finalize

ree

Create a module for the runnable

On the newly created project right click and create a new module

ree

As before select maven and the same java SDK as the parent project

ree

On the next screen select ArtifactId (GroupId is already filled inherited from the parent project)

ree

As before finalize.

ree


Create a module for the test code

As in previous steps create a maven module for the test code

ree

Finalize module creation

ree

Parent Configuration

On the parent project, add Anax repository

<repositories>
    <repository>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <id>bintray-thanosa75-maven</id>
        <name>bintray</name>
        <url>https://dl.bintray.com/thanosa75/maven</url>
    </repository>
</repositories>

Chrome Runnable Configuration

<dependencies>
    <dependency>
        <groupId>org.anax.framework</groupId>
        <artifactId>anax-chrome</artifactId>
        <version>${anax.version}</version>
    </dependency>
    <dependency>
        <groupId>org.anax.framework</groupId>
        <artifactId>anax-allure</artifactId>
        <version>${anax.version}</version>
    </dependency>
    <dependency>
        <groupId>org.myOrg</groupId>
        <artifactId>myTestApp</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
</dependencies>

Create a main class with the following code

@SpringBootApplication(scanBasePackages = {"org.anax.framework"})
public class MainUi {
    public static void main(String[] args) {
        SpringApplication.run(MainUi.class);
    }
}


Test Case Configuration

<dependencies>
    <dependency>
        <groupId>org.anax.framework</groupId>
        <artifactId>anax-core</artifactId>
        <version>${anax.version}</version>
    </dependency>
</dependencies>

Provide access to selenium commands by injecting to the class

@Autowired
protected WebController controller;


Comments


bottom of page