Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Admiral Husker
    @admiral_husker_twitter
    @bitwombat @forceedge01 thanks you both for answering. I went with your solution @forceedge01 but i don't like the fact that the database state could be different from what it is when the user is actually using the app. I mean, if the controller action does more than just creating a request my scenario will miss that. That's acceptable though for the small piece of software i try to test so thanks again :)
    Abdul Wahhab Qureshi
    @forceedge01
    @admiral_husker_twitter From my experience to isolate your testing scenarios properly and to speed up testing it is important to create all preconditions programmatically where you can. Your controller could create the data by submitting a request, but that is a test on its own. If you are to couple the fact that your request is created by the web UI interaction then that means if you have an issue with creating your request, then all scenarios will fail due to the fact that they are coupled which is incorrect. What I would want a test to do is to point me towards where the problem is with concise information, if 5 of my scenarios are failing because of one interaction not working properly i.e creating the request, then i cannot quantify how big the problem is, or most probably wrongly quantify it. So to isolate the concerns, one scenario should test creation of the request. Once you've validated that bit, you don't want to re-test that bit, so create it programmatically as a precondition. I hope this makes sense :) Glad to help.
    @rafasellas_twitter not sure what you mean
    Rafaella Olandim
    @rafasellas_twitter
    Hello!
    Please, have you used the page object in Behat, do you have suggestions or positive or negative experiences?
    Tiko
    @tikolakin
    @here is there anyone using behat 3 with nvim?
    Abdul Wahhab Qureshi
    @forceedge01
    @rafasellas_twitter Haven't used the built in extension - but the setup i have at the moment closely resembles page object pattern. Lets say It isn't a bad idea, good separation of concern to have context files for each page if thats what it is..
    @tikolakin have not
    @tikolakin what is it?
    sredbull
    @sredbull
    Can anyone point me to the right direction with a $this->getSession()->wait($time, $condition); condition:
    this condition will check if a style element exists: document.querySelector('.__cov-progress').getAttribute('style').indexOf('width: 0%') > 0 the problem exists when the document.querySelector('.__cov-progress') does not exists on the page the getAttribute will brake the test. Unfortunately using if in a condition is not possible if(document.querySelector('.__cov-progress')){document.querySelector('.__cov-progress').getAttribute('style').indexOf('width: 0%') > 0}else{true} and results in nknown error: Runtime.evaluate threw exception: SyntaxError: Unexpected token if is there a solution for this?
    sredbull
    @sredbull
    ((document.querySelector(".__cov-progress") == null) || document.querySelector(".__cov-progress").getAttribute("style").indexOf("width: 0%") > 0)
    works
    ZathrasOne
    @ZathrasOne
    Is there any way to have profile information show up in a JUnit report. I found that I can echo information into the standard output, but if I switch to the JUnit formatter, that information is lost. Any way to get additional information into the JUnit report?
    Eduard Sukharev
    @eduard-sukharev
    @ZathrasOne I guess you could extend JUnit formatter and add required info to generated output XML (or whatever format it uses) and then use your formatter (say, 'junit-profile') instead of 'junit'
    Lucas Ruggiero
    @Lucaskcr_twitter
    Hey guys, I have a project using symphony and behat framework running inside a container. I would like to add this framework inside of the project. Is there any specific place that I should add this?
    gvanduijn
    @gvanduijn
    Hi there is it possible to select an pseudo element in Behat with Symfony?

    I am working on test scripts for a website, but I came across a pseudo element that I unfortunately cannot work around.

    The HTML looks similar to the following:

    <a class = 'something', href='link', data-post = 'somesortofaction' ::before <span>Remove this Item</span>
    </a>

    The a-element is not clickable, since in this case its exactly 0 pixels wide, so I need to use the :before pseudo-element.
    Whenever I try, behat gives me back either an error if I do not use the ::before or "pseudo-elements are not supported"

    I know pseudo-elements are not part of the DOM, but does anyone have a simple workaround?

    Thank you so much in advance!

    FlyLo11
    @FlyLo11
    @gvanduijn Another option would be to just add a class or data-attribute on <span> to directly reference it
    Waiting on Smash
    @LenouNiaha_twitter

    Hello :). I'm discovering Behat and I seem to have an issue with Google. I'm following Grafikart's tutorial ( h ttps://www.youtube.com/watch?v=SiB8OlaptGU ) and to explain how to use the tag @javascript , he does something like this
    "Scenario: Search
    Given I am on the homepage
    When I fill in "lst-ib" with "Grafikart"
    And I wait for 1 seconds
    Then I should see "Grafikart.fr" "

    The fill in's field here is my Google's id but no page is opened when I trigger it. Any idea why? I have this error :
    When I fill in "lst-ib" with "Grafikart" # WebContext::fillField()
    Form field with id|name|label|value|placeholder "lst-ib" not found. (Behat\Mink\Exception\ElementNotFoundException)

    Tom Cappetta
    @cappetta
    From a gherkin mapping to code perspective, does anyone know how to get multiple gherkin statements to be recognize for 1 function of code?
    ive added them above the method but I'm still seeing that they are undefined...
    Davor
    @srlesrle

    following this tutorial: https://knpuniversity.com/screencast/behat/install and probobly having different versions of symfony in tutorial and on my side I get next error:
    Given I am on "/" # FeatureContext::iAmOn()
    Fatal error: Class 'PendingException' not found (Behat\Testwork\Call\Exception\FatalThrowableError)
    When I fill in "searchTerm" with "Samsung" # FeatureContext::iFillInWith()
    And I press "search_submit" # FeatureContext::iPress()
    Then I should see "Samsung Galaxy S II"

    my composer file is:
    "require": {
    "php": ">=5.5.9",
    "symfony/symfony": "3.1.*",
    "doctrine/orm": "^2.5",
    "doctrine/doctrine-bundle": "^1.6",
    "doctrine/doctrine-cache-bundle": "^1.2",
    "symfony/swiftmailer-bundle": "^2.3",
    "symfony/monolog-bundle": "^2.8",
    "symfony/polyfill-apcu": "^1.0",
    "sensio/distribution-bundle": "^5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "^2.0",
    "knplabs/knp-markdown-bundle": "^1.4",
    "doctrine/doctrine-migrations-bundle": "^1.1",
    "ramsey/uuid": "^3.7"

    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0",
        "symfony/phpunit-bridge": "^3.0",
        "nelmio/alice": "^2.1",
        "doctrine/doctrine-fixtures-bundle": "^2.3",
        "behat/mink-extension": "^2.3",
        "behat/mink-goutte-driver": "^1.2"
    },
    Eduard Sukharev
    @eduard-sukharev
    @cappetta multiple sentence regexps in phpdoc of implementation method should work just fine. Each should start with @Given, @When or @Then as usual.
    vincentmary
    @vincentmary
    Hello does the DocumentElement is updated if the page DOM is changed during a step?
    During a step, i need to wait until an ajax call is made to check that page content match a pattern so I use spin method described here http://docs.behat.org/en/v2.5/cookbook/using_spin_functions.html and $this->assertSession()->pageTextMatches($this->fixStepArgument($pattern)); but I think DOM Content is not updated
    Tiko
    @tikolakin
    it's not updated
    Sam Tuke
    @samtuke
    Hi all, does it make sense to use behat + selenium for measuring page load speed? E.g. to determine whether over time a web app is loading more quickly or slowly?
    Christophe Coevoet
    @stof
    I would not use Behat for that. A Gherkin scenario does not seem the right way to check this
    and I'm not even sure Selenium allows to measure that easily
    Thread Reader Bot 🤖
    @threadreaderapp_twitter
    hello everyone, i looked all the doc i can found about it but still no luck
    I'm wondering how/if it is possible to pass an argument on the behat command line that I can get in my context after?
    for example behat --colors --my-arg=my-value
    I kind of see that it may be possible to pass through env var but this is not so flexible
    Ciaran McNulty
    @ciaranmcnulty
    I don’t think this functionality is built in
    Christophe Coevoet
    @stof
    you will need to write a Behat extension for that
    Thread Reader Bot 🤖
    @threadreaderapp_twitter
    thank you both for your help :)
    Analianys
    @Analianys
    Hola quisiera me aclaran una duda sobre el contralador Mink Cheat Sheet. Soy profesora de una universidad y sobre BDD tengo una duda. Si empleo las palabras reservadas de Mink Cheat Sheet, no tengo que implementar los Step Definitions. Por favor me urge
    Analianys
    @Analianys
    @Analianys
    Hola quisiera me aclaran una duda sobre el contralador Mink Cheat Sheet. Soy profesora de una universidad y sobre BDD tengo una duda. Si empleo las palabras reservadas de Mink Cheat Sheet, no tengo que implementar los Step Definitions. Por favor me urge
    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