yatspec and WebDriver

60 views
Skip to first unread message

Usman Hussain

unread,
Sep 19, 2011, 9:45:21 AM9/19/11
to yatspec
Hi Guys,

There a few of us at my company who are evaluating some tools for our
acceptance tests and later on for our Functional (GUI) tests.

I have come across YatSpec and it sounded interesting but there
doesn't seem to be a lot of examples or support floating around.

I have some questions which I would appreciate someone helping me
answer.
What we need is a tool which would document our tests (something like
cucumber's given when then statements). I have seen that YatSpec
supports this but am yet to find any examples outlining and showing
how it is produced and what it looks like.
We are using Java to write our tests. The Acceptance tests will be
written with JUnit and the GUI tests would use the WebDriver or
Selenium API along with Java.

So the first question is, are there any examples of given when then
statements with JUnit using YatSpec.
and the next question is. Does YatSpec support WebDriver, so can
WebDriver be integrated with YatSpec?

I look forward to hearing from you. Thanks in advance...

Kind regards,
Usman Hussain

Daniel Worthington-Bodart

unread,
Sep 19, 2011, 9:59:24 AM9/19/11
to yat...@googlegroups.com
This test is a very simple example of the given when then support:


This produces:



We use WebDriver/Selenium/HtmlUnit and Yatspec on a number of different projects, the general principle is to just add the request and response into the captured inputs and outputs (seen on line 69 in SpecificationExampleTest.java). And maybe some values into interesting givens if you want them to be highlighted in the html report

You can literally put anything you want in any of the "given", "when", "then" blocks, be it HttpClient, WebDriver, Url or even database calls.

Yatspec really is a pretty simple extension to JUnit with a little bit of syntactic sugar here and there. Probably the most advanced feature is creating Sequence diagrams based on interactions. see: http://code.google.com/p/yatspec/source/browse/test/com/googlecode/yatspec/junit/SequenceDiagramingExampleTest.java

Kind regards

Dan

Usman Hussain

unread,
Sep 19, 2011, 10:08:01 AM9/19/11
to yatspec

Hey Dan,

Thank you very much for the quick response...
I will take a look at the information provided and will let you know
how I get on.

Kind regards,
Usman Hussain


On Sep 19, 2:59 pm, Daniel Worthington-Bodart <d...@bodar.com> wrote:
> This test is a very simple example of the given when then support:
>
> http://code.google.com/p/yatspec/source/browse/test/com/googlecode/ya...
>
> This produces:
>
> http://yatspec.googlecode.com/files/example.html
>
> We use WebDriver/Selenium/HtmlUnit and Yatspec on a number of different
> projects, the general principle is to just add the request and response into
> the captured inputs and outputs (seen on line 69 in
> SpecificationExampleTest.java<http://code.google.com/p/yatspec/source/browse/test/com/googlecode/ya...>).
> And maybe some values into interesting givens if you want them to be
> highlighted in the html report
>
> You can literally put anything you want in any of the "given", "when",
> "then" blocks, be it HttpClient, WebDriver, Url or even database calls.
>
> Yatspec really is a pretty simple extension to JUnit with a little bit of
> syntactic sugar here and there. Probably the most advanced feature is
> creating Sequence diagrams based on interactions. see:http://code.google.com/p/yatspec/source/browse/test/com/googlecode/ya...
>
> Kind regards
>
> Dan
Reply all
Reply to author
Forward
0 new messages