bex/behat-screenshot-image-driver-unsee

unsee.cc图像驱动程序,用于bex/behat-screenshot behat扩展

1.0.0 2015-11-14 09:05 UTC

This package is auto-updated.

Last update: 2024-08-29 03:31:41 UTC


README

Scrutinizer Code Quality Build Status Build Status

此包是bex/behat-screenshot behat扩展的图像驱动程序,可以将截图上传到Unsee并打印上传图像的URL。

安装

通过将以下内容添加到您的composer.json中安装

composer require --dev bex/behat-screenshot-image-driver-unsee

配置

behat.yml中Behat-ScreenshotExtension的配置中启用图像驱动程序,如下所示

default:
  extensions:
    Bex\Behat\ScreenshotExtension:
      active_image_drivers: unsee

您可以根据如下方式配置上传图像的过期时间(默认为10分钟)

default:
  extensions:
    Bex\Behat\ScreenshotExtension:
      active_image_drivers: unsee
      image_drivers:
        unsee:
          expire: '10m' # possible values: '10m', '30m', '1h'

使用方法

当您运行behat且某个步骤失败时,Behat-ScreenshotExtension将自动截图并将它传递给图像驱动程序,该程序将上传图像并返回上传图像的URL。因此,您会看到如下内容

  Scenario:                           # features/feature.feature:2
    Given I have a step               # FeatureContext::passingStep()
    When I have a failing step        # FeatureContext::failingStep()
      Error (Exception)
Screenshot has been taken. Open image at https://unsee.cc/idoftheimage
    Then I should have a skipped step # FeatureContext::skippedStep()