Mink icon indicating copy to clipboard operation
Mink copied to clipboard

Mink strips out :

Open Ghostff opened this issue 6 years ago • 8 comments

Mink is striping out : from string example: And I fill in "time" with "10:10" is filled out with 1010 also

When I fill in the following:
    | description  | Some random: test description  |

Is filled out with Some random test description

Ghostff avatar Jun 14 '19 16:06 Ghostff

Is the stripping done by Mink, by Behat of my something between them ? Please provide a reproducer using Mink directly.

stof avatar Jun 17 '19 09:06 stof

Also, which Mink driver are you using ?

stof avatar Jun 17 '19 09:06 stof

"behat/behat": "^3.5",
"behat/mink-extension": "^2.3",
"behat/mink": "^1.7",
"behat/mink-goutte-driver": "^1.2",
"behat/mink-selenium2-driver": "^1.3"

"Please provide a reproducer using Mink directly" sorry how do i do this?

Ghostff avatar Jun 17 '19 15:06 Ghostff

I dont know the actual cause if this, but this is what am using temporally

/**
* Fills in form field with specified id|name|label|value
* Example: When I fill in "time" with raw "10:10"
*
* @When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with raw "(?P<value>(?:[^"]|\\")*)"$/
* @param string $field
* @param string $value
*/
public function fillRaw(string $field, string $value)
{
    $this->getSession()->evaluateScript("document.getElementsByName('{$field}')[0].value = '{$value}';");
}

Ghostff avatar Jun 18 '19 16:06 Ghostff

have a look at the functional testsuite of drivers (available at https://github.com/minkphp/driver-testsuite). This gives lots of examples of using Mink directly (to remove any effect coming from other layers).

And you still haven't told us which driver you are using

stof avatar Jun 19 '19 09:06 stof

behat.yml

default:
  autoload:
    '': tests/behat/bootstrap
  suites:
    default:
      paths:
        features: "%paths.base%/tests/behat/"
      contexts:
        - BehatContexts\FeatureContext
    extensions:
      Behat\MinkExtension:
        base_url: https://www.wikipedia.org/
        browser_name: chrome
        goutte: ~
        selenium2:
          wd_host: http://127.0.0.1:4444/wd/hub
          browser: chrome
          capabilities:
            chrome:
              switches:
                - "--window-size=1920,1080"

Ghostff avatar Jun 19 '19 13:06 Ghostff

this config creates 2 Mink sessions, one using GoutteDriver and one using Selenium2Driver. This does not tell me which one is used for your issue.

stof avatar Jun 19 '19 14:06 stof

selenium2 the scenarios use @javascript

Ghostff avatar Jun 21 '19 13:06 Ghostff