erolatex/wbisualception

Codeception 的视觉回归测试(从 https://github.com/nixdrey/VisualCeption 分支而来)

1.0.6.4 2023-01-23 14:45 UTC

README

在此处查看项目文档:https://github.com/Codeception/VisualCeption

安装

composer require "erolatex/wbisualception:*" --dev

添加了什么?

像素比支持和 png 压缩级别选项

如果你使用带有自定义 pixelRatio 选项的移动仿真,则需要定义 VisualCeption 的 pixelRatio

acceptance.suite.yml

modules:
    enabled:
        - WebDriver:
             capabilities:
                 ...
                 chromeOptions:
                     ...
                     mobileEmulation:
                         deviceMetrics:
                             height: 812
                             width: 375
                             pixelRatio: 3.0

只需添加 pixelRatio 选项

modules:
    enabled:
        - VisualCeption:
            maximumDeviation: 0.05                                 # deviation in percent
            saveCurrentImageIfFailure: false                       # if true, VisualCeption saves the current
            pixelRatio: 3.0                                        # pixel ratio

如果你想更改所有截图的 png 压缩级别,请添加 compressionLevel 选项:

modules:
    enabled:
            compressionLevel: 0                                       # compression for png images 0-9 ( default:0 )