Coder Social home page Coder Social logo

automationpanda / tau-pytest-bdd Goto Github PK

View Code? Open in Web Editor NEW
109.0 16.0 128.0 59 KB

Test Automation University: Behavior-Driven Python with pytest-bdd

Home Page: https://testautomationu.applitools.com/behavior-driven-python-with-pytest-bdd/

License: Apache License 2.0

Python 70.19% Gherkin 29.81%
bdd pytest pytest-bdd python tau test-automation test-automation-university

tau-pytest-bdd's People

Contributors

andylpk247 avatar automationpanda avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tau-pytest-bdd's Issues

target_fixture='basket' doesn't seem to be working when introducing parametrize.

In Chapter 4 - Parametrizing Steps I seem to be having issues incorporating target_fixture='basket' to work alongside the changes.

Unsure if this is an issue, or because I am a total newbie and not quite grasped things all that well as yet.
I did have this working in the Chapter 3 Tutorials.

I am essentially stuck at 4 Mins 36 Seconds where you run the tests for the first time, are you able to confirm if this is an issue, or i am doing things incorrectly in the @given step.

Some variations I have tried:
@given(parsers.cfparse('the basket has "{initial:Number}" cucumbers', extra_types=dict(Number=int), target_fixture='basket')) def basket(initial): return CucumberBasket(initial_count=initial)

@given(parsers.cfparse('the basket has "{initial:Number}" cucumbers', target_fixture='basket' extra_types=dict(Number=int))) def basket(initial): return CucumberBasket(initial_count=initial)

After watching further into the video things change a bit, but the same doesn't seemingly work either
@given(parsers.cfparse('the basket has "{initial:Number}" cucumbers', target_fixture='basket', extra_types=EXTRA_TYPES)) def basket(initial): return CucumberBasket(initial_count=initial)

@given(parsers.cfparse('the basket has "{initial:Number}" cucumbers', extra_types=EXTRA_TYPES, target_fixture='basket')) def basket(initial): return CucumberBasket(initial_count=initial)

Hi sir

Can you guide me to do this project...

target_fixture now has to be explicitly defined

In the first example of 'given' there is no reference to target_fixture. In modern versions of pytest-bdd you have to state this:

@given("the basket has 2 cucumbers", target_fixture='basket')
def basket():
    return CucumberBasket(initial_count=2)

In the above example, without the target_fixture='basket', the test will fail saying that basket is not defined. Basically given decorators no longer automatically produce fixtures without specifically stating their name using the target.

It's a bit annoying to make the changes and I realise your guides, repos were based on a previous version, but seeing as you're basically THE go to resource on the internet for pytest-bdd learning, it would be very helpful for new learners, if you updated.

I don't want to do a PR because you have video content referencing the original syntax etc.

(BTW, thanks for the great content.)

Unable to run chapter 6 on Python 3.10 installed

When running rest API tests from chapter 6 there is an error that all tests are failed due to the second argument "example_converters" can't be found in scenarios function.
The same problem appears when completing this chapter by myself on my own training repo.
Error output log is attached.
Reproduced on:
Arch Linux
Python 3.10
pytest 7.1.2
pytest-bdd 6.0.1.
VSCode Insiders version 1.65.
error_output.log

TAU - Behavior Driven Python with pytest-bdd - Ch.7 - images

Hi Andrew,

I do not know if it is already mentioned but in TAU - Behavior Driven Python with pytest-bdd (https://testautomationu.applitools.com/behavior-driven-python-with-pytest-bdd/chapter7.html#test-web-steps-py) I see that the definition of files with the releated images in Transcripted Summary, Chapter 7, "test_web_steps.py" comes with the screenshot of "web.feature" and "web.feature" with the one of "test_web_steps.py". Please check.
issue_screenshot_2
issue_screenshot_1

Hope this is the right way to declare this issue. ( I am new in this :-) )

Best Regards,
Nikos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.