weixin_33725126 2016-08-03 10:10 采纳率: 0%
浏览 28

僵尸:ajax调用不起作用

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 ?

  • 写回答

1条回答 默认 最新

  • 胖鸭 2016-08-03 14:15
    关注

    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);
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置