pytest-bdd
pytest-bdd copied to clipboard
Example table not picked by scenario outline
GOTO URL:
https://drive.google.com/drive/folders/1v3NOtvPeJm32QDrHnoCxKosgWjRUiTxD?usp=sharing
- download the folder
- Update the chrome driver as your browser and OS in the project dir
- come to feature file
- let it run like it is and see that the example table is picked with Type1
- Now uncomment the line which is commented
- issue: example table is not picked
@youtux can you please guide here
Please report the feature file content and explain what was expected to happen, and what happened instead. Sorry, but checking out projects is too time consuming.
Feature: Attribute validation
Scenario Outline: Verify as a User I am able to set valid device attributes
Given I login to application as a Monitor
And Configuration page loads
When I search for Required Device On Congiguration Page
And I set the "min" value for all the
Examples:
|sheetname |
|Type1 |
|Type2 |
|Type3 |
|Type4 |
|Type5 |
|Type6 |
|Type7 |
|Type8 |
|Type9 |
@youtux I have given # in quotes bcz # becomes heading for github comment Issue: Here if i comment my feature file line "Then I refresh the page" which occurs second time then scenario outline picks the example table but if i uncomment the line "Then I refresh the page" which occurs second time then scenario outline do not picks the example data table
step_def.py
from pytest_bdd import scenarios, given, when, then, scenario, parsers log_cli = True
login = None attribute = None device = None count = None
@scenario(feature_name='AttributeValidation.feature',scenario_name= 'Verify as a User I am able to set valid device attributes', features_base_dir='./Tests/Web/features/') def test_Verify_Attribute_value(browser): pass browser.quit()
@given("I login to application as a Monitor") def login_to_app(browser): print("login")
@when("I navigates to Devices page") def navigateToDevicePage(browser): print("navigateToDevicePage")
@given("Configuration page loads") def ConfigurationPageLoads(browser): print("ConfigurationPageLoads")
@when("I search for Required Device") def searchForRequiredDevice(browser): print("searchForRequiredDevice")
@when("I search for Required Device On Congiguration Page") def searchForRequiredDevice(browser): print("searchForRequiredDevice")
@when('I click on the attribute setting icon for the device') def clickOnConfigureAttributeSetting(browser): print("clickOnConfigureAttributeSetting")
@when('I should see the attribute configuration page') def verifyAttributePage(browser): print("verifyAttributePage")
@when(parsers.parse('I set the "{maxmin}" value for all the
@when('I refresh the page') @then('I refresh the page') def refreshPage(browser): print("refreshPage")
@when(parsers.parse('I select "{user}" in the Updated by field')) @then(parsers.parse('I select "{user}" in the Updated by field')) def selectUpdatedBy(browser, user): print("selectUpdatedBy")
@when(parsers.parse('I should see the "{maxmin}" value for
@then(parsers.parse('I should see the "{maxmin}" value for
@when(parsers.parse('I wait for "{value}" minutes')) @then(parsers.parse('I wait for "{value}" minutes')) def waitTime(browser, value): print("waitTime")
@then("I verify number of attribute not set") def verifyCount(browser): print("verifyCount")
@youtux updated the step def also plz have a look
you can embed your code in triple quotes, so that it will be properly formatted. Checkout the Markdown documentation: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting