Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    SamyOteroGlez
    @SamyOteroGlez
    @Analianys
    Hola, es exactamente como dices, por defecto existen implementados los step definitions mas comunes para ahorrar tiempo, pues al final ese codigo se puede reutilizar. Acciones como pinchar un link, o presionar un boton, o llenar un campo, etc... Claro que de cierta manera eso te limita pues entonces no podrias reutilizar los mismo scenarios en varias implementaciones, como por ejemplo utilziar un scenario de autenticacion para hacer pruebas d UI automatizadas, usar el mismo scenario para hacer pruebas de integracion, o probar diferentes roles, etc...
    Christian Sciberras
    @uuf6429
    PHPUnit has a feature where one can define suites in the XML file and these will be run sequentially (unless the suite to run is specified from CLI). I tried something similar with Behat 3, but instead of running the suites, it seemed to run everything (it looked like it took the default settings).
    1. Is this the correct behaviour, or did I do something wrong?
    2. Is there a way to make it work like PHPUnit without requiring extensions?
      A little context on what I need: I'm testing a system and there are two types of tests: (a) should run during setup and (b) should run after setup (possibly more will come up in the future).
      I'm controlling this with the use of tags/filtering, but it would be nice to avoid having to run behat --tags=before-setup && behat --tags=after-setup (also because it would be great to have one unified output)
    David Lorite Fernández
    @dalorfer
    hello everyone! I’m using Selenium (3.8.1), Chromedriver (2.33), Behat (3.4.3) and Chrome (64)…when the tests run, an error appears randomly. The error: "no such window: target window already closed from unknown error: web view not found”, Selenium is running in standalone….any ideas?
    andreasRulle
    @andreasRulle
    Which mink-extension version do you use?
    David Lorite Fernández
    @dalorfer
    Mink-extension version 2.3.0
    Christophe Coevoet
    @stof
    @uuf6429 Behat also have this concept of suites, and they also run sequentially (unless you use the --suite option to run only one of them). Are you sure you were defining suites ?
    josephgut
    @josephgut
    Hello All, I am trying to figure out how to script click on tabs with Behat. I can click buttons, links, and elements, but having problems with tabs. I've tried to use Element thinking that may work, but no luck yet. Any help would be greatly appreciated. Thanks!
    josephgut
    @josephgut
    I think we figured it out. Correct syntax is to call the element with something similar to: And I click the ".StepListViewTabsItem[data-tab='Complete']" element
    Shaun Moss
    @mossy2100
    Hi - I am trying to use behat to set the value of a Body field on a form, except the field is a CKEditor rich text WYSIWYG field, which uses an iframe. Any tips?
    Shaun Moss
    @mossy2100
    solved. Happy to relay answer if anyone else is interested.
    Victoryyyyy
    @Victoryyyyy

    Hello all, I am trying to figure out if I can use custom parameters from .yaml file from one context to another. For ex:

    contexts:

                - CustomWebContext:
                    user: asdf
                    pass: 1234
                - CustomAPIContext:
                     user: asdf
                    pass: 1234

    The problem is: I have 2 context files which use same parameters. Should I define parameters for both context ?
    Any help will be appreciated. Thanks all.

    Victoryyyyy
    @Victoryyyyy
    Hello again :) , I found the solution here we go :
     suites:
          default:
              parameters:
                  user: &user asdf
                  pass: &pass 1234
              contexts:
                  - CustomWebContext:
                      sfEmail:              *user
                      sfPassword:     *pass
                  - CustomApiContext:
                      sfEmail:              *user
                      sfPassword:     *pass
    Jose Cornide
    @jcornide
    hello! I'm thinking about creating an html version of my behat tests some business people can read them even easier, so I was wondering if there's any way to get all the tests info
    and then iteract throw them to generate the output
    Ghost
    @ghost~553ce6ff15522ed4b3df8944
    Hi all. I use multiple suite and custom parameters. I retrieve my parameters using the scope. But I didn't find a way to retrieve these parameters in @BeforeSuite hook. How can I do that. Thanks in advance
    ultracrystal
    @ultracrystal
    Hi everyone. Is anyone aware of a Behat feature, or maybe even an extension, which would summarize in some form of a report the amount of time it took to execute each scenario?
    Ciaran McNulty
    @ciaranmcnulty
    ultracrystal
    @ultracrystal
    @ciaranmcnulty Thanks for the suggestion. I'll certainly look into this.
    Ben Plummer
    @benplummer

    Hi all, I'm working on a project that will follow DDD with layers and patterns but I also want to use BDD for acceptance testing outside-in.

    With this approach, I wondered whether the Behat scenarios would mainly concentrate on the UI? And what the best practices are?

    I've read that ideally we don't want to couple scenarios to a UI that could easily change but I'm not sure what the alternative would be when I want to write scenarios in a TDD fashion before any code/layers/patterns exist. I imagine it'd be quite difficult to write scenarios for DDD related code that does not exist yet whereas the UI is more predictable.

    Paul Gibbs
    @paulgibbs
    Does the BeforeScenario event hook trigger before Background steps, or only actuall Scenarios? I'm looking for something that fires before scenarios and backgrounds, but not BeforeFeature (can't use static function).
    Chris Lock
    @catharsisjelly
    @paulgibbs AFAIK it triggers before the Background too
    Hi all, I'm having a bit of an issue tryiong to get Behat to register a namespaced context file linking with Symfony 4, if anyone has an example I'd appreciate it
    Chuk Shirley
    @chukShirley
    Anyone have tips for selecting a DataTables row from within a Mink context class? At first I thought I would just select the element with a css selector and click(), but as the DataTables docs say, "The checkbox is not an <input type="checkbox"> element, but rather a CSS that uses the :before and :after pseudo elements of the cell to draw a box and the tick. "
    Chuk Shirley
    @chukShirley
    Well, apparently you can just select the surrounding td and click()
    Ciaran McNulty
    @ciaranmcnulty
    @benplummer wrote scenarios using ubiquitous language and exercise your Application Service / Command Handler layer as well as your UI
    Ben Plummer
    @benplummer

    @ciaranmcnulty Would you write steps inside FeatureContext.php using Application services that don't exist yet so that they fail first in the usual TDD fashion? And then start building them to fix the Behat scenarios?

    Or with Behat, would the TDD equivalent be writing the scenarios without steps in the FeatureContext.php so that they fail but build the Application services etc before writing the Behat steps?

    Ciaran McNulty
    @ciaranmcnulty
    I step-by-step write the definitions, see them fail, then make them work
    Ben Plummer
    @benplummer
    @ciaranmcnulty Ah okay - so you write your .feature files and FeatureContext.php step definitions before any code?
    Ciaran McNulty
    @ciaranmcnulty
    I wrote the feature with others as part of discussing the feature
    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