1

I've reached the point now where we need to get my automated checks running as part of deployment scripts to act as regression tests.

I've not done this before and I'm thinking the way I currently run these tests is probably set up a bit wrong.

I'm wanting to get to the point where I can add a tag such as @smoketest to key features across different feature files and I want my runner class to then only run the ones marked @smoketest. At the moment I have a runner class for each component of my system. My structure is as below:

├───java
│   ├───Database
│   │
│   ├───Pages
│   │
│   └───stepdefs
│       │   Run_All.java
│       │
│       ├───MOPStepDefs
│       │       ADAWA_Run_All.java
│       │       DPL_Run_All.java
│       │       MOPStepDefs.java
│       │       MOP_Run_All.java
│       │
│       ├───MOSStepDefs
│       │       MOSStepDefs.java
│       │       MOS_Run_All.java
│       │       PAR_Run_All.java
│       │       RenewalApproachingPAR_Run_All.java
│       │
│       ├───OAStepDefs
│       │       OAStepDefs.java
│       │       OA_Run_All.java
│       │
│       └───TPOSStepDefs
│               TPOStepDefs.java
│               TPOS_Run_All.java
│
└───Resources
    ├───MOP Features
    │       ADAWADentalOnlinePayments.feature
    │       DPLDentalOnlinePayments.feature
    │       MemberOnlinePayments.feature
    │
    ├───MOS Features
    │       MemberOnlineService.feature
    │       PolicyAmendRequest.feature
    │       RenewalApproachingPAR.feature
    │
    ├───Online Apps
    │       OnlineApplications.feature
    │
    └───TPOS
            AllTPOS.feature

So I am able to run MOP_Run_All.java which will run the feature file MemberOnlineService.feature.

I also have a tag in the @Before method of the step def which states @Before("@AutomatedMOP,@AutomatedADAWADOS,@AutomatedDPLDOS")

My runner class for MOS_Run_All looks like this:

package stepdefs.MOSStepDefs;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.runner.RunWith;

@RunWith(Cucumber.class)
@CucumberOptions(
        plugin = {
                // "json:target/cucumber/wikipedia.json",
                "html:L:\\Online Framework\\Reporting\\wikipedia.html",
                "pretty"
        },
        features = "src\\test\\Resources\\MOS Features\\MemberOnlineService.feature",
        tags = {"~@Manual"}
)

public class MOS_Run_All {
}

I'm hoping someone can point me in the direction of an article on how to handle runners and more specifically how to have runners triggering smoke tests or tests to run the entire suite.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.