gpt4 book ai didi

python - 用 Python 编写的 Selenium RC 测试可以集成到 PHPUnit 中吗?

转载 作者:太空宇宙 更新时间:2023-11-03 19:39:22 25 4
gpt4 key购买 nike

我正在 PHP 中处理大型项目,并且我正在使用 PHPUnit 运行 phpundercontrol 进行单元测试。我想使用 Selenium RC 来运行验收测试。不幸的是,我剩下的唯一编写测试的人只懂Python。用 Python 编写的 Selenium 测试可以集成到 PHPUnit 中吗?

谢谢!

最佳答案

我唯一想到的就是通过 shell 运行它们。它将是:

<?php
$output = shell_exec('python testScript.py');
echo $output;
?>

它与 phpunit 的集成度不太高,但是一旦您在变量 ($output) 中获得输出,您就可以解析其中的文本以查看是否有“E”或“.”。 (“E”表示 pyunit 中的错误,“.”表示通过)。

这是我能想到的最好的办法,希望对你有帮助。

关于python - 用 Python 编写的 Selenium RC 测试可以集成到 PHPUnit 中吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1350114/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com