php - 如何修复 behat 脚本中的 behat 'DMore\ChromeDriver\StreamReadException'

标签 php drupal-8 behat

我正在执行我的 behat 脚本并收到以下异常:

/vendor/dmore/chrome-mink-driver/src/DevToolsConnection.php 中的 DMore\ChromeDriver\StreamReadException

我在本地和 Acquia 管道中遇到以下异常。奇怪的是,此异常并非每次都出现,而是每次出现在不同的步骤定义中。

@smoke
Feature: Test SEARCH box
  @javascript @api @errors
  Scenario: Test For the SEARCH box                                                                                     
    Given I am on "/"
                                                                                                   # Drupal\DrupalExtension\Context\MinkContext::visit()
DMore\ChromeDriver\StreamReadException in /<project_folder>/vendor/dmore/chrome-mink-driver/src/DevToolsConnection.php

最佳答案

这个解决方案对我有用。在您的代码中使用 'socket_timeout' 的地方只需增加时间

在我的配置文件中

local.yml

sessions:
        default:
          chrome:
            # Set the optimal Socket Timeout to avoid client-server connection problems in behat scripts.
            socket_timeout: 60

关于php - 如何修复 behat 脚本中的 behat 'DMore\ChromeDriver\StreamReadException',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54748481/

相关文章:

drupal-forms - Drupal 8, 'managed file' 字段的默认值

selenium - Behat + selenium 2 等待页面加载

javascript - 使用 javascript 在 laravel 中进行 Behat 测试 - 不使用测试环境

behat - 使用 Behat 预定义步骤的翻译(Phar 安装)

php - 交响乐 2.8 : Cannot get current user in Service (FosUserBundle)

php - 德鲁帕尔 8 : Debugging tests with XDebug and PHPStorm - cennot step through

php - 这是装饰器模式(PHP)吗?

CSS Bootstrap 子主题 drupal 8

php - 有没有办法在不提交的情况下获取当前选择框选项的值?

php - 如何使 C 中的 system() 命令不在屏幕上显示任何内容?