trivago / cucable-plugin

Maven plugin that simplifies running Cucumber scenarios in parallel.
Apache License 2.0
115 stars 42 forks source link

List Of Issues - Migrating to Cucable from teymers #126

Closed Naumansh closed 5 years ago

Naumansh commented 5 years ago

Hi,

I have been lodging my issues on this repository from last few days since i have been trying to migrate from teymers to cucable but the problems are not ending. So sharing a list of problems as below:

1- I am running the tests using maven (Pom configuration below) , However after execution of a test case i never see standard Cucumber console information of test completion which shows some thing like in GREEN (Screen shot attached of a regular execution with regular cucumber runners or teymers) 1 Scenarios (1 passed) 8 Steps (8 passed) 0m44.927 sec

392373C0

2- In continuation to above when the test execution completes it shows Incorrect maven information as: (See above screen shot of normal behaviour) Test run: 0 Failures: 0, Errors: 0

3- When I execute whole feature file or a certain suit, the cucumber json report is generated for only one test case instead of all the executed ones and same is then reflected in cluecumber report.

4- If <includeScenarioTags>${tags}</includeScenarioTags> is not used and we use cucumber expressions then an error log is displayed before start of test execution on console. As suggested by you earlier in https://github.com/trivago/cucable-plugin/issues/124 to disable it from failsafe but i tried various things but it never goes away. i would really appreciate if you can point out an exact property to be set off in failsafe if it is so.

Log is below:

[INFO] Running TestSuite [TestNG] [ERROR] No test suite found. Nothing to run Usage:

[options] The XML suite files to run Options: -configfailurepolicy Configuration failure policy (skip or continue) -d Output directory -dataproviderthreadcount Number of threads to use when running data providers -excludegroups Comma-separated list of group names to exclude -groups Comma-separated list of group names to be run -junit JUnit mode Default: false -listener List of .class files or list of class names implementing ITestListener or ISuiteListener -methods Comma separated of test methods Default: [] -methodselectors List of .class files or list of class names implementing IMethodSelector -mixed Mixed mode - autodetect the type of current test and run it with appropriate runner Default: false -objectfactory List of .class files or list of class names implementing ITestRunnerFactory -parallel Parallel mode (methods, tests or classes) Possible Values: [tests, methods, classes, instances, none, true, false] -port The port -reporter Extended configuration for custom report listener -suitename Default name of test suite, if not specified in suite definition file or source code -suitethreadpoolsize Size of the thread pool to use to run suites Default: 1 -testclass The list of test classes -testjar A jar file containing the tests -testname Default name of test, if not specified in suitedefinition file or source code -testnames The list of test names to run -testrunfactory, -testRunFactory The factory used to create tests -threadcount Number of threads to use when running tests in parallel -usedefaultlisteners Whether to use the default listeners Default: true -log, -verbose Level of verbosity -xmlpathinjar The full path to the xml file inside the jar file (only valid if -testjar was specified) Default: testng.xml

Configurations


        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven.failsafe.plugin.version}</version>
                <executions>
                    <execution>
                        <id>Run parallel tests</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <forkCount>${threads}</forkCount>
                    <reuseForks>false</reuseForks>
                    <testFailureIgnore>true</testFailureIgnore>
                    <disableXmlReport>true</disableXmlReport>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.trivago.rta</groupId>
                <artifactId>cucable-plugin</artifactId>
                <version>${cucable.version}</version>
                <executions>
                    <execution>
                        <id>generate-test-resources</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>parallel</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourceRunnerTemplateFile>src/test/resources/configuration/CustomCreator.java</sourceRunnerTemplateFile>
                    <sourceFeatures>src/test/resources/features</sourceFeatures>
                    <generatedFeatureDirectory>${generated.feature.directory}</generatedFeatureDirectory>
                    <generatedRunnerDirectory>${generated.runner.directory}</generatedRunnerDirectory>
                    <parallelizationMode>scenarios</parallelizationMode>
                    <includeScenarioTags>${tags}</includeScenarioTags>
                    <logLevel>off</logLevel>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${maven.build.helper.plugin.version}</version>
                <executions>
                    <execution>
                        <id>add-test-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${generated.runner.directory}</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.trivago.rta</groupId>
                <artifactId>cluecumber-report-plugin</artifactId>
                <version>${report.version}</version>
                <executions>
                    <execution>
                        <id>report</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>reporting</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourceJsonReportDirectory>${cucumber.report.json.location}</sourceJsonReportDirectory>
                    <generatedHtmlReportDirectory>${generated.report.location}</generatedHtmlReportDirectory>

                    <!-- Optional custom parameters file -->
                    <!--<customParametersFile>custom/custom.properties</customParametersFile>-->
                    <failScenariosOnPendingOrUndefinedSteps>true</failScenariosOnPendingOrUndefinedSteps>
                    <expandBeforeAfterHooks>true</expandBeforeAfterHooks>
                    <customCss>target/eyethink_css/custom.css</customCss>
                </configuration>
            </plugin>
        </plugins>
    </build>```
bischoffdev commented 5 years ago

Hello,

honestly, it is a little strange that you keep on posting the same issues multiple times. Once would be enough. This also makes it harder to tackle them individually. Another thing is that many of your issues are unrelated to Cucable itself but your test framework/setup. This is nothing I can really help with without having a complete project from you. Please make sure the Cucable example project is working for you before migrating production code to it. After that, ensure that the generated Cucable runners are correct and point to the correct features and have the right json file name in the Cucumber json plugin (this should be unique per ran scenario). The Maven output Test run: 0 Failures: 0, Errors: 0 is probably related to [TestNG] [ERROR] No test suite found. Nothing to run. But again, without a full example project, these are just shots in the dark.

Naumansh commented 5 years ago

Thanks for such helpful response. I will take care of it.