These are chat archives for Behat/Behat

28th
Nov 2016
skyeunknown084
@skyeunknown084
Nov 28 2016 07:56
Hi Guys! I'm new to beHat. Can someone help me understand it in a basic and dummy way?
Who can give me an example? This behat is use to testing or QA testing am I right?
Ronaldo Drummond
@ronaldodrummond_twitter
Nov 28 2016 09:49
I think it can help you to start write some tests @skyeunknown084 take a look https://gist.github.com/mnapoli/5848556
Eduard Sukharev
@eduard-sukharev
Nov 28 2016 12:51
I've got a question about creating my own formatter extension
how do i get my extension parameters inside my formatter?
Eduard Sukharev
@eduard-sukharev
Nov 28 2016 12:59
or more specifically, for example i want config two formatters simultaneously

if i set it like this:

formatter:
    name: pretty,allure
    parameters:
        output: null,build-allure

as i would for other built-in behat formatters then my formatter is called setParameter with "output" and "null,build-allure"

how do i get only my formatter output value?
Eduard Sukharev
@eduard-sukharev
Nov 28 2016 15:36
it's Behat 2 formatter for Yandex Allure, it's barely tested and probably has arguable mapping from Gherkin to Allure, but i'm open for discussion
Steve Tooke
@tooky
Nov 28 2016 15:56
Can I use phpspec expectations from behat steps? /cc @ciaranmcnulty
Eduard Sukharev
@eduard-sukharev
Nov 28 2016 15:59
@tooky you mean like $this->getTitle()->shouldBeEqualTo("Star Wars");?
Steve Tooke
@tooky
Nov 28 2016 15:59
Yes, that sort of thing.
Eduard Sukharev
@eduard-sukharev
Nov 28 2016 16:00
behat has no asserts at all, so you'll actually HAVE TO use some kind of assertion mechanisms, be that PHPUnit assertions, PhpSpec or any other

so, when you write

Given I request "Star Wars" movie from IMDB
Then movie rating should be equal "5"

in your feature file, you'll have to tell Behat what to do on those steps

and you'll have to define steps within your PHP code and inside the step definition for the second sentence you should use some assertion
Steve Tooke
@tooky
Nov 28 2016 16:03
@eduard-sukharev yes understood. I should probably have asked in phpspec if there’s a way to reuse the expectations outside of phpspefc!
Eduard Sukharev
@eduard-sukharev
Nov 28 2016 16:03
and that assertion might be the phpspec one
Michael Hoppes
@MECU
Nov 28 2016 17:21
Is there a term, and hopefully a package, for allowing Behat text to be written by web users and then executed "on demand" or "on submit"? Looking to use the written language style not for testing, but for data validation or checking or business logic errors. Something like:
Given I have clicks from vertical
Then clicks should be less than leads
Eduard Sukharev
@eduard-sukharev
Nov 28 2016 17:40
well, it's all written in Gherkin and can probably be parsed by https://github.com/Behat/Gherkin
then i'd suppose you'd want to call whatever rules you'd want