Coder Social home page Coder Social logo

minkbrowserkitdriver's People

Contributors

adrienbrault avatar aik099 avatar alexpott avatar andrewnicols avatar arcturial avatar artursvonda avatar benji07 avatar cfjulien avatar chris8934 avatar digitalkaoz avatar dunglas avatar eugenegp avatar everzet avatar fjgarlin avatar guilliamxavier avatar hason avatar ifdattic avatar krisdante avatar loic425 avatar longwave avatar mpdude avatar pamil avatar ruudk avatar simonschaufi avatar sroze avatar stof avatar thepanz avatar thewilkybarkid avatar thomandre avatar wouterj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

minkbrowserkitdriver's Issues

Request headers are not removed between tests.

I have a problem. I am using request headers in authentication process in my project. In tests, I wrote custom scenario step, where I set request headers. In some time I noticed that if I have scenario with authentication and after it I have scenario without authentication, the last one fails. So, I found that the problem is in request headers, request headers from previous test are still available for current test, they are not deleted. Any advice?

More than one submit button in a form causes errors

We've been struggling with some submit issues for a few days. We have two buttons for submitting a form, and want to use the name/value to discriminate between which one was clicked.

When these buttons have the same name, Mink will always submit the value of the first button, regardless of which was clicked.

When these buttons have a different name, Mink throws an exception:

  Exception thrown by (//html/.//input[./@type = 'submit' or ./@type = 'image' or ./@type = 'button'][(((./@id = 'Continue' or ./@name = 'Continue') or contains(./@value, 'Continue')) or contains(./@title, 'Continue'))] | .//input[./@type = 'image'][contains(./@alt, 'Continue')] | .//button[((((./@id = 'Continue' or ./@name = 'Continue') or contains(./@value, 'Continue')) or contains(normalize-space(string(.)), 'Continue')) or contains(./@title, 'Continue'))] | .//input[./@type = 'image'][contains(./@alt, 'Continue')] | .//*[./@role = 'button'][(((./@id = 'Continue' or ./@name = 'Continue') or contains(./@value, 'Continue')) or contains(./@title, 'Continue') or contains(normalize-space(string(.)), 'Continue'))])[1]
  Unreachable field "flag"

The two buttons were <button name="flag" value="true">Flag</button> and <button name="continue" value="true">Continue</button> in this case.

Have tried the latest dev version of MinkBrowserKitDriver and BrowserKit.

`Undefined offset: 12` when disabled checkboxes are present for array field

With the latest behat/mink-browserkit-driver 1.3.4 and symfony/dom-crawler 4.4.5 there's an incompatibility that causes a fatal error in our testsuite.

We have HTML containing checkboxes with an array field name, some of them disabled - e.g.:

<input type="checkbox" name="permitted_recruiters[]" value="6620" disabled checked>
<input type="checkbox" name="permitted_recruiters[]" value="5340" disabled checked>
<input type="checkbox" name="permitted_recruiters[]" value="6639">
<input type="checkbox" name="permitted_recruiters[]" value="6672">

And we have a step that uses the standard And I check "Major Tom" step in MinkContext.

This has been working fine, but is now giving an Undefined offset: {number} error from BrowserKitDriver.

The error comes from this line

As far as I can see, the issue is that BrowserKitDriver's getFieldPosition() method just enumerates all checkboxes with that name on the page.

However the latest dom-crawler release includes this commit which appears to skip over fields that are disabled hence the array indices are different.

I suspect this can be fixed by duplicating that logic so that getFieldPosition also skips disabled fields, but it might be better to try and make it more robust so that it's not relying on matching just by the array index?

Clicking on any input/button element can submit form

Right now code, that handles element clicking doesn't care about type attribute value of an input/button that is clicked and is causing form submission anyway.

I think we should only allow <input type="submit" .../> to submit a form, once clicked. I don't have any HTML reference about what in fact can submit a form, once clicked. If anybody have it, then please post it here.

Incompatible interface in 2.2.0 version

I have updated to 2.2.0 version and I receive this error
Fatal error: Declaration of Behat\Mink\Driver\BrowserKitDriver::visit(string $url) must be compatible with Behat\Mink\Driver\CoreDriver::visit($url) in /srv/api/vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php on line 120

findFormButton() is case sensitive when search for attributes

When getFormField() tries to find form button with findFormButton() it throws ElementNotFoundException. This happens when the button have type attribute setted as "Submit" instead of "submit".

I understand that it is a stupid thing set element attributes like that example, but I gues I should report this anyway...

foreach ($xpath->query('descendant::input | descendant::button', $root) as $node) {
    if ('button' == $node->nodeName || in_array($node->getAttribute('type'), array('submit', 'button', 'image'))) {
        return $node;
    }
}

When I added "Submit" at the in_array() function, showed above, to test, it worked. Maybe we can add a strtolower() in $node->getAttribute('type') to solve this.

Unable to set client IP when using setRequestHeader

Hello,

As we work for a "network" company, we need to simulate clients with different IP addresses in our functional tests.

To do that, we have written the following code :

$client->setRequestHeader("REMOTE_ADDR", $ip)

Currently, we succeeded to set this header correctly but we needed to hack the method setRequestHeader inside MinkBrowserKitDriver class because the current implementation of this method adds HTTP_ when the header is not set in $contentHeaders array.

As REMOTE_ADDR is a request header and as this one is not set in $contentHeaders array, the header name is currently replaced by "HTTP_REMOTE_ADDR" by the driver... Which is not correct.

To fix this problem, we only added REMOTE_ADDR into $contentHeaders array and noticed that everything is working as expected :

$contentHeaders = array('CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true, 'REMOTE_ADDR' => true);

Maybe MinkBrowserKitDriver could be upgraded with this fix, so that REMOTE_ADDR header will be supported too ?

What do you think about this case ?
Thank you for your feedback.

Back works differently from a browser

When using \Behat\Mink\Driver\BrowserKitDriver::back(), the back function behaves differently from a real browser such as Chrome.

In a real browser, redirects are ignored when going back. In this driver, redirect are not ignored and instead followed again.

Imagine the following requests made with a browser or this driver:

  1. http://www.example.org/1 [http 200]
  2. http://www.example.org/2 [http 302 => http://www.example.org/3]

A browser and this driver will now be at http://www.example.org/3.

Clicking back in the browser would take me back to http://www.example.org/1. Using back() on the driver will take me back to http://www.example.org/2, and then again to http://www.example.org/3.

I'm a bit new to this browser driver stuff, so I hope this is the right place to report this issue. Let me know if it is unclear.

The driver doesn't use the setted headers when I send a form

I have a test. This test set the accept-language header . When I "visit" the page, everythings all right. But when I click the submit button, the header doesn't send.

What is the correct solution?

  1. I set the header to the session (driver) and the client too:

        $this->getSession()->setRequestHeader($name, $value);
        $this->getSession()->getDriver()->getClient()->setRequestHeader($name, $value);
  2. Add extra row to BrowserKitDriver::send(), before send with client:

        $this->client->setServerParameters($this->serverParameters);
        $this->client->submit($form);
  3. Add extra $server parameter to \Symfony\Component\BrowserKit\Client::submit() function:

        public function submit(Form $form, array $values = array(), array $server = array())
        {
            $form->setValues($values);
    
            return $this->request($form->getMethod(), $form->getUri(), $form->getPhpValues(), $form->getPhpFiles(), $server);
        }

    and then in BrowserKitDriver::send():

        private function submit(Form $form)
        {
            // ...
            $this->client->submit($form, [], $this->serverParameters);
    
            $this->forms = array();
        }

[DX] "Crawler can't be initialized. Did you started driver?" exception unclear

First of all, I believe the exception message is invalid english and should be "Did you started the driver?".

But more importantly, this message is very unclear and hard to debug. For instance, I got this using the Goutte driver. That doesn't need to be started. After 30 minutes debugging, I discovered I got this message because I didn't call visitPath().

Memory usage or leak?

With the configuration below I've noticed memory usage that seems to increase as the tests run:

  • PHP 5.5.5
  • Symfony 2.3.7
  • Behat 2.5.0
  • Mink BrowserKit driver 1.1.0

After around 700 steps around 400MB had been allocated.

Seems to have been reported by other people: http://stackoverflow.com/questions/20107031/behat-eating-memory

Not sure if the responsibility of this driver to destroy or garbage collect, or if there is a bug somewhere else? Please reply back if more information needed.

Tag a new version

Hi,

Can you tag a new version to have a release compatible with Symfony 3?

Fix deprecation

https://travis-ci.org/minkphp/MinkBrowserKitDriver/jobs/581070517

1x: Method "Symfony\Component\HttpKernel\HttpKernelInterface::handle()" will return "Response" as of its next major version. Doing the same in child class "Behat\Mink\Tests\Driver\Util\FixturesKernel" will be required when upgrading.
    1x in BaseUrlTest::testBaseUrl from Behat\Mink\Tests\Driver\Custom
  1x: The "Behat\Mink\Tests\Driver\Custom\TestClient" class extends "Symfony\Component\BrowserKit\Client" that is deprecated since Symfony 4.3, use "\Symfony\Component\BrowserKit\AbstractBrowser" instead.
    1x in DeprecationErrorHandler::shutdown from Symfony\Bridge\PhpUnit
  1x: Method "Symfony\Component\BrowserKit\Client::doRequest()" will return "object" as of its next major version. Doing the same in child class "Behat\Mink\Tests\Driver\Custom\TestClient" will be required when upgrading.
    1x in DeprecationErrorHandler::shutdown from Symfony\Bridge\PhpUnit

Calling `$driver->getCookie(…)` produces exception, is there a correct way to avoid this?

When trying to get a cookie from the driver that wasn't navigated to any page yet, it will throw an exception, because the request is not set.

if ($request === null) {
    throw new DriverException('Unable to access the request before visiting a page');
}

The driver at that point is already started. I am wondering is there a proper way to prevent getting the exception? There is a private property $client, from which I could check if request is set, but it's not accessible.

Add Symfony 7 support

The Drupal project uses MinkBrowserKitDriver for tests and we are hoping to release Drupal 11 on Symfony 7.

Would it be possible to create a release that is compatible with Symfony 7?

Thanks

Can't get current url after session initialization

<?php
$session = new \Behat\Mink\Session(new \Behat\Mink\Driver\GoutteDriver);
$session->start();
$session->getCurrentUrl();

PHP Fatal error: Call to a member function getUri() on a non-object in mink-browserkit-driver/src/Behat/Mink/Driver/BrowserKitDriver.php on line 124

Ok, another try:

<?php
$session = new \Behat\Mink\Session(new \Behat\Mink\Driver\GoutteDriver);
$session->start();
$session->getPage()->getContent();

Fatal error: Call to a member function getContent() on a non-object in mink-browserkit-driver/src/Behat/Mink/Driver/BrowserKitDriver.php on line 319

Hmm.. and another one:

<?php
$session = new \Behat\Mink\Session(new \Behat\Mink\Driver\GoutteDriver);
$session->start();
$session->getPage()->getText();

Exception thrown: Behat\Mink\Exception\DriverException
Crawler can't be initialized. Did you started driver?

Only supports buttons but button provided

Trying to click on a button

<button type="button" id="register_register" name="register[register]" class="bt_ok">Create account</button>

the driver complains with the error:

Behat\Symfony2Extension\Driver\KernelDriver supports clicking on links and buttons only. But "button" provided

Fail after install

Installed from composer:

        "behat/behat":  "2.4.*@stable",
        "behat/symfony2-extension":      "*",
        "behat/mink-extension":          "*",
        "behat/mink-browserkit-driver":  "*",
        "behat/mink-selenium2-driver":   "*"

Just run behat, and get:

c:\develope\htdocs\chyrius>behat.bat

Fatal error: Class Behat\Mink\Driver\BrowserKitDriver contains 2 abstract method
s and must therefore be declared abstract or implement the remaining methods (Be
hat\Mink\Driver\DriverInterface::getScreenshot, Behat\Mink\Driver\DriverInterfac
e::resizeWindow) in C:\develope\htdocs\chyrius\vendor\behat\mink-browser
kit-driver\src\Behat\Mink\Driver\BrowserKitDriver.php on line 867

Case insentive search

Assume the page contains:

<form ...>
  <input type="text" name="name" />
  <input type="SUBMIT" value="login" />
</form>

I can't use ->fillField('name', 'Wouter') because it doesn't discover type="SUBMIT" as a submit button. When I change it to type="submit", all works fine.

Original issue: Behat/Mink#572

The driver fails when using a base url

When a base url is configured in the Behat MinkExtension, the symfony2 driver fails to resolve the url properly as it includes the base url inside the path passed to the routing. The browser client available in Symfony HttpKernel expects to receive only the path inside the application.

Removing the base url from the configuration is not an option for me as it is required for the scenario using selenium to use javascript.

Checking a checkbox fails with multiple 'new' options in collection

I have a simple form (symfony 2 collection type with choices):

<form action="/users" method="post" >
    <div>
        <label for="my_form_1">[email protected]</label>
        <input type="checkbox" id="my_form_1" name="my_form[users][]" value="1" />
    </div>
    <div>
        <label for="my_form_2">[email protected]</label>
        <input type="checkbox" id="my_form_2" name="my_form[users][]" value="2" />
    </div>
    <input type="submit" value="Submit" />
</form>
When I check "[email protected]"

This step fails with a php error:
PHP Fatal error: Call to a member function tick() on a non-object in ...vendor/behat/mink-browserkit-driver/src/Behat/Mink/Driver/BrowserKitDriver.php on line 448

It seems that the field names are normalized to my_form[users]. Because of that this line returns an array of both checkboxes instead of the appropriate one. The weird part is that the actual \DomNode found by the crawler is the correct one.

New release please?

The current dev-master supports Symfony 4 components, but the latest stable (1.3.2) does not. Any chance you could create a new release that works with Symfony 4 components?

getText() returns text other drivers does not

\Behat\Mink\Driver\BrowserKitDriver::getText() will return text in the head section and also any json on the page that's contained in a script tag in the HTML body. \Behat\Mink\Driver\Selenium2Driver::getText(), for example, will not return text from the head section or script tags in the body section. Given the Mink documentation states:

getText() will strip tags and unprinted characters out of the response, including newlines. So it’ll basically return the text that the user sees on the page.

I'm not sure if this is a Symfony\DomCrawler issue or not.

See for a discussion of the affects of this - https://www.drupal.org/project/drupal/issues/3175718

Cannot set numeric values in fields

if (!\is_string($value) && null !== $value) {

Even if the input types are defined as type="number" and a number is provided, the is_string validation will fail for these, making it impossible to set numeric values for numeric inputs. You can wrap them around quotes but I think this is a regression.

The code that "forces" inputs to be strings was introduced here: c1c3a2f

Symfony 5 support

Is there any way I could help? Should I send a PR? Can I drop support for old Symfony versions when things go south?

Missing methods from interface DriverInterface::getScreenshot & DriverInterface::resizeWindow [bug]

Class Behat\Mink\Driver\BrowserKitDriver contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (Behat\Mink\Driver\DriverInterface::getScreenshot, Behat\Mink\Driver\DriverInterface::resizeWindow) in /Applications/MAMP/htdocs/Symfony2/vendor/behat/mink-browserkit-driver/src/Behat/Mink/Driver/BrowserKitDriver.php

Please implement this 2 methods in BrowserKitDriver.php

Composer error: behat/mink-browserkit-driver vs symfony/symfony 3.0.*

(Complete) Composer error:

Problem 1
    - Installation request for symfony/symfony 3.0.* -> satisfiable by symfony/symfony[v3.0.0].
    - behat/mink-browserkit-driver v1.3.0 requires symfony/dom-crawler ~2.3 -> satisfiable by symfony/dom-crawler[v2.3.0, v2.3.1, v2.3.10, v2.3.11, v2.3.12, v2.3.13, v2.3.14, v2.3.15, v2.3.16, v2.3.17, v2.3.18, v2.3.19, v2.3.2, v2.3.20, v2.3.21, v2.3.22, v2.3.23, v2.3.24, v2.3.25, v2.3.26, v2.3.27, v2.3.28, v2.3.29, v2.3.3, v2.3.30, v2.3.31, v2.3.32, v2.3.33, v2.3.34, v2.3.35, v2.3.4, v2.3.5, v2.3.6, v2.3.7, v2.3.8, v2.3.9, v2.4.0, v2.4.1, v2.4.10, v2.4.2, v2.4.3, v2.4.4, v2.4.5, v2.4.6, v2.4.7, v2.4.8, v2.4.9, v2.5.0, v2.5.1, v2.5.10, v2.5.11, v2.5.12, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8, v2.5.9, v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.12, v2.6.2, v2.6.3, v2.6.4, v2.6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9, v2.7.0, v2.7.1, v2.7.2, v2.7.3, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.8.0].
    - don't install symfony/dom-crawler v2.3.0|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.1|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.10|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.11|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.12|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.13|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.14|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.15|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.16|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.17|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.18|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.19|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.2|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.20|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.21|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.22|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.23|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.24|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.25|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.26|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.27|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.28|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.29|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.3|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.30|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.31|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.32|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.33|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.34|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.35|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.4|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.5|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.6|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.7|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.8|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.3.9|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.0|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.1|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.10|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.2|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.3|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.4|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.5|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.6|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.7|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.8|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.4.9|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.0|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.1|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.10|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.11|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.12|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.2|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.3|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.4|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.5|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.6|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.7|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.8|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.5.9|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.0|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.1|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.10|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.11|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.12|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.2|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.3|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.4|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.5|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.6|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.7|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.8|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.6.9|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.7.0|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.7.1|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.7.2|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.7.3|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.7.4|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.7.5|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.7.6|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.7.7|don't install symfony/symfony v3.0.0
    - don't install symfony/dom-crawler v2.8.0|don't install symfony/symfony v3.0.0
    - Installation request for behat/mink-browserkit-driver ~1.3 -> satisfiable by behat/mink-browserkit-driver[v1.3.0].

The selected node does not have a form ancestor

Hello,

I am using sonata admin bundle and I am creating the test with behat to be sure that everything is working fine. But the problem is that when I try to add a new element using behat I get this error:

The selected node does not have a form ancestor.

The problem is because this button is out of the form but this is managed by sonata admin. So is there any way to click this button without get this error?

Checkbox inputs only supported as boolean flag

getValue($xpath) has this:

if ($field instanceof Field\ChoiceFormField && 'checkbox' === $field->getType()) {
    $value = '1' == $value;
}

So this means the html has to have value="1" in order to work with a checkbox. But its valid to have other values in a checkbox. And there forms that use checkboxes as alternative to multiple select element.

Likewise the isChecked($xpath) assuming a boolean value as well. So this would also need to be changed to use the checked state.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.