Why can't I see the abandoned exceptions in the cucumber "Around"?

I have a set of cucumber tests that run on the build server.

I often need faster feedback than the server itself, and therefore I look at the console output when it starts. I wanted to find a way to identify any failed test with one search term, so I changed our Around to print โ€œFailed Testโ€ anyway, but Ruby does not seem to pass the exception back. I checked this by putting instructions after the start ... end.

Does anyone know why this is happening, or a way to wrap up any exception caused by a failed test at startup?

Around() do |scenario, block| begin Timeout.timeout(0.1) do block.call end rescue Timeout::Error => e puts "Failed Test" puts caller rescue Exception => e puts "Failed Test" raise e end end 
+4
source share
2 answers

Have you tried disabling the Cucumber exception exception with the @ allow-rescue tag?

@ allow-rescue: Disables the capture of cucumber exceptions for the marked script (s). Used when the code under test is expected to raise and handle exceptions.

https://github.com/cucumber/cucumber/wiki/Tags

0
source

Looking at cucumber 1.3.12, it actually saves any exceptions to the scenarios. Thus, you cannot see them in any way without changing the cucumber pearl.

See my answer on how to put a debug hook in this place for more information: fooobar.com/questions/804659 / ...

0
source

Source: https://habr.com/ru/post/1385008/


All Articles