NAME

Test::BDD::Infrastructure::HTTP - cucumber step definitions for http based checks

VERSION

version 1.005

Synopsis

  Scenario: A URL must be reachable
    Given the http URL https://markusbenning.de/
    When the http request is sent
    Then the http response must be a redirect
    And the http response status code must be 302
    And the http response status message must be like ^Found
    And the http response header Location must be like ^https://markusbenning.de/blog/
    And the http response header Content-Type must be like text/html
    And the http response content must be like The document has moved
    And the http response content size must be at least 200 byte

Step definitions

The test must start with

  Given the URL <url>

followed by additional parameters.

Then the request is sent with:

  When the http request is sent

After the request has been sent the response could be examined with response checks:

  Then the http response ...

Additional request parameters

  Given the http user agent is <agentstring>
  Given the http proxy for <protocol> is <url>
  Given the http ssl option <option> is <value>
  Given the http request method is <method>
  Given the http request header <header> is set to <value>
  Given the http timeout is set to <timeout> seconds

Response checks

  Then the http response must be (a )<successfull|error|failure|redirect|info>
  Then the http response status code must be <code>
  Then the http response status message must be like <regex>
  Then the http response header <header> must be like <regex>
  Then the http response content must be unlike <regex>
  Then the http response content must be like <regex>
  Then the http response content size must be <compare> <count> <unit>

AUTHOR

Markus Benning <ich@markusbenning.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2015 by Markus Benning.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.