serenity-bdd / serenity-cucumber-starter

A skeleton project for Serenity BDD and Cucumber JVM
Apache License 2.0
178 stars 280 forks source link

Once I add Manual tag in my feature file, the case that has step definitions is passed without executing #121

Open arjunpn1983 opened 12 months ago

wakaleo commented 12 months ago

I'm not clear on the problem you are encountering: if you mark a scenario as @manual, you are indicating that you do not want to run it as part of your automated tests, so it will not be executed.

nshiveg commented 12 months ago

Hi John,

I am also facing similar issue with the latest serenity. I have a running scenario which gets executed perfectly fine. the moment I add another scenario with manual tag. The running scenario will not get executed. The output will be having 1 pending and 1 passed. But the passed one is 0.2 seconds overall. Since it is not getting executed.

arjunpn1983 commented 12 months ago

When i execute one scenario with complete step definitions , my test runs as expected(Takes 14 secs). But once i add another scenario with @manual tag ,then the total execution time of both scenarios is 423ms (report snapshot attached.) One case passes(If i add assert fail then case fails also) and other one is listed as manual

Attaching Feature file :

Feature: Launch url

Scenario: Launching url Given User navigates to gmail url And User enters admin login credentials for user "username" and password "passwd" And User clicks on SIGN IN button

@manual Scenario: Launching urlpending Given User navigates to gmail url is pending And User enters admin login credentials And User clicks on SIGN IN button1

image

arjunpn1983 commented 12 months ago

My POM:

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>net.serenitybdd.starter</groupId>
<artifactId>cucumber-starter</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Sample Serenity BDD project using Cucumber</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <serenity.version>3.9.7</serenity.version>
    <junit-vintage-engine.version>5.9.3</junit-vintage-engine.version>
    <junit-platform-suite.version>1.9.3</junit-platform-suite.version>
    <cucumber-junit-platform-engine.version>7.2.3</cucumber-junit-platform-engine.version>
    <encoding>UTF-8</encoding>
    <tags></tags>
    <webdriver.base.url></webdriver.base.url>
</properties>
<dependencies>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-core</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-ensure</artifactId>
        <version>${serenity.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-launcher</artifactId>
        <version>${junit-platform-suite.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit-platform-engine</artifactId>
        <version>${cucumber-junit-platform-engine.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-suite</artifactId>
        <version>${junit-platform-suite.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>${junit-vintage-engine.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <version>${junit-vintage-engine.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.10</version>
    </dependency>
    <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>3.23.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
                <includes>
                    <include>**/*Test.java</include>
                    <include>**/Test*.java</include>
                    <include>**/*TestSuite.java</include>
                    <include>**/When*.java</include>
                </includes>
                <systemPropertyVariables>
                    <webdriver.base.url>${webdriver.base.url}</webdriver.base.url>
                </systemPropertyVariables>
                <parallel>classes</parallel>
                <parallel>methods</parallel>
                <useUnlimitedThreads>true</useUnlimitedThreads>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.serenity-bdd.maven.plugins</groupId>
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.version}</version>
            <configuration>
                <tags>${tags}</tags>
            </configuration>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

wakaleo commented 12 months ago

It seems to be a problem with the Cucumber parallel execution - @cliviu any ideas?

cliviu commented 12 months ago

Not sure now, I will have to take a look. Can you provide a small example to help me reproduce the problem?

cliviu commented 11 months ago

I cannot reproduce it with https://github.com/serenity-bdd/serenity-cucumber-starter/issues/121 and serenity version 3.9.7, all the tests are executed, even if I add a @Manual test

wakaleo commented 11 months ago

@cliviu they are all executed but they all get run in dry-run/suspended mode, so the actual steps don't get executed