bex/behat-screenshot-image-driver-uploadpie

uploadpie.com 针对bex/behat-screenshot 扩展的图像驱动程序

1.0.3 2017-03-31 16:02 UTC

This package is auto-updated.

Last update: 2024-08-29 04:36:15 UTC


README

Scrutinizer Code Quality Build Status Build Status

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

安装

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

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

配置

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

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

您必须按如下方式配置认证(您可以在 此处 注册)

default:
  extensions:
    Bex\Behat\ScreenshotExtension:
      active_image_drivers: upload_pie
      image_drivers:
        upload_pie:
          auth: 'API_KEY' # can be your authentication key or and environment variable name

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

default:
  extensions:
    Bex\Behat\ScreenshotExtension:
      active_image_drivers: upload_pie
      image_drivers:
        upload_pie:
          expire: '1h' # possible values: '30m', '1h', '6h', '1d', '1w'

用法

当您运行 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 http://uploadpie.com/idoftheimage
    Then I should have a skipped step # FeatureContext::skippedStep()