README.md 10.4 KB
Newer Older
泰斯特Test's avatar
泰斯特Test 已提交
1
# Taisite-Platform
泰斯特Test's avatar
泰斯特Test 已提交
2

泰斯特Test's avatar
泰斯特Test 已提交
3 4
![](https://img.shields.io/badge/-%20marvelous-orange) ![](https://img.shields.io/badge/-%20gogeous-grey) ![](https://img.shields.io/badge/-%20elegant-blue)   

5 6
+ [Taisite-Platform 中文文档](https://github.com/amazingTest/Taisite-Platform/blob/master/README_CN.md)

泰斯特Test's avatar
泰斯特Test 已提交
7 8
![泰斯特平台LOGO.png](https://github.com/amazingTest/Taisite-Platform/blob/master/images/泰斯特平台LOGO.png)

9
## Ⅰ. Introduction
泰斯特Test's avatar
泰斯特Test 已提交
10

11
### Background
泰斯特Test's avatar
泰斯特Test 已提交
12

13
"Taisite-Platform" is an interface automation test platform developed by "Software Testing & Machine Learning Enthusiasts".
泰斯特Test's avatar
泰斯特Test 已提交
14

15
### Vision
泰斯特Test's avatar
泰斯特Test 已提交
16

17 18
The platform is dedicated to effectively combining artificial intelligence technology with software testing, enabling the platform to be more intelligent and generalized while ensuring test accuracy requirements
and ** optimize the user experience ** at the same time. The goal is to become the most intimate, best-used, highest value open source test platform.
泰斯特Test's avatar
泰斯特Test 已提交
19
 
20
### Technology stack
泰斯特Test's avatar
泰斯特Test 已提交
21

22
The platform follows the idea of "separate development frontend and backend". The technology stack is: "Python + Vue + Mongodb".
泰斯特Test's avatar
泰斯特Test 已提交
23
 
24
 [***(Thanks for the inspiration that this open source project brought to me.)***](https://github.com/githublitao/api_automation_test) 
泰斯特Test's avatar
泰斯特Test 已提交
25

26
### User environment
泰斯特Test's avatar
泰斯特Test 已提交
27

28
**Chrome is a good choice**
泰斯特Test's avatar
泰斯特Test 已提交
29

30
### Open source protocol
泰斯特Test's avatar
泰斯特Test 已提交
31

泰斯特Test's avatar
泰斯特Test 已提交
32
***APGL-3.0***
泰斯特Test's avatar
泰斯特Test 已提交
33 34


35
## Ⅱ. Taisite-platform features (os: What is the difference between other test platforms?)
泰斯特Test's avatar
泰斯特Test 已提交
36

37
 **0. It has been put into production environment for more than 1 year, it is stable~**
泰斯特Test's avatar
泰斯特Test 已提交
38
 
39 40
 1. The platform follows a "small but fine" strategy to maximize the development of all features and cost-effectiveness, helping test teams quickly build easy-to-follow/maintain interfaces
  automated test system.
泰斯特Test's avatar
泰斯特Test 已提交
41
 
42
 2. The platform follows the "zero-encoding" principle, and users can complete more complex business process interface tests without programming.
泰斯特Test's avatar
泰斯特Test 已提交
43
 
44
 3. The platform follows the principle of “good-looking is justice” and the operation interface is shown as follows:
泰斯特Test's avatar
泰斯特Test 已提交
45 46 47
 
 ![操作界面展示](https://github.com/amazingTest/Taisite-Platform/blob/master/images/操作界面展示.png)
 
48 49
 4. The platform has an excellent timed task experience. After starting the scheduled task, you can disable/arbitrarily edit the task content and take effect immediately. It also has a rich alarm strategy.
  The page is shown below:
泰斯特Test's avatar
泰斯特Test 已提交
50 51 52
 
 ![定时任务配置](https://github.com/amazingTest/Taisite-Platform/blob/master/images/定时任务配置.png)
 
53
 5. The platform has import/export capabilities that support testers ** "favorite" ** Excel format for easy batch generation/modification of use cases.
泰斯特Test's avatar
泰斯特Test 已提交
54 55 56
 
 ![数据导入展示](https://github.com/amazingTest/Taisite-Platform/blob/master/images/数据导入展示.png)
 
57 58
 6. The platform has a rich test result verification system and supports **text similarity** verification.
 ([get more detail](https://juejin.im/post/5cfe1dd96fb9a07ed7407321))
泰斯特Test's avatar
泰斯特Test 已提交
59
 
60
 7. The platform provides a test task scheduling interface to facilitate integration with development projects.
泰斯特Test's avatar
泰斯特Test 已提交
61 62
 
 8. ......
泰斯特Test's avatar
泰斯特Test 已提交
63
 
64
 ***(There are so many amazing little features waiting for you to explore & tap)***
泰斯特Test's avatar
泰斯特Test 已提交
65 66
 

67
## Ⅲ .Taisite-platform function diagram
泰斯特Test's avatar
泰斯特Test 已提交
68 69 70

### V1.0

泰斯特Test's avatar
泰斯特Test 已提交
71
![泰斯特平台结构图_V1.0](https://github.com/amazingTest/Taisite-Platform/blob/master/images/泰斯特平台结构图_V1.0.png)
泰斯特Test's avatar
泰斯特Test 已提交
72

73
## IV . Deploy
泰斯特Test's avatar
泰斯特Test 已提交
74

75
### Deploy under windows 
泰斯特Test's avatar
泰斯特Test 已提交
76

77
#### 0. Clone
泰斯特Test's avatar
泰斯特Test 已提交
78 79

    git clone https://github.com/amazingTest/Taisite-Platform.git
泰斯特Test's avatar
泰斯特Test 已提交
80

81
#### 1. Install python 3 env
泰斯特Test's avatar
泰斯特Test 已提交
82 83 84

#### 2. 部署自然语言模型

85
[Download model](https://storage.googleapis.com/bert_models/2018_11_03/chinese_L-12_H-768_A-12.zip)
泰斯特Test's avatar
泰斯特Test 已提交
86

87
2.2 Extract the compression package
泰斯特Test's avatar
泰斯特Test 已提交
88

89
2.3 Install python dependent-packages
泰斯特Test's avatar
泰斯特Test 已提交
90

泰斯特Test's avatar
泰斯特Test 已提交
91
    pip install tensorflow==1.14.0  -i https://pypi.tuna.tsinghua.edu.cn/simple
泰斯特Test's avatar
泰斯特Test 已提交
92
    pip install bert-serving-server==1.9.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
泰斯特Test's avatar
泰斯特Test 已提交
93
  
94
2.4 Start the model
泰斯特Test's avatar
泰斯特Test 已提交
95

96
// Execute after the current directory is switched to the model folder directory
泰斯特Test's avatar
泰斯特Test 已提交
97

泰斯特Test's avatar
泰斯特Test 已提交
98
    bert-serving-start -model_dir ./chinese_L-12_H-768_A-12/ -num_worker=1
泰斯特Test's avatar
泰斯特Test 已提交
99
  
100
After the startup is successful, the output is as follows:
泰斯特Test's avatar
泰斯特Test 已提交
101 102 103

![NLP模型启动成功输出](https://github.com/amazingTest/Taisite-Platform/blob/master/images/NLP模型启动成功输出.png)    

104
#### 3. Deploy Mongodb database
泰斯特Test's avatar
泰斯特Test 已提交
105

106
#### 4. Set system environment variables
泰斯特Test's avatar
泰斯特Test 已提交
107

泰斯特Test's avatar
泰斯特Test 已提交
108 109 110 111 112 113 114
    AUTOTEST_PLATFORM_ENV=production
    AUTOTEST_PLATFORM_NLP_SERVER_HOST=127.0.0.1
    AUTOTEST_PLATFORM_MONGO_HOST=${MONGO_HOST}
    AUTOTEST_PLATFORM_MONGO_PORT=${MONGO_PORT}
    AUTOTEST_PLATFORM_MONGO_USERNAME=${USERNAME}
    AUTOTEST_PLATFORM_MONGO_PASSWORD=${PASSWORD}
    AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME=taisite
泰斯特Test's avatar
泰斯特Test 已提交
115
  
116
Where AUTOTEST_PLATFORM_ENV defaults to production (required)
泰斯特Test's avatar
泰斯特Test 已提交
117

118
AUTOTEST_PLATFORM_MONGO_HOST and AUTOTEST_PLATFORM_MONGO_PORT indicate the address and port of the database (required)
泰斯特Test's avatar
泰斯特Test 已提交
119

120
AUTOTEST_PLATFORM_MONGO_USERNAME and AUTOTEST_PLATFORM_MONGO_PASSWORD represent the account password of the database (if not required)
泰斯特Test's avatar
泰斯特Test 已提交
121

122
AUTOTEST_PLATFORM_NLP_SERVER_HOST (Natural Language Model Service) defaults to native boot (not required)
泰斯特Test's avatar
泰斯特Test 已提交
123

124
AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME is the default data table name (required)
泰斯特Test's avatar
泰斯特Test 已提交
125

126
After the setting is completed, you can test it with the following commands (CMD switches to the project root directory)
泰斯特Test's avatar
泰斯特Test 已提交
127

泰斯特Test's avatar
泰斯特Test 已提交
128
    python ./backend/config.py
泰斯特Test's avatar
泰斯特Test 已提交
129
  
130
If the configuration is successful, you can see the input configuration data.
泰斯特Test's avatar
泰斯特Test 已提交
131

132
#### 5. Package the front-end dist file (I have done this for you, skip it if you don't need secondary development)
泰斯特Test's avatar
泰斯特Test 已提交
133

134
5.1 Install the Vue environment, download node.js and configure the environment, download the npm package manager
泰斯特Test's avatar
泰斯特Test 已提交
135

136
5.2 Cmd into the frontend directory, configure cnpm:
泰斯特Test's avatar
泰斯特Test 已提交
137

泰斯特Test's avatar
泰斯特Test 已提交
138
    npm install -g cnpm --registry=https://registry.npm.taobao.org   
泰斯特Test's avatar
泰斯特Test 已提交
139
  
140
5.3 Execute the install dependency package command:
泰斯特Test's avatar
泰斯特Test 已提交
141

泰斯特Test's avatar
泰斯特Test 已提交
142
    cnpm install
泰斯特Test's avatar
泰斯特Test 已提交
143
  
144
5.4 Execute the package command:
泰斯特Test's avatar
泰斯特Test 已提交
145

泰斯特Test's avatar
泰斯特Test 已提交
146
    cnpm run build
泰斯特Test's avatar
泰斯特Test 已提交
147
  
148
If successfully packaged, the dist folder will be generated in the project root directory.
泰斯特Test's avatar
泰斯特Test 已提交
149

150
#### 6. Start backend
泰斯特Test's avatar
泰斯特Test 已提交
151

152
// Switch to the project root directory to execute
泰斯特Test's avatar
泰斯特Test 已提交
153

泰斯特Test's avatar
泰斯特Test 已提交
154
    pip install -r ./backend/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
泰斯特Test's avatar
泰斯特Test 已提交
155

156
// Start backend (default 5050 port)
泰斯特Test's avatar
泰斯特Test 已提交
157

泰斯特Test's avatar
泰斯特Test 已提交
158
    python ./backend/run.py
泰斯特Test's avatar
泰斯特Test 已提交
159

160
// Create a platform administrator account password
泰斯特Test's avatar
泰斯特Test 已提交
161

泰斯特Test's avatar
泰斯特Test 已提交
162
    python ./backend/createAdminUser.py
泰斯特Test's avatar
泰斯特Test 已提交
163
  
164
#### 7. Access project
泰斯特Test's avatar
泰斯特Test 已提交
165

166
You can now log in using http://127.0.0.1:5050/#/login using the created administrator account password.
泰斯特Test's avatar
泰斯特Test 已提交
167 168 169

![平台登录界面2.png](https://github.com/amazingTest/Taisite-Platform/blob/master/images/平台登录界面2.png)

170
### Docker containerized deployment in Linux environment
泰斯特Test's avatar
泰斯特Test 已提交
171

172
#### 0. Clone
泰斯特Test's avatar
泰斯特Test 已提交
173

泰斯特Test's avatar
泰斯特Test 已提交
174
    git clone https://github.com/amazingTest/Taisite-Platform.git
泰斯特Test's avatar
泰斯特Test 已提交
175
  
176
#### 1. Natural language model deployment
泰斯特Test's avatar
泰斯特Test 已提交
177

泰斯特Test's avatar
泰斯特Test 已提交
178 179 180
    sudo -i
    docker pull shaoyuyishiwo/bertserver
    docker run --name autotest-platform-bertserver -d shaoyuyishiwo/bertserver 
泰斯特Test's avatar
泰斯特Test 已提交
181 182


183
#### 2. Mongo database deployment (skip this step if an existing database is available)
泰斯特Test's avatar
泰斯特Test 已提交
184

185
2.1 Start database & data mount to host
泰斯特Test's avatar
泰斯特Test 已提交
186

泰斯特Test's avatar
泰斯特Test 已提交
187 188 189
    sudo -i
    docker pull mongo 
    docker run  --name autotest-platform-mongo -p 27017:27017 -v /data/db:/data/db -v /data/configdb:/data/configdb ``-d mongo
泰斯特Test's avatar
泰斯特Test 已提交
190
  
191
2.2 Create a database account
泰斯特Test's avatar
泰斯特Test 已提交
192

泰斯特Test's avatar
泰斯特Test 已提交
193
    docker exec -it autotest-platform-mongo /bin/bash
泰斯特Test's avatar
泰斯特Test 已提交
194

泰斯特Test's avatar
泰斯特Test 已提交
195
    mongo
泰斯特Test's avatar
泰斯特Test 已提交
196

泰斯特Test's avatar
泰斯特Test 已提交
197
    > use admin
泰斯特Test's avatar
泰斯特Test 已提交
198

泰斯特Test's avatar
泰斯特Test 已提交
199
    switched to db admin
泰斯特Test's avatar
泰斯特Test 已提交
200

泰斯特Test's avatar
泰斯特Test 已提交
201
    > db.createUser({user:"${USERNAME}",pwd:"${PASSWORD}",roles:["root"]})
泰斯特Test's avatar
泰斯特Test 已提交
202

泰斯特Test's avatar
泰斯特Test 已提交
203
    Successfully added user: { "user" : "admin", "roles" : [ "root" ] }
泰斯特Test's avatar
泰斯特Test 已提交
204
  
205
2.3 Database memory expansion (recommended)
泰斯特Test's avatar
泰斯特Test 已提交
206

泰斯特Test's avatar
泰斯特Test 已提交
207
    > db.adminCommand({setParameter:1, internalQueryExecMaxBlockingSortBytes:335544320})
泰斯特Test's avatar
泰斯特Test 已提交
208

泰斯特Test's avatar
泰斯特Test 已提交
209
    { "was" : 33554432, "ok" : 1 }
泰斯特Test's avatar
泰斯特Test 已提交
210
  
211
#### 3. Environment variable configuration
泰斯特Test's avatar
泰斯特Test 已提交
212 213 214

// 编辑 /etc/profile 文件

泰斯特Test's avatar
泰斯特Test 已提交
215 216
    sudo -i
    vi /etc/profile
泰斯特Test's avatar
泰斯特Test 已提交
217
  
218
If there is a warning, select (E)dit anyway (enter E)
泰斯特Test's avatar
泰斯特Test 已提交
219

220
3.1 Insert the following data at the end of the text (enter i to get into insert status)
泰斯特Test's avatar
泰斯特Test 已提交
221

泰斯特Test's avatar
泰斯特Test 已提交
222 223 224 225 226 227 228 229
    export AUTOTEST_PLATFORM_ENV=production
    export AUTOTEST_PLATFORM_NLP_SERVER_HOST=${BERT_IPADRESS}
    export AUTOTEST_PLATFORM_MONGO_HOST=${MONGO_HOST}
    export AUTOTEST_PLATFORM_MONGO_PORT=${MONGO_PORT}
    export AUTOTEST_PLATFORM_MONGO_USERNAME=${USERNAME}
    export AUTOTEST_PLATFORM_MONGO_PASSWORD=${PASSWORD}
    export AUTOTEST_PLATFORM_MONGO_DEFAULT_DBNAME=${DBNAME}

230 231 232
The variable is a dynamic value. The deployer can input it according to the actual situation. 
The DBNAME value can be arbitrarily customized (database table name). The BERT_IPADRESS and 
MONGO_HOST values can be queried by the following commands:
泰斯特Test's avatar
泰斯特Test 已提交
233

泰斯特Test's avatar
泰斯特Test 已提交
234
    docker inspect autotest-platform-bertserver
235
    docker inspect autotest-platform-mongo // If you used the above steps to deploy the database
泰斯特Test's avatar
泰斯特Test 已提交
236
  
237
The output is shown below:
泰斯特Test's avatar
泰斯特Test 已提交
238 239 240

![控制台输出1.png](https://github.com/amazingTest/Taisite-Platform/blob/master/images/控制台输出1.png)

241
3.2 After inserting, click the ESC button, type :wq and click Enter to save.
泰斯特Test's avatar
泰斯特Test 已提交
242

243
3.3 Environment variables take effect immediately after executing the following command
泰斯特Test's avatar
泰斯特Test 已提交
244

泰斯特Test's avatar
泰斯特Test 已提交
245
    source /etc/profile
泰斯特Test's avatar
泰斯特Test 已提交
246
  
247 248 249 250
#### 4. Start the project

Before you start the project, you need to change the timezone info by modifying the RUN script in **Dockerfile.backend** which stay 
in first-level directory of the project. The default timezone is Asia/Shanghai.
泰斯特Test's avatar
泰斯特Test 已提交
251

252
// Execute the deployment file in the project root directory
泰斯特Test's avatar
泰斯特Test 已提交
253

泰斯特Test's avatar
泰斯特Test 已提交
254
    sh deploy ${PORT} 
泰斯特Test's avatar
泰斯特Test 已提交
255
  
256 257
The ${PORT} variable fills in the project access port, and the administrator account password is also created when the 
project starts, as shown in the following figure:
泰斯特Test's avatar
泰斯特Test 已提交
258 259 260

![控制台输出2.png](https://github.com/amazingTest/Taisite-Platform/blob/master/images/控制台输出2.png)

261
#### 5. Access project
泰斯特Test's avatar
泰斯特Test 已提交
262

263
The browser can access the ${PORT} port of the deployment server address.
泰斯特Test's avatar
泰斯特Test 已提交
264

泰斯特Test's avatar
泰斯特Test 已提交
265
![平台登录界面.png](https://github.com/amazingTest/Taisite-Platform/blob/master/images/平台登录界面.png)
泰斯特Test's avatar
泰斯特Test 已提交
266 267


268
#### EXTRA. FQA
泰斯特Test's avatar
泰斯特Test 已提交
269

270
The following output represents the NLP model startup failure
泰斯特Test's avatar
泰斯特Test 已提交
271 272

![NLP部署失败.png](https://github.com/amazingTest/Taisite-Platform/blob/master/images/NLP部署失败.png) 
泰斯特Test's avatar
泰斯特Test 已提交
273

274
Solution steps:
泰斯特Test's avatar
泰斯特Test 已提交
275

276
1. Remove the code from ./backend/app/init.py:
泰斯特Test's avatar
泰斯特Test 已提交
277 278 279

![不使用NLP模型方法指南1.png](https://github.com/amazingTest/Taisite-Platform/blob/master/images/不使用NLP模型方法指南1.png)

280
2. Modify the following code in ./backend/testframe/interfaceTest/tester.py to pass:
泰斯特Test's avatar
泰斯特Test 已提交
281

泰斯特Test's avatar
泰斯特Test 已提交
282
![不使用NLP模型方法指南2.png](https://github.com/amazingTest/Taisite-Platform/blob/master/images/不使用NLP模型方法指南2.png)
泰斯特Test's avatar
泰斯特Test 已提交
283

284
When you start the project after you finish, you will not depend on the natural language model~
泰斯特Test's avatar
泰斯特Test 已提交
285

286
## V . Contact me
泰斯特Test's avatar
泰斯特Test 已提交
287

288
if u have any questions feel free to email me , 523314409@qq.com.
泰斯特Test's avatar
泰斯特Test 已提交
289

泰斯特Test's avatar
泰斯特Test 已提交
290

泰斯特Test's avatar
泰斯特Test 已提交
291

泰斯特Test's avatar
泰斯特Test 已提交
292