Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ciaran McNulty
    @ciaranmcnulty
    Then I write one step definition and then code to make it pass, etc
    Ben Plummer
    @benplummer
    @ciaranmcnulty Thanks, that makes sense. To clarify, when you say about writing one step definition, is that one method in the relevant context file for one of the Given/When/Then lines of the relevant scenario? I'm fairly new to Behat so a little rusty with the terms!
    Ciaran McNulty
    @ciaranmcnulty
    Yes the method that matches the step
    Ben Plummer
    @benplummer
    @ciaranmcnulty Great, thanks for the help!
    Ciaran McNulty
    @ciaranmcnulty
    When I feel I’ve done a few scenarios and worked out the domain model I then look at running some of the scenarios as end to end UI tests
    Ben Plummer
    @benplummer
    @ciaranmcnulty Ah cool, thanks, I'll take a look. I thought it'd be good to use Behat to note down all of my scenarios first and identify a ubiquitous language as such.
    scoolen
    @scoolen
    Hi everyone. Does anyone have any suggestions on the recommended approach for dealing with a DIC and event subscribers? So a custom service container (refreshed every scenario) and several services that hook into the event dispatcher (e.g. subscribing to AfterStep). Thanks!
    Jeevan Bhushetty
    @jeevanbhushetty
    Hey has any tried to avoid google analytics while running behat tests. ?
    Wayne Hazle
    @waynehazle_gitlab
    I would like install an OLDEr version of Behat. Specifically Behat 2.5.0. do I need got do this through Composer and how?
    Chris Lock
    @catharsisjelly
    composer require behat/behat ^2.5
    Wayne Hazle
    @waynehazle_gitlab
    thank you @catharsisjelly !
    suswari
    @suswari
    Hi Guys, I am finding for some help. Here is my problem - I am trying to set a timeout for the page and I am aware that the timeout would throw an error. The following is the code I have: try{
    $this->getDriver()->setTimeouts(['page load'=>5000]);
    }
    catch (Exception $e){
    var_export('in catch');
    }
    setTimeouts is thorwing an error, the error is not caught with the catch block. Can some help me in knowing what is the exception that setTimeouts is thorwing so that can be caught??
    pokoti
    @Vlad_Master_twitter
        if ($this->getSession()->getDriver() instanceof Selenium2Driver) {
            $this->getSession()->getDriver()->setTimeouts([
                'page load' => 60000,
            ]);
        }
    Vinícius
    @vinicius978
    How do you guys wait for elements that will receive an action but it's not available yet? Deal with AJAX events or with the spin() function?
    SamyOteroGlez
    @SamyOteroGlez
    there is a function to wait certain amount of time. $this->getDriver()->wait()
    Christophe Coevoet
    @stof
    well, if you just want to wait for some time, usleep would be more efficient actually. The driver API is most useful to pass a JS expression as condition, to wait until it becomes truthy (in the limited of the provided time)
    Vinícius
    @vinicius978
    @SamyOteroGlez I just want to wait the amount of time taken to element appear on screen after the AJAX finished. Got it?
    @stof how can i user this driver API?
    SamyOteroGlez
    @SamyOteroGlez
    @vinicius978
    You could use usleep, as @stof sugested, and wait enough time (lets say, if it usually take 10 sec to do the query and to show the element, you could wait for 30 sec, but that's dirty, it will prove your concept, but dirty). Or you could implement some with $this->getDriver()->wait() evaluating the javascript in charge to launch the element you are waiting for.
    @vinicius978
    You could also use this same logic but adapted to your needs. In that post the intent is to test a modal launched by a js action.
    https://stackoverflow.com/questions/43879989/how-to-test-a-bootstrap-modal-using-behat-mink-and-selenium-standalone-server
    Wayne Hazle
    @waynehazleguidance
    What "reporting" functionality is there in Behat? After I run a suite of tests I want to be able to email a report out to a list of people. I image this is not built into Behat and a plugin or something needs to be used. Has anyone had any success?
    Wayne Hazle
    @waynehazleguidance
    by the way I am using Behat 2.x and I found it's HTML output feature. It is OK, but I would like to customize it and make a much simpler pass/fail report. Has anyone done this?
    Finally I just found in version 3 that there is a plugin that allows much better reporting. Has anyone used this?
    SamyOteroGlez
    @SamyOteroGlez
    @waynehazleguidance
    This is a very good, easy to customise, reporting extension for behat. "emuse/behat-html-formatter"
    Wayne Hazle
    @waynehazleguidance
    @SamyOteroGlez I will have to upgrade to Behat 3.0 to make that extension work
    Grzegorz Kaszuba
    @uirapuru
    Hi guys. I just can't get this working on two different machines: composer require behat/behat --dev, after installation I try ./bin/behat and I get this:
    uirapuru@uirapuru-tower:/var/www/new-calendar$ ./vendor/bin/behat
    
    In ContainerBuilder.php line 1001:
    
      You have requested a non-existent service "cli.output".
    any ideas?
    if it does matter:
    uirapuru@uirapuru-tower:/var/www/new-calendar$ php -v
    PHP 7.2.5-0ubuntu0.18.04.1 (cli) (built: May  9 2018
    Grzegorz Kaszuba
    @uirapuru
    ok, I downgraded to 3.4.1 and it works ok
    Wayne Hazle
    @waynehazleguidance
    How do I create UI Maps for a page? Need to be able to tell Behat how to click a button or enter text in a box or choose a dropdown and I don 't know all the definitions of the objects on the page
    suswari
    @suswari
    @waynehazleguidance Hi, Please excuse me if I got your question incorrect. But if you are asking how to find an element on any page - there are locators like css, id , xpath etc; which help identifying an element on the page. If you are asking how to the pass elements to predefined contexts like in mink context - you don't have worry much about defining elements your self using locators, instead just pass in appropriate hints related to the element as needed by the context.
    Hi all, My Behat tests stop interim if any scenario fails in a feature file. Instead I want to run the whole suite of tests just marking the failed and passed scenarios. Is there a way/configuration in Behat to continue tests on failure of a scenario? -- Thanks
    Christophe Coevoet
    @stof
    @suswari actually, Behat has an option to stop the execution on the first failure, but it is off by default. So check your config file
    suswari
    @suswari
    @stof Thanks for you reply, Let me check that
    Rich Bodo
    @richbodo
    Anyone using Behat with Drupal 8?
    We are trying to debug doobie, a D7 module that uses the php behat suite, and we're looking for some tips. URLs seem to be mangled a bit on the way into the Behat DSL engine.
    jazzcool31
    @jazzcool31
    Anyone getting an issue on I am on "xyz" # Drupal\DrupalExtension\Context\MinkContext::visit()
    DMore\ChromeDriver\StreamReadException in /var/www/ibm/vendor/dmore/chrome-mink-driver/src/DevToolsConnection.php:70
    Stack trace:
      #0 /var/www/ibm/vendor/dmore/chrome-mink-driver/src/DevToolsConnection.php(52): DMore\ChromeDriver\DevToolsConnection->waitFor(Object(Closure))
      #1 /var/www/ibm/vendor/dmore/chrome-mink-driver/src/ChromePage.php(42): DMore\ChromeDriver\DevToolsConnection->send('Page.navigate', Array)
    I am using BLT with dMore extension
    Please suggest if anyone has any solution on same, i am struggling for last couple of days
    Ghost
    @ghost~5b5995f1d73408ce4fa26375
    Hey, I am trying to use a DI container in Behat Contexts. At first, I used a ContextInitializer and called a setDIContainer() method, which works, but is messy and uses a lot of boilerplate code.
    What I am now trying is using the ContainerBuilder that is passed to the extension, and filling it with my own services.yaml
    Parameters work ok, but services are ignored.
    Any ideas?
    Ghost
    @ghost~5b5995f1d73408ce4fa26375
    :-O Ha, what? You can just paste your services.yaml in the behat.yaml? That is so cool!
    Why is that not documented anywhere? I had to debug Behat for an hour now to stumble across that feature after several hours of trying to find other ways.
    I will write a blog post on this now (german, though), maybe save some other guys a few hours of searching.
    Ghost
    @ghost~5b6c4ba5d73408ce4fa4115c
    hi all, anyone here?
    Douglas Reith
    @redthor
    new to behat - using symfony 4 with dotenv .env - is there a standard practice for loading the values in .env into the behat environment so my test cases don't fail?
    Douglas Reith
    @redthor
    ok, so I worked it out, features/bootstrap/bootstrap.php is loading DotEnv but only if APP_ENV is not defined, I unset that in my local environment and now all is fine