pytest-dev / pytest-bdd

BDD library for the pytest runner
https://pytest-bdd.readthedocs.io/en/latest/
MIT License
1.31k stars 220 forks source link

Simpler README example #208

Closed jtpereyda closed 7 years ago

jtpereyda commented 7 years ago

The first example on the README page requires another external library. I didn't look closely enough and spent a long time trying to figure out where all the fixtures were coming from.

I hit this issue last time I spun up with pytest-bdd. I think an initial README example that doesn't require external libraries might be better for initial understanding.

Of course, on the other hand, the front page example is really cool in what it can do.

bubenkoff commented 7 years ago

From readme

An example test for a blog hosting software could look like this. Note that pytest-splinter is used to get the browser fixture.
bubenkoff commented 7 years ago

Thing is, without the browser we eliminate whole class of the tests to be used in examples

jtpereyda commented 7 years ago

Yeah, like I said I didn't look closely enough...

Hmm, yeah, I don't have any concrete suggestions or I might have posted one. The problem from my noob perspective right now is that I can't apply the example to my own scenario, because the example requires fixtures, but it doesn't show me how to make fixtures. My guess is the README shows me how to do that a little bit later, but it's kind of hard for me to skim for the relevant section, since everything is building on the splinter library which I don't think is a real prerequisite.

So it'd be perfect if I wanted to use splinter or already understood it...

bubenkoff commented 7 years ago

this plugin indeed implies that you know basics of the pytest, so i would suggest starting from that

jtpereyda commented 7 years ago

I have indeed used pytest a decent amount, though maybe I never learned some key features. Does pytest-bdd require that you also know the basics of the pytest-splinter plugin?

bubenkoff commented 7 years ago

no, it's just examples use it for browser manipulation you can use some other means - custom browser fixture, pytest-selenium, etc

bubenkoff commented 7 years ago

so back to the original problem, just install pytest-splinter and browser fixture will be provided by it, you don't have to do anything else. read about fixtures in general https://docs.pytest.org/en/latest/fixture.html

jtpereyda commented 7 years ago

I only mean to suggest that a first tutorial not dependent on other fixtures might be easier to understand. Of course it's not my call though.

bubenkoff commented 7 years ago

Let's wait for more issues like this