0

I'm using behat/mink with zombie.js for testing. Everything workedwell so far, until I wanted to test an ajax call. I'm using an API (fixer.io) to convert money. This part works well : the user choose the original currency, number of items, set the price and the amount is automatically converted into euro.

In my js test with zombie, I fill every fields and the user should see the amount in original currency + converted in euro. But the converted amount doesn't show on the page : the ajax call always return error. then I saw this issue https://github.com/assaf/zombie/issues/417 .

There is absolutely no way to test xhr sync with zombie ?

ramsey_lewis
  • 558
  • 8
  • 25

1 Answers1

0

Resolved with the Use Promises part of this answer How do I return the response from an asynchronous call? And the by telling to behat to wait for my ajax callback.

/**
* @Given I wait
*/
public function iWait()
{
    $this->getSession()->wait(5000);
}
Community
  • 1
  • 1
ramsey_lewis
  • 558
  • 8
  • 25