How to do "inheritance/reuse of implementation", "given/when/then listeners", "debug of separate stories" with easyb?

35 views
Skip to first unread message

Iakiv Kramarenko

unread,
Oct 16, 2013, 4:59:04 AM10/16/13
to easyb...@googlegroups.com
Hi,

Easyb is a nice alternative to JUnit/TestNG tests.... Because it's more readable and just 'easy':)

But what would I want to know, is how to:
1 Reuse some configuration in stories. E.g. while doing 'testng tests' I have some base clases with common 'preconditions'. How can I achieve the same with easyb?
2 Add some 'listeners' to easyb given/when/then sections. To add some actions depending on whether correspondent clause failed or passed. E.g. take a screenshot once some section failed.
3 Debug separate stories/scenarios from Intellij Idea (I did not find any good guide/howto on this)

Thanks,
Iakiv

Seshu Innamuri

unread,
Apr 8, 2014, 6:31:58 AM4/8/14
to easyb...@googlegroups.com
Hi Iakiv ,

I have the similar question. Have founf any solution to get screenshot for the failed steps?

Iakiv Kramarenko

unread,
Apr 8, 2014, 2:40:22 PM4/8/14
to easyb...@googlegroups.com
Hi Seshu,

I have found a workaround, though pretty good, maybe even better than I wanted.

I use Selenide as my Selenium wrapper library. So I asked its author to add "automatic sreenshots per each failed assert". And it was implemented in one of the previous versions.

That's was enough for me.



--
You received this message because you are subscribed to a topic in the Google Groups "Easyb Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/easyb-users/8AdI3-8axUI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to easyb-users...@googlegroups.com.
To post to this group, send email to easyb...@googlegroups.com.
Visit this group at http://groups.google.com/group/easyb-users.
For more options, visit https://groups.google.com/d/optout.

Seshu Innamuri

unread,
Apr 10, 2014, 2:40:03 AM4/10/14
to easyb...@googlegroups.com
Hi Iakiv,

Thanks for the Quick Replay. Let work similar way as you suggested. Once again thanks for the information.

Iakiv Kramarenko

unread,
Apr 10, 2014, 2:49:52 AM4/10/14
to easyb...@googlegroups.com
Selenide is great lib, but when using it with easyb, pay attention that Selenide has its own shouldBe/shouldNotBe/shouldHave (assert methods of SelenideElement)

So if you try to use them, their will be conflicts with easyb ones.

To workaround this, use only selenide's should or shouldNot. Easyb does not have such "asserts".  So no conflicts for you.

Then, in order to achieve more readable code, use some selenide "condition wrappers", like be(Condition) or have(Condition)

So you can write:

myButton().should(be(visible))
myField().should(have(value("Hello!")))

etc.
Reply all
Reply to author
Forward
0 new messages