Synch installs with it/dep and fix Dockerfile
[it/test.git] / ric_robot_suite / README.md
1 # Getting Started
2 ## Prerequisites
3 Clone the repo
4
5 ### build container
6 ./build.sh will create ./build directory, generate documentation using robot.libdoc, copy doc and robot files and build the docker conatiner.
7 See build.sh for how to run the docker (you will need to edit and copy vm_properties.py and integration_robot_properties.py to your eteshare mount point)
8
9 ## Development Environment Setup
10 ### Python Installation
11 You should install 2.7.12: [https://www.python.org/downloads/release/python-2712](https://www.python.org/downloads/release/python-2712)
12
13
14 ### Pip Install
15 Install pip with the get-pip.py file from [https://bootstrap.pypa.io/get-pip.py](https://bootstrap.pypa.io/get-pip.py)
16 once downloaded run
17
18 ```
19 python get-pip.py
20 ```
21 let it install.
22
23 From the desktop, right click the Computer icon.
24 Choose Properties from the context menu.
25 Click the Advanced system settings link.
26 Click Environment Variables. In the section System Variables, click New.
27 In the New System Variable window, set the name as 'HTTPS\_PROXY' then specify the value of the HTTPS_PROXY environment variable as your proxy. 
28 Click OK. 
29 Close all remaining windows by clicking OK.
30
31
32 ### Robot Install
33 Reopen Command prompt window, and run below code to install robot.
34
35 ```
36 pip install robotframework
37 ```
38
39
40 ### IDE Install
41 Most further documents will use the RED environment for Robot.
42 [https://github.com/nokia/RED/releases/download/0.7.0/RED\_0.7.0.20160914115048-win32.win32.x86_64.zip](https://github.com/nokia/RED/releases/download/0.7.0/RED\_0.7.0.20160914115048-win32.win32.x86_64.zip)
43
44 Once you install that IDE you probably will want to have a python editor to edit python files better.
45 Go to Help > Eclipse Marketplace and search for PyDev and click install on PyDev for Eclipse 5.2.0
46
47 Once you install that IDE you will need EGit to check in git code.
48 Go to Help > Eclipse Marketplace and search for Egit git team provider and click install on EGit Git Team Provider 4.5.0
49
50 Once you install that IDE you will probably want a json editor to edit json better.
51 Go to Help > Eclipse Marketplace and search for Json Tools and click install on Json Tools 1.1.0
52
53 ### Project Setup
54 Note: You do not need to run these commands every time, only on a library update or initial checkout.
55
56 ```
57 ./setup.sh  
58 ```
59
60 Note that this script will download the chromedriver for the current OS. The default is linux64 which will download the appropriate chromedriver to /usr/local/bin so that it will be in the execution PATH.
61
62 Windows and Mac hosts will download into the current working directory. Windows and MAC users will need to ensure that the driver is 
63 in the execution PATH.
64
65
66 ## Robot Project Structure
67 ### Overview
68 ProjectName - robot
69
70 ```
71 `-- robot
72     |-- assets - put anything you need as input like json files, cert keys, heat templates
73     |   |-- templates - put any json templates in here, you can include subfolders for each component
74     |-- doc - docgen.py will put html documentation of the custom keywords here
75     |   |-- resources  libdoc of the custom keywords under robot/resources
76     |-- library - pip will install Python libraries here
77     |   |-- eteutils - pip will install locally-developed Python libraries here
78    |-- resources - put any robot resource files aka libraries we write in here
79     |   |-- aai
80     |   `-- vid
81     `-- testsuites - put any robot test suites we write in here
82 `-- library
83     |-- python - put locally-developed Python libraries here, to be copied into eteutilsxo
84 ```    
85
86 ### Tag Strucutre
87 Robot uses tags to separate out test cases to run. below are the tags we use
88
89 * health - use this for test cases that perform a health check of the environment
90 * ete - use this for the test cases that are performing an end to end test
91 # xapptests - use this for test cases that apply to Xapp Mager
92 * e2mgrtests   - use this for test case that apply to the E2 Mgr 
93
94 ## Branching Structure
95 ### Overview
96 Repository Name: it/test/ric_robot_suite
97
98 Branching strategy:
99 ```
100 `-- ric_robot_suite
101     |-- master - the main branch and always the latest deployable code. Send a pull to here from feature and Dan or Jerry will approve.
102      |-- feature-[XXXXXX] - when you want to make changes you make them here, when you are satisfied send pull request to master
103 ```    
104
105 ## Executing ETE Testcases
106 ### Overview
107 Two scripts have been provided in the root of the ete-testsuite project to enable test execution
108
109 * runTags.sh - This shell uses Robot [Tags] to drive which tests are executed and is designed for automated testing.
110 * oneTest.sh - This shell is designed for unit testing of individual .robot files. It accepts a single argument identifying the .robot file in robot/testsuites to execute.
111   
112 #### runTags.sh
113 For further information on using Robot [Tags], see [http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#configuring-execution] and [http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#simple-patterns]
114
115 When executing tests via tags, all of the robot files in the project are scanned for tests cases with the specified tags.
116
117 There are 3 flavors of runTags.sh 
118 * runTags.sh with no arguments. This defaults to the default tag or runTags.sh -i health
119 * runTags.sh with a single include tag. In this case the -i or --include may be omitted. So runTags.sh ete is the same as runTags.sh -i ete
120 * runTags.sh with multiple tags. In this case, tags must be accompanied by a -i/--include or -e/--exclude to properly identify the disposition of the tagged testcase.
121
122 ```
123 runTags.sh -i health -i ete -e e2mgrtests
124 ```
125