by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Gazal Shukla
    @gazalshukla
    I have added the function for wait in contextFeature file
    pmaasz
    @pmaasz
    /**
     * @When I wait :seconds seconds
     *
     * @param mixed $seconds
     */
    public function iWaitSeconds($seconds) {
        $this->getSession()->wait(
            $seconds * 1000
        );
    }
    this must be added to your FeatureContext in the bootstrap directory
    Gazal Shukla
    @gazalshukla
    I added what you sent in the screenshot . But i am getting this
    image.png
    @pmaasz Thanks a lot .It passed
    I am very new to Behat . Thanks for helping me out.
    pmaasz
    @pmaasz
    No problem, we want the community to grow and be more active.
    Gazal Shukla
    @gazalshukla
    do you have any articles or link for using data-driven/parameterization approach
    in behat? Thanks in advance !
    pmaasz
    @pmaasz
    https://docs.behat.org/en/latest/user_guide/writing_scenarios.html you could start with Sceanrio Outlines or Backgrounds
    Gazal Shukla
    @gazalshukla
    @pmaasz Thanks :)
    Gazal Shukla
    @gazalshukla
    How can we get a field when Form field is not defined with id|name|label|value|placeholder ?
    PurHur
    @PurHur
    how is it defined
    PurHur
    @PurHur
    that is a html element that simulated a field. You have to work with that html
    Gazal Shukla
    @gazalshukla
    Okay,Thanks
    any links do you have for ref?
    Alexandre Vialatte
    @Matelight35_gitlab
    Hi everyone !
    I'd like to know if there is a way in behat to create a configuration to limit the action time of each step. It will be likely the "Set selenium speed" from Robot framework. :)
    pmaasz
    @pmaasz
    Robot is python, right?
    Alexandre Vialatte
    @Matelight35_gitlab
    YEs exactly but I'd like to know if, in behat, we are able to reproduce the same behavior ?
    pmaasz
    @pmaasz
    I don't think it is natively possible but I also never needed such behaviour. You could look into writing a small extension for that.
    matlar83
    @matlar83
    Hi, anyone can help me with a behat+symfony+mocking problem? https://stackoverflow.com/questions/60542538/mock-symfony-service-in-behat-functional-test
    PurHur
    @PurHur
    did you try to start a proxy beside your test runner for that api?
    matlar83
    @matlar83
    I would be difficult using a proxy since I need the fake API to return different data for each different scenario
    Матвей Болисов
    @mbolisov_twitter
    Hello, I'm trying to rollback database transaction by "DatabaseTransactions.php" methods. I have no Exceptions but nothing gonna happened and new records still in my DB
    PurHur
    @PurHur
    that depends on how you test all the things
    mysql doenst support transactions so you cannot run a "real testrun" only in unit tests is works (i assume you are using laravel/databasetransactions)
    Матвей Болисов
    @mbolisov_twitter
    I am using behat-laravel-extension/databasetransaction. Thx for answer
    kevin-schmitt
    @kevin-schmitt
    Hello, How load test env file and with symfony when i run behat command please? Current when i use vendor/bin/behat --tags=api , it's dev env that load by symfony for avoid that i have to replace env file by env.test. It not exist a way for to do that with configuration file in behat? Thanks
    kevin-schmitt
    @kevin-schmitt
    Resolved, i use finally env.test and overwrite env file. For use specific authenticator in test environnement i use specific firewall where pattern use parameter in .env.test file for disable in dev or prod env just specify parameter with empty string ' ' :)
    pmaasz
    @pmaasz
    How can I test a site that is guarded by htaccess?
    pmaasz
    @pmaasz
    ok i got it user:password@domain
    Kamil Kokot
    @pamil
    Symfony 5 and PHP 7.4 support in the newest FriendsOfBehat’s SymfonyExtension release: https://twitter.com/pamilme/status/1246770622677557248 :tada:
    pmaasz
    @pmaasz
    wasn't the support for Symfony 5 and PHP7.4 released two month ago?
    Kamil Kokot
    @pamil
    It was merged then, but the stable release with it has been published now.
    pmaasz
    @pmaasz
    ah ok
    I had updated instantly when it was merged
    Marco Veenendaal
    @cwdt

    Hi all,

    I'm running into some issues with Behat/Mink/Selenium2/Firefox.
    The situation is that I have an IFrame with only a src attribute, I managed to update the id & the name property of the IFrame with a JS script in my test-step.

    But when I call switchToIFrame with that generated attribute I'm getting the following error: "data did not match any variant of untagged enum FrameId at line x column x"

    Can someone help me or point me in the right direction or room?

    Michael Lundquist
    @user-name-is-taken
    I didn't see a way to override a method with a stub in behat. I asked a question about it on stackoverflow but thought posting here would be good too https://stackoverflow.com/questions/61401506/how-can-i-stub-out-an-api-call-method-in-behat
    pmaasz
    @pmaasz
    if i understand you correctly you have to authenticate the user at your api? if you have an endpoint for that like /login_check or otherwise you can write a Scenario for that in Gherkin or PHP
    Michael Lundquist
    @user-name-is-taken
    Yeah, for me to make/test API calls to the quickbooks API I need a user to authenticate which isn't realistic in a unit test. The way I've seen to get around this is to override the methods that make API calls and make them return hard coded data. Is there a way to do this in behat?
    Michael Lundquist
    @user-name-is-taken
    My code is here if this helps https://gitlab.com/greenhouseaffectors/php
    Michael Lundquist
    @user-name-is-taken
    Never mind, I think I figured it out.
    Cristian
    @dumitriucristian

    Hi, Please help me if you can...
    I use symfon5 with friends of Behat and I am unable to run only one suites.
    Is always ask me to define steps in other context.
    This is my yml :

    default:
        suites:
            login:
                contexts:
                    - Api\LoginContext
    
            register:
                contexts:
                    - Api\RegisterContext
    
        extensions:
            FriendsOfBehat\SymfonyExtension: ~
            Behat\MinkExtension:
                sessions:
                    symfony:
                        symfony: ~

    I wish to run only register but throw "register suite has undefined steps. Please choose the context to generate snippets:" and ask me to define steps from login context

    Cristian
    @dumitriucristian
    solved thanks
    Anyqax
    @Anyqax
    hi, is it possible to define dependencies between scenarios or suites, e.g. run scenario B only when scenario A succeeded?
    kevin-schmitt
    @kevin-schmitt
    Hello @Anyqax , question is why? test with dependencies that can change state is dangerous. Why you need that?
    Kamil Kokot
    @pamil
    Hopefully, Behat will be maintained a bit more: Behat/Behat#1296 :)
    ash-m
    @ash-m
    I was watching a video with Ciaran McNulty which basically advised against using infrastructure in your tests; I get that every situation is different, but I am a bit confused when it comes specifically to testing infrastructure components -- say you're writing a table module that manipulates data in a specific way .... or something. Anyway, the point is, if you want to be concrete about an example you could say Given I have a table named 'table' in a PG database with data ... and you can write a specific implementation for your PG database; so if your component uses PDO, would you instantiante a PDO instance in your test with a DSN pointing to a test db? In a situation where this could be swapped out for another DSN connecting to a different type of database (with it's own implementation) you'd set all that up a second time? This just seems like the wrong way to go about things and I'm not sure how to go about it.
    saravanan sp
    @saravanansp96
    Hi I am Saravanan from India, I am pretty much new to Behaviour testing
    I was asked it do a POC on behaviour testing on magento 2.3.4 (PHP e-commerce framework) based modules. So is there any docs I have seen through ( https://behat-magento-2-extension.readthedocs.io/en/latest/guide/quickstart.html ). But I don't know how to start with it