Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 PHP 开发大型项目,并且正在使用 PHPUnit 运行 phpundercontrol 以进行单元测试。我想使用 Selenium RC 来运行验收测试。不幸的是,我剩下的唯一一个编写测试的人只知道 Python。用 Python 编写的 Selenium 测试可以集成到 PHPUnit 中吗?
谢谢!
我唯一想到的就是通过外壳运行它们。这将是:
<?php $output = shell_exec('python testScript.py'); echo $output; ?>
它与 phpunit 并没有太集成,但是一旦你在一个变量 ($output) 中得到输出,你就可以解析它里面的文本,看看你是否有“E”或“.”。(“E”状态表示 pyunit 中的错误,“。”状态表示通过)。
这是我能想到的最好的东西,希望对您有所帮助。