feat: native pytest-bdd support#484
Merged
Merged
Conversation
… checkout scenarios
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
qase-pytest— no manualqase.step()instrumentation required@qase.id=,@qase.suite=,@qase.severity=,@qase.priority=,@qase.layer=,@qase.ignore,@qase.muted,@qase.project_id.CODE=qase.step()inside a step function attaches as a child of the Gherkin step (parent_id hierarchy)qase-python-commons;pytest-bdd>=7.0,<9.0is a testing extra, not a runtime dependencyArchitecture
qase.pytest.bdd(QasePytestBddPlugin) registered conditionally inconftest.pyonly whenpytest_bddis importablebefore/after_scenario,before/after_step,step_error,step_func_lookup_error) to existingRuntime.add_step()/finish_step()andResultfield mutationsparse_scenario_tags,format_data_table,format_docstring,build_step,enrich_result_from_scenarioTest plan
test_bdd_helpers.py)test_bdd_plugin.py— covers all 6 hooks including happy path, failure path, lookup error, skipped tail, ignore flag)qase.step(), scenario outline, DataTable + DocString, tags, ignore, coexistence with plain pytest)examples/single/pytest-bdd/against local report driver — JSON output verified end-to-endqase-pytestsuite: 100 passedKnown limitations / follow-ups
qase-python-commonsflattensStepGherkinDataintoStepTextData(action="<Keyword> <name>", input_data=table/docstring). TestOps API mode preserves native Gherkin structure; this only affects JSON-report inspection. Worth a separate PR in commons if rich JSON Gherkin shape is desired._pytest_bdd_exampleargument with a serialized dict. Individual columns (a,b,c) are not split — works correctly but the parameter name is opaque. Possible enhancement: parse and re-expose as separate Qase params.Customer reproduction
examples/single/pytest-bdd/reproduces the customer scenario from the original feature request — login.feature with 3 Gherkin steps, each containing a nestedqase.step(). Runpytest -vfrom that directory and inspectbuild/qase-report/results/*.jsonto see the full hierarchy.