probléme de press sur input submit en behat


Nom : 14904740893255_2.png
Affichages : 149
Taille : 28,3 Ko


behat.yml:


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
default:
    suites:
        default:
            bundle: MedBundle
            contexts:
                - test\MedBundle\Behat\Context\FeatureContext
                - test\MedBundle\Behat\Context\AjouterContext
    extensions:
        Behat\Symfony2Extension: ~
        Behat\MinkExtension:
            base_url: http://localhost/test/web/app_dev.php
            goutte: ~
            javascript_session: selenium2
            selenium2:
                wd_host: http://localhost:4444/wd/hub
            sessions:
                default:
                    symfony2: ~

dossierfeature.feature:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 "/login"
  And I fill in "username" with "med"
  And I wait 3 seconds
  And I fill in "password" with "123456"
  And I wait 3 seconds
  And I press "Connexion"
  And I wait 3 seconds
  Then I should see "Hello World!"
AjouterContext.php:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
 
namespace test\MedBundle\Behat\Context;
 
use Behat\Behat\Context\Context;
use Behat\Behat\Context\BehatContext;
use Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use Behat\MinkExtension\Context\MinkContext;
use test\MedBundle\Entity\Apps;
use test\MedBundle\Entity\Product;
 
/**
 * Defines application features from the specific context.
 */
class AjouterContext extends MinkContext
{
 
     /**
     * @When I press :arg1
     */
    public function iPress($arg1)
    {
            $element = $this->getSession()->getPage()->findById($arg1);
            if (null === $element) {
                var_dump($element);
            }
            $element->press();
 
    }
 
 
     /**
     * @Then I wait :arg1 seconds
     */
    public function iWaitSeconds($arg1)
    {
        $this->getSession()->wait($arg1 * 1000);
    }
 
 
}
aide moi pour résolu cette probléme et merci d'avance