cucumber / cucumber-jvm

Cucumber for the JVM
https://cucumber.io
MIT License
2.7k stars 2.02k forks source link

Access published report URL programatically #2861

Closed johnsonkandul-github closed 6 months ago

johnsonkandul-github commented 6 months ago

Requirement -

I have maven java project integrated with selenium-testng-cucumber. I have a use case where i want capture dynamically generated cucumber.io report which looks like this - https://reports.cucumber.io/reports/a3b6bbca and send it in an email.

I run all selenium test using mvn test -with few parameters and the pom calls testng.xml file which calls the runner class.

Is there any way i can get hold of this generated via code like getURL() method which would give the latest URL after all tests are completed and i can send that email to my team via code. Please advise and help.

mpkorstanje commented 6 months ago

It is currently not possible to access this url programmatically. You'd have to grep your test output for it. Something like:

mvn test | tee log.txt
grep log.txt 'report.cucumber.io'

Do note that the online reports are provided by SmartBear. And while there is a market for commercial tools built for the Cucumber audience, that market probably isn’t big enough for a company like SmartBear. So I can not say what will happen next.

For context read https://mattwynne.net/new-beginning

Note: I'm not affiliated with SmartBear.