Page MenuHomePhabricator

Phester: support step prototypes
Closed, InvalidPublic

Description

Step prototypes can be used to avoid boiler plate. Interaction steps (request/response pairs) can specify which prototype they inherit from. Prototypes are defined (on the suite level - and maybe in fixtures?) as an object containing partially defined interaction steps (request/response pairs).

Example:

prototypes:
  edit:
      request:
        method: post
        path: api.php
        parameters:
          action: edit
          format: json
        form-data:
          token: p/var: edit-token
      response:
        body:
          edit:
            result: Success
tests:
  - description: "something something"

    interaction:
    - inherit: edit # inherit from prototype
      request:
        parameters:
          title: Foo
          createonly: true
        form-data:
          comment: first edit
          text: Just a test