Scenarios are getting executed multiple times when we use clean verify serenity:aggregate command

1,756 views
Skip to first unread message

Ramu Vairavan

unread,
Sep 16, 2016, 8:48:14 PM9/16/16
to Serenity BDD Users Group
All -
I know i must be doing something wrong here. But unable to figure out.
When i run a feature file with 2 scenarios using "clean verify serenity:aggregate" command it runs the scenarios one after the other and again it runs the same scenarios once more.
When i do the same with "clean test" command, it executes them only once. Attached are the console output of each.

Not sure what i am doing wrong. Let me know if you need any other details.

Any help would be appreciated!!

Thanks
Ramu.
clean_test.txt
clean_verify_serenity_aggregate.txt

Zuhair Mukry

unread,
Sep 19, 2016, 1:54:25 AM9/19/16
to Serenity BDD Users Group
Hi Ramu,
There are two Maven Plugins which are used for Test execution.

Surefire Plugin - Normally used for executing unit tests.
Failsafe Plugin - Normally used for executing Integration Tests 

The reason why the "clean verify serenity:aggregate" executes the test twice is that Maven first executes the Scenarios using Surefire Plugin and again executes the Scenarios using Failsafe plugin. This is confirmed from logs in the clean_verify_serenity_aggregate.txt. 

[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ apttus-tests ---
[INFO] Surefire report directory: C:\Users\rxvaira\eclipse_workspace\apttus\ApttusTests\target\surefire-reports
.
.
.
[INFO] --- maven-failsafe-plugin:2.18.1:integration-test (default) @ apttus-tests ---
[INFO] Failsafe report directory: C:\Users\rxvaira\eclipse_workspace\apttus\ApttusTests\target\failsafe-reports

To avoid that the scenarios are run twice when executing "clean verify serenity:aggregate" you have to add following configuration in your pom.xml file. One downside will be there that now you will not be able to execute test using "clean test" command as the scenarios are skipped for surefire plugin. 

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<skip>true</skip>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>


Reply all
Reply to author
Forward
0 new messages