Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Krzysztof Wozniak
    @Hejvi
    Hello, I am wondering whether is possible to change/expand in a fly the tag name? For example: I run tests from the command line using --tags @xyz but I want to run under the hood the @a.name.1 @b.name.2 and @c.group.1.
    Krzysztof Wozniak
    @Hejvi

    Hi everyone, is there a way to reuse a step definition when that step is used in the feature files as both Given and Then?

    Exact same step, just used as a Given in one feature, and as a Then in another feature, so they resolve to different step definitions, can I make them resolve to the same definition, so that I reuse my step?

    Thanks a lot in advance :)

    If I understand correctly, you can also use @step in your decorator instead of @given / @then

    jenisys
    @jenisys
    @Hejvi Regarding replacing the tags or tag-expression: No that is not (easily) possible.
    Could you explain why you actually need such a feature/functionality?
    @Hejvi With the newer tag-expression syntax (current tip of the repository), you could state: —tags=„@*.name.* or @c.group.1“ (or: and, if that is intended)
    Krzysztof Wozniak
    @Hejvi
    @jenisys I already use tag-expression syntax for tag name/group. Let's say I would like to run over a dozen tags from different feature files including only specific cases from the scenario outlines. That's why I am looking for a way to run over a dozen tags like (x.name.1, y.name.2, z.group.1) using only a single tag.
    Krzysztof Wozniak
    @Hejvi
    Oh, I noticed that I can tag only Examples instead of whole Scenario which probably solves my problem :)
    jenisys
    @jenisys
    @Hejvi I assume it is not possible to add that one tag that your looking for to the Features/Scenarios/Example to select that „set of interest“ ?! Tags are normally just used like that. If you really need such a large number of tags is best solved by a level of indirection, a „build system“ that does just what you want. Otherwise, you could just use „at-files“, a textual file with file locations, like: behave @testsuite_1.txt. But file locations are in general more brittle than tags. A file location has the scheme: <FILENAME>:<LINE_NUMBER> to select its scenario(s) or ScenarioOutline example row.
    Krzysztof Wozniak
    @Hejvi
    @jenisys Thank you. Do you have somewhere an example of the implementation of textual files?
    Krzysztof Wozniak
    @Hejvi
    thanks!
    Krzysztof Wozniak
    @Hejvi
    Hello, I am trying to find a way to parameterize the fixture-tag. I have found behave/behave#899 but looks like the source for "here" is missing? @jenisys
    jenisys
    @jenisys
    @Hejvi That was a clarification statement and not „here is an example“. Parametrized tags as suggested by #899 will require that parsing of tags will be more complex. Currently, tags are basically words separated by whitespace.
    Krzysztof Wozniak
    @Hejvi
    My mistake, thanks
    Krzysztof Wozniak
    @Hejvi

    Hello, is there a way to put table keys as the first column instead of the header? Like:

    | KMSY | Louis Armstrong New Orleans International Airport |
    | KSFO | San Francisco International Airport |
    | KSEA | Seattle–Tacoma International Airport |
    | KJFK | John F. Kennedy International Airport |

    jenisys
    @jenisys
    @Hejvi I assume you want to use it as DataTable for a step !?!
    Currently, this is not directly supported.
    The Gherkin parser stores it in a behave.model.Table which currently expects column headers. Your step would need to transform/transpose the table into your format (a property-table view). This can be done by a helper/utility function in your step or by a step-decorator that performs the same work.
    VamshiKrishnaUM
    @VamshiKrishnaUM
    Hello,
    Hello, is there a way to find which tag invoked current scenario in "after_scenario" hook ?
    jenisys
    @jenisys
    @VamshiKrishnaUM You mean which tags a scenario has ?
    VamshiKrishnaUM
    @VamshiKrishnaUM
    No, like which tag has triggered the current scenario.
    Eg: behave something.feature --tags @first
    Incase my_scenario is tagged with @first @second @third
    jenisys
    @jenisys
    Tags trigger no scenario. They are only used to select or filter out a scenario. To access the tags , use context.scenario.tags
    Michael Mintz
    @mdmintz
    I created a few integrations for behave. One: a more natural Selenium integration. Two: A Desktop GUI for running behave tests. And Three: A Dashboard for reporting behave results with a pie chart and table data. https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md
    Krzysztof Wozniak
    @Hejvi
    Hi, is it any way to use Selenium Grid 4 with Behave to run tests in parallel?
    Michael Mintz
    @mdmintz
    @Hejvi Yes, I do that sometimes.
    8 replies
    Saher Ayman🔥⛏
    @saheraalreqeb_twitter
    I've scheduled tasks using celery to do weekly, And I'm using behave-django for testing.
    is there any way that I can control the time of celery or the project running time in beahve to test that endpoint?
    VamshiKrishnaUM
    @VamshiKrishnaUM
    Can we run playwright with behave ?
    natalie-ne
    @natalie-ne
    Hey,
    Does someone familiar with a way of counting and summing all the test cases from the feature files?
    1 reply
    Michal Odehnal
    @modehnal
    @bittner Hello, I am moving the conversation here based on your recommendation. I managed to copy the files from behave-html-formatter to the new project with the history preserved - which was quite a pain but I was not comfortable with just copying, so I am glad that was a success. I have a question regarding the .github/workflow/packaging.yaml I have never tried using that so I am not confident about how that works, I can just make assumptions. Am I correct to assume I will just create my Action secret in github with my credentials to my account in pypi and upon merge to the main branch the pipeline will build it and push it to the pypi?
    Peter Bittner
    @bittner
    @modehnal In https://github.com/behave-contrib/behave-html-pretty-formatter/settings you should see an option Secrets > Actions in the "Security" menu, which allows you to add a <kbd>New Repository Secret</kbd>. If not ... then I need to add that for you.
    The token you need to add is generated on PyPI.org at https://pypi.org/manage/account/token/
    The page will give you instructions on the user name upon token creation, too.
    Michal Odehnal
    @modehnal
    @bittner Yeah I can see that option. I have created the token and linked it to the Secret in the project. Thank you. Do I not have to create the project first in pypi or will the pypi create it upon first twine upload ? I suppose I can just make a few test merges to figure out how it works but I see nothing wrong with the git setup for the moment.
    Peter Bittner
    @bittner
    The project will be created upon your first upload. You can you an unscoped token first and change it later to a token that can only be used for the newly created project. For you own safety. (A leaked token can then only be used to take over one project, not any, and can then not be used to create a new - e.g. malicious - project.)
    Name the secrets PYPI_PASSWORD and PYPI_USERNAME then you can leave the CI code as it is. See the behave-html-formatter project for comparison.
    Michal Odehnal
    @modehnal
    Good to know yeah. Once its there I will set it to only that project. I just wanted to ask about the PYPI_ naming. Where do I name the secrets? I am not sure I understand where that link goes
    @bittner I do not have access to the secret for the html formatter
    If you can give me access I will look how its set up and copy it
    Peter Bittner
    @bittner
    When you create the secret you define the name. You seem to have used the value __TOKEN__.
    Michal Odehnal
    @modehnal
    Right so that is the name I need to use, where do I set the PYPI_PASSWORD?
    I will fix the name
    Peter Bittner
    @bittner
    The token you need to add is generated on PyPI.org at https://pypi.org/manage/account/token/
    The page will give you instructions on the user name upon token creation, too.
    Michal Odehnal
    @modehnal
    Ah damn, I thought I read it properly
    Michal Odehnal
    @modehnal
    Yeah so I understand that the token name I set will go as PYPI_SECRET but I still am not sure where to set the password name, perhaps I am missing something
    Michal Odehnal
    @modehnal
    Aaah, I understand now, thank you for the access to the behave-html-project, that makes it clear to me.
    Michal Odehnal
    @modehnal
    I added the secrets in correct format and with correct data so it should be all set. Thank you again.
    Peter Bittner
    @bittner
    The idea if the packaging setup is:
    1. You update the version in your code ...
    2. and set the same version as Git tag on the commit (e.g. git tag 1.0.0).
    3. Then push the tag to GitHub (e.g. git push --tags).
    4. The packaging workflow will then be triggered (because of on: push: tags: ["*"]) and build + upload a package to PyPI.
    anshuk584
    @anshuk584

    Hi team,

    I'm trying to import my allure report to JIRA using Allure for JIRA plugin. But even after providing all the relevant details I can't see the Allure launches Plugin Seeing up

    Below is the glimpse of Pipeline. I can See the links poping up in my report

    pipeline {
    agent any

    stages {
    
        stage('Behave Step') {
            steps {
    
                  dir("<Folder Path>") {
                  bat "behave --f allure_behave.formatter:AllureFormatter -D AllureFormatter.link_pattern=<JIRA LINK>/browse/{} -o <Workspace path>/allureresults --tags=@Health_Check --no-capture"
    
                            }
    
                }
        }
        stage('Allure Setup') {
    
        environment {
                    ALLURE_JIRA_ENDPOINT = 'http://<JIRA URL>/rest/'
                    ALLURE_JIRA_LAUNCH_ENABLED = 'true'
                    ALLURE_JIRA_LAUNCH_ISSUES = 'TEST-3'
                    ALLURE_JIRA_USERNAME = '**********'
                    ALLURE_JIRA_PASSWORD = '**********'
    
    
                }
    
                steps {
                            script {
    
            allure([
                    includeProperties: true,
                    jdk: '',
                    commandline: '2.18.1',
                    configPath: '<Config directory path>/config/allure.yml',
                    properties: [[key: 'AllureFormatter.link_pattern', value: '<JIRA URL>/browse/{}']],
                    reportBuildPolicy: 'ALWAYS',
                    results: [[path: 'allureresults']]
            ])
                        }
    
                }
    }