behat / docs Goto Github PK
View Code? Open in Web Editor NEWBehat documentation repository
Home Page: http://behat.org
Behat documentation repository
Home Page: http://behat.org
Hi,
I wanted to know if you are interested in a documentation about writing a custom formatter ?
I did implement one myself, but I think there is no such documentation out in the wild, so I had a really hard time implementing it.
I tried to sum-up everything I learned in a blog post that I wrote here : https://julien.deniau.me/posts/2024-01-24-custom-behat-formatter
If you are interested, i am willing to adapt this blog post to integrate in the official documentation.
Thank you
On the "steps" section
"Robert C. Martin has written a great post about BDD's Given-When-Then concept where he thinks of them as a finite state machine."
There is linking to the post but the link is dead, please fix it if you could find the correct link anywhere, I did find some but not sure if they are the correct one.
https://sites.google.com/site/unclebobconsultingllc/the-truth-about-bdd
2x icons are already there in img
folder.
The documentation shows how to filter out one tag :
default:
gherkin:
filters:
tags: ~@mytag
Now when I try to use an array as a value for tags
, I get an error saying tags
should be scalar. But it has an s, so I think it should allow arrays too… can't find the correct syntax though.
That's not related to the code but the website is not accessible through HTTPS:
I discovered it while changing some links from HTTP from HTTPS. You may have never promoted the https://behat.org/ but having a error is surprising though.
Here is the report from Firefox:
behat.org uses an invalid security certificate.
The certificate is only valid for the following names:
*.readthedocs.org, readthedocs.orgError code: SSL_ERROR_BAD_CERT_DOMAIN
Hi guys,
I've been thinking over and over again on the structure of the documentation for Behat 3.X. I've noticed that the structure of the documentation of 2.X is rather a bit "weird". Please do not take this as any offense, I'm trying to help here! ;-)
I've been checking a lot of different documentation spaces on readthedocs.org and I found that the documentation of phpspec looks very structured and is easy to read as well (http://www.phpspec.net/en/latest/manual/introduction.html). What do you think about re-structuring the documentation of Behat 3.X?
Again; this is a suggestion in order to improve the documentation and I'm willing to work on this.
I'd like to have your thoughts on this one.
The default version is configured as being 2.5 currently, making http://docs.behat.org
redirect to the 2.5 rather than the latest. Is it expected ?
In this documentation page https://behat.org/en/latest/user_guide/configuration/suites.html#suite-paths, sais that suites path should be declared as:
- %paths.base%/features
but this will throw the following error :
The reserved indicator "%" cannot start a plain scalar; you need to quote the scalar at line 9 (near "- %paths.base%/features/register").
Quotes should be used, like this:
- "%paths.base%/features"
I used Symfony5 with Friends-of-Behat
Hello. Thank you for the continually excellent documentation.
Should line 269 in the Quick Start documentation read:
Finally, we get to the automation part.
Rather than:
Finally, we got to the automation part.
Ref:
https://github.com/Behat/docs/blame/v3.0/quick_start.rst#L269
If it was not an intentional use of the word "got", I can submit a pull request to change it, if you'd like.
See https://readthedocs.org/builds/behat/1368035/ for the logs
I think the doc should be changed somehow, as now it's a bit misleading IMO. Here: https://github.com/Behat/docs/blob/v2.5/quick_intro.rst when we have only Scenario1 then after running behat we'll end with such file structure:
test/
test/foo
test/bar
That's fine.
When we add Scenario2 it's now run from the 'test' directory, where it creates another 'test' subdirectory, so we'll have something like:
test/
test/foo
test/bar
test/test/.bar
test/test/foo
When run for the first time all test are passing ok. But if we run behat once again Scenario1 will fail, as the content of the top level 'test' directory is no longer 2 files (foo & bar), but also a 'test' subdirectory.
On this page http://behat.readthedocs.org/en/latest/guides/4.contexts.html#multiple-contexts
Links are not correctly formatted as you can see profiles /guides/6.profiles and guides/5.suites
Same issues on this page http://behat.readthedocs.org/en/latest/guides/5.suites.html
Make docs viewable on mobile/tablet
Problem:
In order to parse the docs one must go back and forth from the index page to the different documentation pages.
Solution:
If we add a top-level navigation item, it will be easier for folks to move between documentation regardless of where they are
The Symfony doc team did a great job at configuring Travis to run a sphinx build to ensure the syntax is valid without waiting for the online rendering (for which build error may not be public for everyone, especially after we move from ReadTheDocs to a new behat.org website). Do you think we should enable it @everzet ?
FYI, the config is at https://github.com/symfony/symfony-docs/blob/master/.travis.yml
Hi guys!
Go here: http://behat.readthedocs.org/en/v2.5/guides/7.config.html and check out the page title.
I was purposefully looking for the 3.x version of this page on Google, and when I saw this in the search results, I thought I had it! After getting some errors, I realized I was on the 2.5 version :).
Thanks!
Hello there,
I'd like to drop a suggestion on definition browsing usage with the command line.
I'm always forgetting how to use the -d
argument of the behat
command.
How would you like to have a chapter/section/note about that on the documentation (I don't know if this usage has changed with v3?)?
I could even manage to do it.
Hello,
it could be very helpful to have some notes on injection dependencies, the container helper related to it for the extension and perhaps some docs about extension developments.
thanks
The link to the Behat and Mink cheat sheet in http://behat.org/en/latest/useful_resources.html points to a not found page.
The link is: http://blog.lepine.pro/wp-content/uploads/2012/03/behat-cheat-sheet-en.pdf
I'm not sure if this qualifies as a useful resource or not but it covers integrating Behat and Laravel 7 along with some other challenges.
https://ambitonline.com/nextrelease/2020/06/laravel-7-behat-mink-bdd-netbeans-12-and-subdomain-testing/
On the quick start page (https://docs.behat.org/en/latest/quick_start.html), there's a link labeled "What’s in a Story?" with an href of http://blog.dannorth.net/whats-in-a-story/. This URL is no longer valid; the article in question can now be found at https://dannorth.net/whats-in-a-story/.
To start with: http://behat.readthedocs.org/en/latest/index.html looks way better then the http://behat.org/
Thanks and I will continu reading :p
ReadTheDocs provides a github hook allowing to rebuild the doc automatically when a commit is pushed to master. It could be great to enable it (even if ReadTheDocs is only meant as a temporary solution waiting ofr the new website, it may help contributors to see the latest doc rendered online rather than an older one)
"Step definitions are just normal PHP methods. They are instance methods in a special class called Feature:doc:Context</guides/4.contexts>. This class can be easily created by running behat with the --init command from your project's directory:"
Link was not properly created.
On this part https://github.com/Behat/docs/blob/master/guides/1.gherkin.rst#tables example has
/**
* @Given the following people exist:
*/
public function thePeopleExist(TableNode $table)
{
foreach ($hash as $row) {
// $row['name'], $row['email'], $row['phone']
}
}
shouldnt that $hash be $table ?
I am following the BDD examples on Quick guide and I ran into some errors this is what my composer.json looks like
{
"require-dev": {
"behat/behat": "^3.5",
"phpunit/phpunit": "^8.0"
}
}
Code sample from quick start page
<?php
// features/bootstrap/FeatureContext.php
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
class FeatureContext implements SnippetAcceptingContext
{
private $shelf;
private $basket;
public function __construct()
{
$this->shelf = new Shelf();
$this->basket = new Basket($this->shelf);
}
/**
* @Given there is a :product, which costs £:price
*/
public function thereIsAWhichCostsPs($product, $price)
{
$this->shelf->setProductPrice($product, floatval($price));
}
/**
* @When I add the :product to the basket
*/
public function iAddTheToTheBasket($product)
{
$this->basket->addProduct($product);
}
/**
* @Then I should have :count product(s) in the basket
*/
public function iShouldHaveProductInTheBasket($count)
{
PHPUnit_Framework_Assert::assertCount(
intval($count),
$this->basket
);
}
/**
* @Then the overall basket price should be £:price
*/
public function theOverallBasketPriceShouldBePs($price)
{
PHPUnit_Framework_Assert::assertSame(
floatval($price),
$this->basket->getTotalPrice()
);
}
}
First error is Fatal error: Class 'PHPUnit_Framework_Assert' not found (Behat\Testwork\Call\Exception\FatalThrowableError)
This is the case because PHPUnit_Framework_Assert
used in method theOverallBasketPriceShouldBePs
and else where is not defined or imported, this can be solved by adding the line
use PHPUnit\Framework\Assert as PHPUnit_Framework_Assert;
Just below the import statements
I would like to work on this issue if it is confirmed
Note I installed PHPUnit with composer require --dev phpunit/phpunit
I might have a Portuguese resource, that could translate the documentation.
Would this be of benefit?
The example about accessing contexts from each other triggers:
Indeed, the method getContext()
is not necessarily present in every possible Environment
interface implementation since it is not declared in this interface. Actually it is declared in InitializedContextEnvironment
only.
The piece of code:
use Behat\Behat\Context\Context;
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
class FeatureContext implements Context
{
/** @var \Behat\MinkExtension\Context\MinkContext */
private $minkContext;
/** @BeforeScenario */
public function gatherContexts(BeforeScenarioScope $scope)
{
$environment = $scope->getEnvironment();
$this->minkContext = $environment->getContext('Behat\MinkExtension\Context\MinkContext');
}
}
This repo uses the old github service for the integration, which is shutdown.
We need to migrate to the webhook system.
@everzet could you either do it, or make me a maintainer on the RTD project so that I can do it ?
http://docs.behat.org/en/v2.5/cookbook/behat_and_mink.html
"behat/behat": "2.4.*@stable",
"behat/mink": "1.4.*@stable",
Is that still the recommendation?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.