Thucydides+JBehave debug using Maven and IntelliJ IDEA

1,920 views
Skip to first unread message

Stanislav Khotinok

unread,
Sep 11, 2013, 10:00:26 AM9/11/13
to thucydid...@googlegroups.com
Hi guys,

can somebody help me how to debug Thucydides + JBehave using Maven?

So, what I'm doing:

1. In the terminal I go to pom.xml folder

2. I run this command:
export MAVEN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8787 -Xnoagent -Djava.compiler=NONE"

3. Then I run this one:
mvn clean install -Dwebdriver.driver=firefox -Dwebdriver.base.url=http://testsite.com -Dmetafilter="+suite suiteName -skip" -Dthucydides.take.screenshots=FOR_FAILURES -Dthucydides.activate.firebugs=true

4. Then I see the message:
Listening for transport dt_socket at address: 8787

So at this moment tests are hanging and waiting for debugger.

5. In IntelliJ IDEA I've added the remote debug configuration, pointing to the localhost and port 8787

6. I add proper breakpoints and I select this Remote Debug configuration in the IntelliJ IDEA and click Debug button

7. In IntelliJ IDEA I see the message:
Connected to the target VM, address: 'localhost:8787', transport: 'socket'

8. In terminal the tests continue execution but they don't stop on any breakpoint. And they finish successfully.

9. In the end I see in IntelliJ IDEA message:
Connected to the target VM, address: 'localhost:8787', transport: 'socket'

I've know there is way to click in the IntelliJ IDEA on the AcceptanceTestSuite and then run Debug, but then you will execute all JBehave stories. In my case when I run tests through maven I'm also transferring additional parameters, so I'm able to run exact Jbehave story via Meta tag.

John Smart

unread,
Sep 12, 2013, 1:30:55 AM9/12/13
to Stanislav Khotinok, thucydid...@googlegroups.com
To run an individual JBehave story (e.g. my_cool_feature.story), just create a class with the same name as the story file, but in camel case (MyCoolFeature.java). Make it extend ThucydidesJUnitStory. When you run this class in IntelliJ it will run the my_cool_feature.story only.


--
You received this message because you are subscribed to the Google Groups "Thucydides Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send an email to thucydid...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
___________________________________________________
John Smart | Wakaleo Consulting  |  +61 407 247 642
Optimizing your software development process
http://www.wakaleo.com  |  john....@wakaleo.com
___________________________________________________

Check out our upcoming BDD/TDD Master classes, coming 
___________________________________________________

Stanislav Khotinok

unread,
Sep 12, 2013, 1:57:08 AM9/12/13
to thucydid...@googlegroups.com, Stanislav Khotinok
Thanks a lot! Works perfect!

Sergey Filin

unread,
Apr 3, 2014, 3:21:43 AM4/3/14
to thucydid...@googlegroups.com
Hi,

You should set forkCount=0 for maven-failsafe-plugin in your pom.xml
Reply all
Reply to author
Forward
0 new messages