kaystrobach/behat-extension

此包的最新版本(dev-master)没有可用的许可证信息。

dev-master 2017-05-30 19:11 UTC

This package is auto-updated.

Last update: 2024-09-06 08:34:57 UTC


README

包含使用behat测试几个服务的基本功能

使用方法如下(服务将逐步添加,并非所有服务从一开始就可用)

class FeatureContext extends \Behat\MinkExtension\Context\MinkContext {
    /**
     * Initializes context.
     *
     * Every scenario gets its own context instance.
     * You can also pass arbitrary arguments to the
     * context constructor through behat.yml.
     */
    public function __construct()
    {
        \KayStrobach\BehatExtension\Utility\LoaderUtility::loadContexts($this);
    }
}

示例

对给定url的SSL检查

Feature: Schullogin is basicly available
  #@mink:selenium2

  Scenario: SSL Opal
    Then the domain Qualys SSL check should be atleast "A" for uri "https://www.google.de"

但您也可以使用当前url,而不是通过场景提供完整的url

Feature: Schullogin is basicly available
  #@mink:selenium2

  Scenario: SSL Opal
    Given I am on "/"
    Then the Qualys SSL check should be atleast "A"

SSL检查可以处理很多状态。

这样我们就可以使用atleast语句。

IMAP检查

Feature: Imap Server
  #@mink:selenium2

  Scenario: Check Imap Server
    Given I connect to imap server "{mail.example.com:143/imap/novalidate-cert}" as "user" with password "password"
    Then I can list mailboxes
    Then I can read messages from inbox

telnet检查

Feature: Telnet Server
  #@mink:selenium2

  Scenario: Check Telnet Server

    I connect to telnet server "telnet.example.com" on port "25" with timeout "30"

计划功能

目前计划添加对以下内容的检查

  • 邮件服务器安全
  • ssh
  • rdp
  • vnc
  • git
  • ...