punktde/codeception-webdriver

此软件包为codeception webdriver模块提供gherkin步骤

4.2.0 2024-07-02 11:19 UTC

README

Codeception Webdriver模块的gherkin步骤和附加模块功能

如何使用

存储文本并在以后进行比较的附加模块

在您的codeception.yaml文件中使用模块PunktDe\Codeception\Webdriver\Module\Storage

modules:
   enabled:
      - PunktDe\Codeception\Webdriver\Module\Storage

gherkin步骤

您可以在测试演员中使用特质PunktDe\Codeception\Webdriver\ActorTraits\Webdriver,这将添加浏览器控制、检查器、cookie功能和在框架或窗口之间切换的功能。或者,如果您只需要部分功能,可以使用以下特定特质

  • PunktDe\Codeception\Webdriver\ActorTraits\Checks
  • PunktDe\Codeception\Webdriver\ActorTraits\Controls
  • PunktDe\Codeception\Webdriver\ActorTraits\Cookie
  • PunktDe\Codeception\Webdriver\ActorTraits\Switchers

要使用存储模块的特质,请单独包括它,即使您已包括完整的PunktDe\Codeception\Webdriver\ActorTraits\Webdriver特质。

示例演员
<?php

/*
 *  (c) 2018 punkt.de GmbH - Karlsruhe, Germany - http://punkt.de
 *  All rights reserved.
 */

/**
 * Inherited Methods
 * @method void wantToTest($text)
 * @method void wantTo($text)
 * @method void execute($callable)
 * @method void expectTo($prediction)
 * @method void expect($prediction)
 * @method void amGoingTo($argumentation)
 * @method void am($role)
 * @method void lookForwardTo($achieveValue)
 * @method void comment($description)
 * @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL)
 *
 * @SuppressWarnings(PHPMD)
*/
class AcceptanceTester extends \Codeception\Actor
{
    use _generated\AcceptanceTesterActions;
    use \PunktDe\Codeception\Webdriver\ActorTraits\Webdriver; // use the webdriver steps trait
    use \PunktDe\Codeception\Webdriver\ActorTraits\Storage; // use the storage steps trait
}
有哪些步骤?

要获取所有可用的步骤,可以运行以下命令

vendor/bin/codecept -c path/to/codeception.yaml gherkin:steps suiteName

这将给出所有可用步骤的表格。