我正在尝试在 MFTF 2.3.14 和 Magento 2.3.1 创建自定义测试用例。我将StorefrontPersistedCustomerLoginTest.xml
其用作模板并StorefrontLoginRequiredFieldTest.xml
通过仅发送电子邮件和密码字段的空字符串并验证错误消息来尝试自定义测试。当我尝试运行测试时,出现以下错误。
In TestObjectHandler.php line 81:
Test StorefrontLoginRequiredFieldTest not defined in xml.
我在下创建了自定义测试
/var/www/html//var/www/html/magtiretest/app/code/ISNEZTire/login-
module/Test/Mftf.
我尝试了现有的工作测试用例
StorefrontPersistedCustomerLoginTest.xml
,只是更改了测试的名称(测试名称以外的内容)与现有的相同)并运行。使用新名称,即使现有的测试用例也无法正常工作。我没有将自定义测试保存在新文件夹中
/var/www/html//var/www/html/magtiretest/app/code/ISNEZTire/login- module/Test/Mftf
,而是将其保存在现有工作测试所在的文件夹中。
仍然得到:
In TestObjectHandler.php line 81:
Test StorefrontLoginRequiredFieldTest not defined in xml.
.env 文件
MAGENTO_BASE_URL=http://99.33.111.248/magtiretest/
MAGENTO_BACKEND_NAME=admin
MAGENTO_ADMIN_USERNAME=admin
MAGENTO_ADMIN_PASSWORD=admin@123
BROWSER=chrome
//TESTS_BP=~/magtiretest/dev/tests/acceptance/tests/functional
//FW_BP=~/magtiretest/vendor/magento/magento2-functional-testing-
framework
//FW_BP=~/magento/magento2-functional-testing-framework
//MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,
Magento_ConfigurableProductCatalogSearch,Magento_login-module
MODULE_WHITELIST=Magento_login-module,Magento_Framework
CUSTOM_MODULE_PATHS=/var/www/html/magtiretest/app/code/ISNEZTire/login-
module
SELENIUM_HOST=SELENIUM_HOST=127.0.0.1
SELENIUM_PORT=4444
SELENIUM_PROTOCOL=http
SELENIUM_PATH=/wd/hub
我也尝试了所有评论的配置