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

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 .api.CucumberOptions;
import .api.junit.;
import org.junit.runner.RunWith;

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

public class MOS_Run_All {
}

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



Source link https://sqa.stackexchange.com/questions/34904/runners-for-cucumber-tests

LEAVE A REPLY

Please enter your comment!
Please enter your name here