Behat / MinkExtension

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

input submit with Behat/MinkExtension #276

Open med004 opened 7 years ago

med004 commented 7 years ago

I have make test to add article in my project symfony but i have probleme in press input submit

this is code my feature:

`Feature: dossiertest

    @javascript

    Scenario: List 2 files in a directory

      Given I am on the homepage
      Then I should see "hello"
      When I go to "/ajoutermed"
      Then I should see "ajouter"
      And I wait 2 seconds
      And I fill in "test_medbundle_med_section" with "test section"
      And I fill in "test_medbundle_med_info" with "test info"
      And I press on "ajout"
      Then I should see "ajouter"

`

this is code context:

`/**

and this is code twig :

`

{{ msg }}

<form method="post" {{ form_enctype(form) }} >

{{ form_label(form.section) }}
{{ form_widget(form.section) }}
{{form_errors(form.section) }}
<br><br>

{{form_label(form.info) }}
{{ form_widget(form.info) }} {{form_errors(form.info) }}

{{ form_rest(form) }}

`

now i have this problem when i lunch my test in step "And I press on "ajout"

http://imgur.com/a/rpPLN

help me please for resolve this problem

med004 commented 7 years ago

help me please

spolischook commented 7 years ago

First of all you should format description of your issue, because it's hard to read. https://guides.github.com/features/mastering-markdown/ Second your code is weird, especially:

if (null === $element) {
  var_dump($element);
}

why you var dump null? I guess that screenshot with fail was produced by another code - please be consistent - add code and error that this code was produced

med004 commented 7 years ago

Can Be code or scenario behat ??? help me please I 'm blocked

med004 commented 7 years ago

alo help me please