Open kavimukh opened 11 months ago
What version are you using?
@wakaleo 4.0.14 Thanks
I can't see anything special in the code you have provided. If it is executing multiple times it is most likely an error in the Maven configuration, or possibly a duplicated runner class.
@wakaleo if I remove RunWith(CucumberWithSerenity.class) then it's running once. Apart from that if I run by using this command
I am using this version of Serenity - 4.0.14
mvn clean verify -Dtest=DesktopTestSuite -Denvironment=chrome_webdriver at that time I am getting following error
08:05:57.440 [main] WARN n.s.m.b.PropertyBasedDriverCapabilityRecord - Failed to store browser configuration for {goog:chromeOptions={args=[--remote-allow-origins=*, --start-maximized, --test-type, --no-sandbox, --ignore-certificate-errors, --disable-popup-blocking, --disable-default-apps, --disable-extensions-file-access-check, --incognito, --disable-infobars,--disable-gpu], extensions=[]}, acceptInsecureCerts=false, browserName=chrome}
java.io.FileNotFoundException: /Users/harry/myproject-automation/web-automation-testing/target/site/serenity/browser-chrome.properties (No such file or directory)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
at java.base/java.io.FileOutputStream.
What does your class look like when you remove the RunWith?
This is suite file
https://github.com/RunWith(CucumberWithSerenity.class)
@CucumberOptions(
plugin = {"pretty"},
features = "src/test/resources/features/geo-IP-modal/"
)
public class GeoTestSuite {
}
Scenario Outline: Validate Geo IP Modal QB Online Page
Given Page <URL> is loaded
===
@Given("Page {word} is loaded")
public void pageURLIsLoaded(String pageURL) throws MalformedURLException {
System.out.println("Navigating to => "+pageURL);
commonActions.navigateTo(pageURL);
}
===
public void navigateTo(String goToURL) throws MalformedURLException {
getDriver().navigate().to(goToURL);
untilPageReadyState(getDriver(), Duration.ofSeconds(3));
}
===
This is my serenity.conf file
chrome_webdriver {
webdriver {
driver = chrome
}
headless.mode = false
#
# Chrome options can be defined using the chrome.switches property
#
chrome.switches = """--remote-allow-origins=*;--start-maximized;--test-type;--no-sandbox;--ignore-certificate-errors;--disable-popup-blocking;--disable-default-apps;--disable-extensions-file-access-check;--incognito;--disable-infobars,--disable-gpu"""
}
When I execute given tag it work but when I give suite name getting error and executing all test suite. mvn clean verify -Denvironment=chrome_webdriver -Dtags=@mytesttag
You may have a duplicated runner somewhere in your code base.
I am also having same issue now fyi @wakaleo . did you find any resolution @kavimukh. every test running twice
I am also having same issue now fyi @wakaleo . did you find any resolution @kavimukh. every test running twice
It will be related to your Maven or test runner setup. Serenity does not manage test executions - that is done by the testing frameworks (Cucumber or JUnit).
Thanks john! @wakaleo This is my mvn clean verify -Denvironment=“@@@@“ -Dcucumber.filter.tags="@test" serenity:aggregate
@wakaleo - In one feature file I do have two test, i wanted to run only one test through IDE (eclipse), run as 1 cucumber feature , giving a tag @test1 and also used same tag in runner class @test1. for case of 1 cucumber feature both tests were running but in report it says one test ran. And through runner class for @test1, it is running all test cases in my project directory. please advise me what dependencies or plug in need to install !
Please ask any general questions that are not related to the original post in the Discussions section.
@here- Finally all issues got resolved, parallel in four node, no test running twice. Had to browse a lot and making a combination of different solution, using different version of all jars, with Serenity 4.0.18, Junit5. Thank you everyone for sharing all ideas
Hello,
I have following
== Feature file @RunWith(CucumberWithSerenity.class) @CucumberOptions( plugin = {"pretty"}, features = "src/test/resources/features/geo-IP-modal/" ) public class GeoTestSuite { }
==== When I try to run mvn clean verify -Denvironment=chrome_webdriver -Dtags=@mytesttag it run all test 2 times
if I remove @RunWith(CucumberWithSerenity.class) from Feature file then it's running once.