devshop / behat-extension
为Behat添加扩展,增强DevShop上的Drupal功能
dev-component/devshop-behat-extension
2021-04-06 13:00 UTC
Requires
- drupal/drupal-extension: ^4.1
This package is auto-updated.
Last update: 2024-09-06 20:43:04 UTC
README
此Behat扩展简单扩展了Drupal Behat Extension,使其更有用。
它不要求使用DevShop,但一些功能在使用DevShop时甚至更好。
新步骤
然后我截图
此步骤,当与Selenium服务器一起使用且测试具有"@javascript"标签时,将保存截图到活动网站的文件文件夹并打印链接。
当我运行"命令"时
此步骤简单地执行exec()
操作,如果抛出非零退出代码则抛出异常。
我选择包含字符串:label的标签的单选按钮
这对于具有长或动态标签的单选按钮非常有用。搜索字符串而不是进行精确匹配。
其他功能
简化设置。
现在,此插件包含在DevShop Composer Template中,这是在DevShop中运行Drupal代码库的最简单方法。
如果您已经有了项目,可以将tests
文件夹的整个内容复制到您的项目中。
要启动新项目,使用命令
composer create-project devshop/composer-template:8.x-dev --stability dev --no-interaction mynewproject
步骤失败信息
当任何步骤失败时,测试运行器输出它所在的URL,将HTML和截图保存到可读文件夹,并给您一个链接,如下所示
Feature: DevShop.Support Registration In order to use DevShop.Support As a customer I need to register a new account. @api @javascript Scenario: Pre-beta registration # features/demos.feature:7 Given I am an anonymous user # Drupal\DrupalExtension\Context\DrupalContext::assertAnonymousUser() When I am on "home" # Drupal\DrupalExtension\Context\MinkContext::visit() And I take a screenshot # FeatureContext::iTakeAScreenshot() │ Screenshot: http://pr35.devshop.support/sites/pr35.devshop.support/files//screenshot0U4Ddt.png │ Then I should see "Host Your Own Drupal" # Drupal\DrupalExtension\Context\MinkContext::assertPageContainsText() Element not found with xpath, //html (WebDriver\Exception\NoSuchElement) │ │ Step Failed. │ Site: pr35.devshop.support │ Current URL: http://pr35.devshop.support/home │ Screenshot: http://pr35.devshop.support/sites/pr35.devshop.support/files/test_failures//IshouldseeHostYourOwnDrupalNLpp17.png │ Last Page Output: http://pr35.devshop.support/sites/pr35.devshop.support/files/test_failures/failure-1539455962.html │ │ Watchdog Errors: │ ID Date Type Severity Message │ 42785 13/Oct 14:39 page not warning favicon.ico │ found │ 42784 13/Oct 14:39 page not warning favicon.ico │ found │ 42783 13/Oct 14:39 actions info 5 orphaned actions │ (comment_publish_action, │ comment_save_action,
还有很多功能正在开发中!