mercredi 5 juillet 2017

Testing Shopware Login with Behat Mink

I cannot seem to figure this one out.

I defined the following feature:

Feature: Login

  Scenario: Test Basic Login
    Given I am on "/account"
    And I login successfully as "demo@demo.de" with password "demodemo"
    Then I should see "Abmelden"

The feature context looks the following:

/**
 * @Given I login successfully as :arg1 with password :arg2
 */
public function iLoginSuccessfullyAsWithPassword($arg1, $arg2)
{
    $page = $this->getSession()->getPage();
    $page->fillField('email', $arg1);
    $page->fillField('password', $arg2);
    $page->pressButton('Anmelden');
}

And to give a complete picture here my behat.yml:

default:
  extensions:
  Behat\MinkExtension:
    base_url: "http://ift.tt/2tft6l0"
    default_session: 'goutte'
    javascript_session: 'selenium2'
    goutte: ~
    selenium2: ~

Now The scenario runs well until I should see "Abmelden". Then I get

The text "Abmelden" was not found anywhere in the text of the current page. (Behat\Mink\Exception\ResponseTextException)

This is very frustrating since I actually should be seeing "Abmelden"...

I have tried this with multiple versions and configurations of behat / mink. I have also tried looking for other text content on the user dashboard. But it seems I am missing a very fundamental piece of information here.

Aucun commentaire:

Enregistrer un commentaire