Selenide + Cucumber screenshots on success

126 views
Skip to first unread message

Čamo

unread,
Apr 8, 2021, 4:03:21 PM4/8/21
to selenide
I have a problem with screenshots on success. Test run as Cucumber test and I have a @Rule implementation according documentation which looks like: 


@Rule
public ScreenShooter makeScreenshotOnFailure = ScreenShooter.failedTests().succeededTests();

But it does not work. It makes screenshot on failure but not on success. Does anybody know if it is possible?

Andrei Solntsev

unread,
Apr 8, 2021, 4:41:10 PM4/8/21
to Čamo, selenide
I heard that Cucumber doesn't support JUnit4 rules. 

Why do people use Cucumber?...

I guess you need to create your own rules/listener/extension/ whatever mechanism Cucumber provides. 

Andrei Solntsev


чт, 8 апр. 2021 г. в 23:03, Čamo <vladimi...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "selenide" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenide+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenide/e2e185e2-903e-453e-b6d6-b3f209d75f80n%40googlegroups.com.

Čamo

unread,
Apr 8, 2021, 5:19:08 PM4/8/21
to selenide
I fix it. Cucumber can do it via @After hook which has to make screenshot. 

PS: Cucumber has better integration with Jenkins as other solutions like on screenshot. 

Dátum: štvrtok 8. apríla 2021, čas: 22:41:10 UTC+2, odosielateľ: andrei....@gmail.com
Screenshot (375).png
Reply all
Reply to author
Forward
0 new messages