Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    senthil kumar
    @senthilkumar369
    i tried to see it is working or not but no luck
    for row in context.example:
        print(row)
    @given('a set of specific users{name}{department}')
    def TC_028_001(context,name,department):
    for row in context.example:
    print(row)
    i am getting an error that " AttributeError: 'Context' object has no attribute 'example'"
    senthil kumar
    @senthilkumar369
    please assist me
    this is for Behave BDD
    senthil kumar
    @senthilkumar369
    @mathewtrivett Are you able to get the rows from examples
    jenisys
    @jenisys
    The easiest way is to use the FileLocation (Schema: filename:line_number) with the line number of the row. For example: ˋfeatures/Alice.feature:123ˋ where ˋ123ˋ is the line number of the Examples row. Otherwise, use a row_id tag in the ScenarioOutline to select the Scenario for the Examples row by tag. See New and Noteworthy: ScenarioOutline Improvements and Appendix: Context Attributes — active_outline
    Hint: During runtime you normally do not see the ScenarioOutline only the generated Scenarios from it, one per Examples row.
    senthil kumar
    @senthilkumar369
    Thanks @jenisys , i will try and let you know
    senthil kumar
    @senthilkumar369
    Hi @ jenisys , I have examples which has 100 rows. is there anyway to read from external file?
    i can read from external file using python but cant write back to the desired step
    please advise
    jenisys
    @jenisys
    You can use behave @listfile.txt which reads the list of feature files of FileLocations from the textual file „listfile.txt“. But if you want to run all examples of a ScenarioOutline or the complete ScenarioOutline, why do you not use tags ? Your initial question was that you want to run one Example row in a ScenarioOutline.
    senthil kumar
    @senthilkumar369
    @jenisys Sorry it is my mistake. I wanted to ask about the data which is under Scenario outline examples. if my scenario outline's example contains 50 to 100 datas that should be tested. i am keeping all in a feature file.
    is there a way to read those parameters from csv or excel
    jenisys
    @jenisys
    @senthilkumar369
    Sorry, currently not. If you need this feature now, I would generate the feature files from a template (for example: Jinja) with the data from the CSV files. Otherwise, see: Github issues #636 (@table_generator.from_file mentioned). Note that by using so many example rows, you are using behave for system tests or integration tests (not for ATDD or BDD) ?!?
    senthil kumar
    @senthilkumar369
    @jenisys you are right however need to test different parameters. I know that it can be read through python however dont know how to write back to steps, so that i can see it on desired step
    Could you please tell me any ways
    jenisys
    @jenisys
    I have already told you my preferred solution.
    senthil kumar
    @senthilkumar369
    hI @jenisys , how to use "@table_generator.from_file" in my feature file. i have created a json file which has table column names . i want to pass it to my test script
    @at_028
    Scenario:Validate Parameter can be written with L1 key
    When TC_028 Authenticate with L1 KEY
    Then should be able to write Parameter
    @table_generator.from_file=L1_Parameters.json
    | Param_Name |MemoryAddress|Expected|
    senthil kumar
    @senthilkumar369
    i tried the above but not passing the values to the steps
    jenisys
    @jenisys
    @table_generator.from_file“ is an idea how this functionality can be provided. It still needs to be implemented.
    senthil kumar
    @senthilkumar369
    oh ok
    Vincent Bauchart
    @vbauchart
    Hi all, I need a so old PR from 2017 : behave/behave#591
    this PR is so small, is there any chance to merge it?
    We are using gitlab-CI and the colored output will help so much to read behave reports
    Weidong Sun
    @xiaoxianma
    I just open a new PR, do I need to add reviewers or it works as it is? behave/behave#774
    Milosz Mazur
    @_subtle_gitlab
    Hi there, any idea when can we expect 1.2.7 (or the next release, in any case)? I checked the milestones over at https://github.com/behave/behave/milestones, but it seems they're not up to date
    Erwin
    @ErwinBeen
    Hi guys, does any of you use a screenshot comparison library that works nicely with behave and python? I'm checking if in some steps I can compare certain elements on the page as well as full page comparisons
    Eduardo Mendes
    @dunossauro
    Hello everybody.
    Eduardo Mendes
    @dunossauro

    I'm think about extentions. Like pytest has with pluggy. Many projects has insane envrionment files.

    @jenisys, what we think about implement a plugin manager for hooks?

    I try explain my idea on this project https://github.com/dunossauro/hook_plug.

    Something like install plugins in hooks and inside de plugins you can implamente modules and then put context variables and execute routines in hooks

    Peter Bittner
    @bittner

    @ErwinBeen There is a "Visual Testing" section in the Practical Tips on Testing chapter of the documentation. This is not a direct answer to your question, but at least you can find some information there that may help you to dig further.

    Extending the docs, once you find something directly useful, is always welcome!

    Emiliano Heyns
    @retorquere
    How can I get a stack trace from failures in my hooks? Right now I'm getting HOOK-ERROR in before_all: AttributeError: 'Config' object has no attribute 'items' but no stack trace.
    jenisys
    @jenisys
    Use „—verbose „ option to get the stack-trace
    Emiliano Heyns
    @retorquere
    @jenisys thanks!
    Emiliano Heyns
    @retorquere
    I'm getting "ContextMaskWarning: user code is masking context attribute zotero; see the tutorial for what this means", but what tutorial is it referring to here?
    Griffin Obeid
    @griffinobeid
    Hello, All! I am experiencing an issue with the Junit formatter in which my skipped messages are not being captured in the report. Is this a known issue?
    Griffin Obeid
    @griffinobeid
    To clarify more, what I want is the string from the reason parameter in this function: scenario.skip(reason='My reason for skipping this test...')
    Emiliano Heyns
    @retorquere
    I need to do some expensive setup for my tests that I want to run only once. I've seen https://stackoverflow.com/questions/34126474/running-certain-steps-once-before-a-scenario-outline-python-behave, but is that still the only way to do this?
    jenisys
    @jenisys

    Regarding expansive Setup: Splitup the Setup in two Parts, First Part injects the Context attribute (via fixture and fixture-tag in before_feature or before_all hook), second part performs the setup when the Context attribute is actually used via Lazy-init (via a function call or property or ...). Therefore, you pay only for the setup if it is actually used by a step implementation or Python code. Problem: Other parts (Scenarios, Steps, Fixtures, ...) may partly destroy/modify your setup after it was performed and it may be hard to detect this case.

    Linked example has a flaw: The step implementation should not always power-up the board but just ensure that the board is in powered-up state.

    jenisys
    @jenisys
    Regarding expensive setup (Part 2): You can always meddle with the Context Stack to inject the Context attribute and cleanup at a deeper Level than you currently are (Feature Level instead of current scenario Level). But there, you are up on your own.
    Eduardo Mendes
    @dunossauro
    Hello everybody, behave has good first issues to hacktoberfest?