pagantis/selenium-form-utils

Pagantis PHP 库。用于结束测试购买的 Selenium 辅助工具。用于测试支付验证和重定向

v3.0.3 2020-03-16 12:19 UTC

This package is auto-updated.

Last update: 2024-09-11 18:17:48 UTC


README

CircleCI: CircleCI

Latest Stable Version composer.lock Scrutinizer Code Quality

Selenium Form Utils 将帮助您开发 Pagantis 的集成测试。这些工具将传递 Pagantis 表单,以确保您可以测试通知和重定向。请确保 KO 和 OK 控制器正常工作。您可以使用 travis-ci 或 circle-ci 自动化测试。

如何使用

通过以下方式安装库:

  • 此处下载

  • 使用 Composer

composer require pagantis/selenium-form-utils

最后,请确保包含自动加载器

require_once '/path/to/your-project/vendor/autoload.php';

一旦库就绪并在项目中,存根对象将可用,ordersApiClient 也将可用。

// Once the webDriver of selenium is inside Pagantis form, basically:
// $webdriver->getCurrentUrl == 'form.pagantis.com/....'
// Then you can use this tool to finish the form:

SeleniumHelper::finishForm($this->webDriver);

//The method will end once the form is approved, so the current URL will be OK_URL of the order
//Optionally you can also send the mobilePhone if the user is returning

SeleniumHelper::finishForm($this->webDriver, '600123123');

您还可以检查取消操作的自动化

SeleniumHelper::cancelForm($this->webDriver);

开发和改进库

修改后,请运行精确测试

docker-compose up -d

docker-compose exec php php-7.1 vendor/bin/phpunit

帮助我们改进

我们很高兴接受建议或拉取请求。如果您愿意帮助我们开发更好的软件,请在此处创建拉取请求,遵循 PSR-2 代码风格,我们将使用 reviewable 检查代码,如果所有测试通过且 SensioLab Insights 未发现任何问题,您就可以准备合并。