Перейти к содержимому

Sova

Регистрация: 16 мая 2015
Offline Активность: 20 мая 2015 16:28
-----

Мои темы

Помощь с документацией

16 мая 2015 - 13:55

Здравствуйте. Так уж получилось, что меня попросили составить техническую документацию, а я в этом вообще практически не разбираюсь, но уже достаточно много прочла и ознакомилась с информацией по данной теме.

Мне дали несколько тестовых файлов: smoke-test, limit и basic (файлы в разрешении features). Вроде бы все просто, но никак не могу понять, как писать эту документацию, не могли бы вы мне помочь хотя бы сделать набросок по этой документации, это очень сильно мне поможет.

 

Содержание файла basic.feature вот такое:

# vim: set tabstop=2 shiftwidth=2 softtabstop=2 et:
Feature: allocate and deallocate resources
  Users can ask the service to allocate a resource, or deallocate it if it is
  not needed anymore.
  Resources are allocated by the user name and deallocated by the resource name.
  User can request the list of all the allocated and deallocated resources,
  or just the list of allocated resources by him only.
  The service provides an ability to reset its state so that all the resources
  become deallocated.
 
  Example:
  $ curl http://resm.tld/reset
  $ curl http://resm.tld/allocate/bob
  resource#1
  $ curl http://resm.tld/list
  {"allocated":{"resource#1":"bob"},"deallocated":[...]}
  $ curl http://resm.tld/list/bob
  ["resource#1"]
 
Scenario: list resources before allocation
  Given an empty pool
  When a user "alice" lists resources
  Then status code should be 200
  And the resources list should be empty
 
Scenario: list all resources before allocation
  Given an empty pool
  When a user lists all resources
  Then status code should be 200
  And the allocated resources list should be empty
 
Scenario: deallocate resource before allocation
  Given an empty pool
  When a user deallocates resource "resource"
  Then status code should be 404
  And an error message should be "Not allocated"
 
Scenario: allocate resource
  Given an empty pool
  When a user "alice" allocates resource
  Then status code should be 201
  And the response should be not empty
 
Scenario: list resources after allocation
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user "alice" lists resources
  Then status code should be 200
  And the resources list should be
    | resource |
    | %a%      |
 
Scenario: list all resources after allocation
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user lists all resources
  Then status code should be 200
  And the allocated resources list should be
    | user  | resource |
    | alice | %a%      |
 
Scenario: deallocate resource after allocation
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user deallocates resource "%a%"
  Then status code should be 204
  And the response should be empty
 
Scenario: duplicate allocate resource
  Given an empty pool
  When a user "alice" allocates resource
  And a user "alice" allocates resource
  Then status code should be 201
  And the response should be not empty
 
Scenario: list resources after duplicate allocation
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user "alice" allocates resource "b"
  And a user "alice" lists resources
  Then status code should be 200
  And the resources list should be
    | resource |
    | %a%      |
    | %b%      |
 
Scenario: list resources after deallocation
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user deallocates resource "%a%"
  And a user "alice" lists resources
  Then status code should be 200
  And the resources list should be empty
 
Scenario: duplicate deallocate resource after allocation
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user deallocates resource "%a%"
  And a user deallocates resource "%a%"
  Then status code should be 404
  And an error message should be "Not allocated"
 
Scenario: allocate resource after deallocation
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user deallocates resource "%a%"
  And a user "alice" allocates resource
  Then status code should be 201
  And the response should be not empty
 
Scenario: list only own resources
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user "bob" allocates resource "b"
  And a user "alice" allocates resource "c"
  And a user "alice" lists resources
  Then status code should be 200
  And the resources list should be
    | resource |
    | %a%      |
    | %c%      |
 
Scenario: list all resources for several users
  Given an empty pool
  When a user "alice" allocates resource "a"
  And a user "bob" allocates resource "b"
  And a user "alice" allocates resource "c"
  And a user lists all resources
  Then status code should be 200
  And the allocated resources list should be
    | user  | resource |
    | alice | %a%      |
    | bob   | %b%      |
    | alice | %c%      |