Avatar billede fredand Forsker
27. marts 2017 - 15:32 Der er 3 kommentarer og
1 løsning

How to run Cucumber with Eclipse

Hello!

I got a cucumber a scenario for a feature that I would like to run from Eclipse (Mars).

But when I run it like JUnit (perhaps that is wrong, but it almost works) the progress bar turns gray at "When" and the test seems to be stopped even though it runs through the whole scenario. Please see this image:
https://snag.gy/emL9o8.jpg

When I run it from maven it works fine.

Since it is displayed with the feature and all in eclipse I guess it should be executed like this. But why does it stops and turn gray at "When"?

Best regards
Fredrik
Avatar billede arne_v Ekspert
28. marts 2017 - 01:27 #1
Do you use the cucumber eclipse plugin.
Avatar billede fredand Forsker
28. marts 2017 - 07:47 #2
Hello!
I will try it at once!
But is it not strange that the built in JUnit almost manage to run it?
Best regards
Fredrik
Avatar billede fredand Forsker
28. marts 2017 - 08:23 #3
Hello!

Yes, I think this is the way to run it.
But I would have hoped for a more JUnit-like output/feedback.
It seems like it juts give some fail-output in the eclipse built it console when it fails. When it success it gives no feedback at all.
Best regards
Fredrik
Avatar billede fredand Forsker
31. marts 2017 - 22:39 #4
I had some more problem when I added more scenarios in the same feature-file
It turned out to be:

1) From my test I executed code from within my app that called System.exit.
Then I got a:
The forked VM terminated without saying properly goodbye. VM crash or System.exit called?
The solution for this seems just not to test that part.

2) I change my tests to test when the user cancel exit instead. But the test did not get on to the next scenario, the reason for that was that I did not know that I could clean up before next scenario took place. I fixed this by adding a:
@After
public void after() throws Throwable
{ exitApplicationSupport.cleanUp(); }

..and in cleanUp() i called:

frameFixture.cleanUp();

Perhaps this helps someone else.

Best regards
Fredrik
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester