Behat / MinkExtension

Mink extension (tight integration and configuration) for Behat
MIT License
636 stars 276 forks source link

Checkbox check doesn't work with value #239

Open gimler opened 8 years ago

gimler commented 8 years ago

The following doesn't work with goutte and selenium2 driver

Feature: checkbox

  Scenario: checkbox check
    Given I am on "http://127.0.0.1:8080/form.html"

    And the "fuuu" checkbox should be checked # id works
    And the "foo" checkbox should be checked # name works
    And the "Label" checkbox should be checked # label works
    And the "bar" checkbox should be checked # value failed

see also https://github.com/minkphp/MinkGoutteDriver/issues/74

composer.json

{
    "require": {
        "behat/behat": "3.1.*",
        "behat/mink": "1.7.1",
        "behat/mink-extension": "2.2",
        "behat/mink-goutte-driver": "1.2.1"
    },
    "config": {
        "bin-dir": "bin/"
    }
}

html

<html>
<head>
</head>
<body>
<form action="#">

    <label for="fuuu">Label</label>
    <input type="checkbox" id="fuuu" name="foo" value="bar" checked>

    <input type="submit" value="send">

</form>
</body>
</html>

behat.yml

default:
    extensions:
        Behat\MinkExtension: 
            base_url: 'http://127.0.0.1'
            show_cmd: 'firefox %s'
            default_session: http
            javascript_session: javascript
            sessions:
                http:
                    goutte:
                        guzzle_parameters:
                            verify: false
                javascript:
                    selenium2:
                        wd_host: "http://localhost:8643/wd/hub"
        Sanpi\Behatch\Extension: ~

    suites:
        default:
            contexts:
                - FeatureContext
                - Behat\MinkExtension\Context\MinkContext
                - behatch:browser

run with php -S 127.0.0.1:8080

stevenkroiher commented 8 years ago

👍

Kris1992 commented 4 years ago

I had the same problem.