【问题标题】:Error while processing event 'click': "SyntaxError: Unexpected token u\n处理事件“点击”时出错:“SyntaxError: Unexpected token u\n
【发布时间】:2016-12-09 19:50:11
【问题描述】:

我正在使用 MinkZombieDriver 的基本功能。我的 节点 -v 5.2.0,npm -v 3.10.5,水貂僵尸驱动程序 v1.4.0 ..

behat.yml

默认值:

extensions:
     Behat\MinkExtension:
         base_url: 'https://example.com'
         javascript_session: zombie
         zombie:
             node_modules_path: '/home/ubuntu/node_modules'
         goutte: ~

路径: 特点:特点 引导程序:%behat.paths.features%/bootstrap

我写了一个简单的功能,它给出了 Behat\Mink\Exception\DriverException

@javascript

场景:查看产品以分配商店

Given I am on "/index.php"                                                                                          # FeatureContext::visit()
When I fill in "Username" with "hello"                                                                            # FeatureContext::fillField()
When I fill in "Password" with "123"                                                  # FeatureContext::fillField()
And I should see "Manage Your Accounts"                                                                             # FeatureContext::assertPageContainsText()
When I press "login_button"                                                                                         # FeatureContext::pressButton()
  Error while processing event 'click': "SyntaxError: Unexpected token u\n    at Object.parse (native)\n    

我在网上搜索但不知道如何解决。我仍在使用基本的默认功能。我知道问题出在 JSON 解析上。我不确定我做错了什么?我期待着任何建议.. 谢谢..

【问题讨论】:

标签: mink zombie.js


【解决方案1】:

从我的评论链接看来,您需要将僵尸版本更新到至少版本 2。

请注意,您可能需要解决一些兼容性问题。

也检查这个答案nodejs cannot find module 'zombie' with PHP mink

【讨论】:

  • 我在安装packagist.org/packages/behat/mink-zombie-driver 时关注了这个软件包列表,并关注了mink.behat.org/en/latest/drivers/zombie.html。我也看到了你建议的链接,我想我错过了僵尸版本..我会调查一下。
  • 我也在使用/home/ubuntu └─┬zombie@4.2.1
  • 你是如何安装 behat 的?你有可以提供的 composer.json 吗?你如何管理依赖关系?
  • 我确实有 composer.json .. 比如 "require": { "php": ">=5.3.3", "ext-mbstring": "", "behat/gherkin ":"~4.3", "behat/transliterator": "~1.0", "symfony/console":"~2.1", "symfony/config": "~2.3", "symfony/dependency-injection": "~ 2.1", "symfony/event-dispatcher":"~2.1", "symfony/translation":"~2.3", "symfony/yaml":"~2.1", "symfony/class-loader":"~2.1" , "behat/mink": "", "behat/mink-extension": "", "behat/mink-selenium2-driver":"", "behat/mink-僵尸驱动程序“:”*“},“最低稳定性”:“开发”,“配置”:{“bin-dir”:“bin/”}
猜你喜欢
  • 1970-01-01
  • 2014-04-17
  • 2017-06-24
  • 1970-01-01
  • 1970-01-01
  • 2013-12-21
  • 2016-10-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多