co-stack/stack-test

dev-master 2024-07-24 09:11 UTC

This package is auto-updated.

Last update: 2024-08-24 07:23:33 UTC


README

特性

  • 无配置即可开始。
  • 针对任何可能的元素、内容等的断言,数量众多。
  • 断言也可以用作条件与期望(用于等待浏览器中发生某些事情)
  • 比像codeception这样的测试框架简单得多
  • 完全基于PHPUnit,因此完全集成到PhpStorm中。
  • 易于处理表单(获取和设置表单数据)

为失败的测试启用截图等功能

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
>
    <!-- Add the extension section to your phpunit.xml file and adjust the paths as needed -->
    <extensions>
        <bootstrap class="CoStack\StackTest\Bootstrap">
            <parameter name="screenshot" value="build/test/artifacts/{testClass}/{testMethod}/{seed}.jpg"/>
            <parameter name="pageSource" value="build/test/artifacts/{testClass}/{testMethod}/{seed}.html"/>
            <parameter name="history" value="build/test/artifacts/{testClass}/{testMethod}/{seed}.history.txt"/>
        </bootstrap>
    </extensions>
</phpunit>

重要事项

  • Firefox总是设置cookie secure = true
  • 没有value属性的选项不能通过值选择