lingoda / behat-screenshot-image-driver-aws-s3
AWS S3 图像驱动程序,用于 bex/behat-screenshot behat 扩展
0.1.4
2019-01-09 05:58 UTC
Requires
- php: >=5.4
- aws/aws-sdk-php: ^3.20
- bex/behat-screenshot: ^1.0
Requires (Dev)
- behat/mink-selenium2-driver: ^1.3.0
- bex/behat-test-runner: ^1.1
- jakoch/phantomjs-installer: ^1.9.8
- phpspec/phpspec: ^2.4.0
README
本软件包是 bex/behat-screenshot behat 扩展的图像驱动程序,可以将图像上传到 S3。
安装
通过将以下内容添加到您的 composer.json
中进行安装
composer require --dev lingoda/behat-screenshot-image-driver-aws-s3
配置
在 behat.yml
中的 Behat-ScreenshotExtension 配置中启用图像驱动程序,如下所示
default: extensions: Bex\Behat\ScreenshotExtension: active_image_drivers: aws_s3 image_drivers: aws_s3: bucket: BUCKET # Required region: REGION # Required version: latest # Default credentials_key: AWS_S3_KEY # Optional credentials_secret: AWS_S3_SECRET # Optional credentials_token: AWS_S3_TOKEN # Optional timeout: 30 # Optional, number of minutes the screenshot will be available when private visibility: public-read # Optional, can be only public-read or private
用法
当您运行 behat 且某个步骤失败时,Behat-ScreenshotExtension 将自动截取屏幕截图并将其传递给图像驱动程序,该程序将返回 S3 图像 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://us-west-1.aws.com/.... Then I should have a skipped step # FeatureContext::skippedStep()