~florent.x/oerpscenario/trunk-with-buildout2

« back to all changes in this revision

Viewing changes to Readme.rst

  • Committer: Alexandre Fayolle
  • Author(s): Nicolas Bessi
  • Date: 2013-01-23 11:33:12 UTC
  • mfrom: (293.1.3 trunk-python-fix-readme)
  • Revision ID: alexandre.fayolle@camptocamp.com-20130123113312-q8d8ta6ul322fcbg
[MRG] fixed Readme.rst

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
OpenERP Scenario in Python.
 
2
###########################
 
3
 
 
4
Integration of OpenERP scenario with Python, behave and the Anybox buildout recipe:
 
5
`http://pypi.python.org/pypi/anybox.recipe.openerp/1.3.0 <http://pypi.python.org/pypi/anybox.recipe.openerp/1.3.0>`_
 
6
 
 
7
Installation:
 
8
 
 
9
Refer to Anybox recipe documentation to create your instance.
 
10
Then you can add the following lines to you buildout configuration file
 
11
to use Python scenarios::
 
12
 
 
13
  [python]
 
14
  recipe = zc.recipe.egg
 
15
  interpreter = python
 
16
  extra-paths = ${buildout:directory}/parts/server
 
17
            
 
18
  eggs = behave
 
19
         ERPpeek
 
20
         mock
 
21
         unittest2
 
22
         MarkupSafe
 
23
         Pillow
 
24
         PyXML
 
25
         babel
 
26
         feedparser
 
27
         gdata
 
28
         lxml
 
29
         mako
 
30
         psycopg2
 
31
         pychart
 
32
         pydot
 
33
         pyparsing
 
34
         python-dateutil
 
35
         python-ldap
 
36
         python-openid
 
37
         pytz
 
38
         pywebdav
 
39
         pyyaml
 
40
         reportlab
 
41
         simplejson
 
42
         vatnumber
 
43
         vobject
 
44
         werkzeug
 
45
         xlwt
 
46
         docutils
 
47
 
 
48
Usage
 
49
#####
 
50
 
 
51
Checkout the branch of Python scenario.
 
52
Then move to the root of your instance where the bin should be available::
 
53
  
 
54
  bin/behave
 
55
 
 
56
should be available. To run some scenario launch the following command::
 
57
 
 
58
 bin/behave -k --tags=mytag ../path_to_python_scenario/features/ path_to_my_custom_scenario/features
 
59
 
 
60
The -k option will only show executed scenarios --tags will launch
 
61
specific scenario. For more information please refer to behave
 
62
documentation: `http://packages.python.org/behave/
 
63
<http://packages.python.org/behave/>`_
 
64
 
 
65
If you want to use **pdb** you have to set --no-capture option when launching behave
 
66
 
 
67
Anatomy of a custom scenario folder
 
68
###################################
 
69
 
 
70
If you want to create you own custom scenario for you project you
 
71
should use the following guide lines. The folder should be organized
 
72
the following way::
 
73
 
 
74
  OERPScenario/
 
75
  ├── data
 
76
  │   ├── account_chart.csv
 
77
  │   ├── logo.png
 
78
  └── features
 
79
      ├── setup
 
80
      │   ├── 01_installation.feature
 
81
      │   └── 02_installation_after_import.feature
 
82
      ├── addons
 
83
      ├── steps
 
84
      ├── stories
 
85
      └── upgrade
 
86
 
 
87
* data: contains non code related data for your scenarios.
 
88
* features: mandatory folder contains all features.
 
89
* setup: contains features required to setup all required data to run your tests
 
90
* addons: contains addons specific test, small independents scenarios
 
91
* stories: contains user/workflow tests that are related together
 
92
* upgrade: scenario to update an instance
 
93
* steps: contains Python code implementing the gherkin phrases