api_automation_test deployment of open source projects

background:

  1. Currently learning django, just getting started.
  2. Usually do interface testing are based on jmeter do.
  3. Interface Automation get python to do, have always been a problem, token passing problem, it is melancholy.

07-26 Friday when the thought look online there any open source project, can their current knowledge learned, to be integrated.

Under Search For comparison screening, chose api_automatic_test

https://blog.csdn.net/zouhui1003it/article/details/90342520

https://blog.csdn.net/smooth00/article/details/84317512

 

Open Source Project Address:

Open source automated testing platform: https: //testerhome.com/opensource_projects/37

github Address: https://github.com/githublitao/api_automation_test

 

 

The deployment of open source projects to local --- Step Reference address as open source projects, where the main issues to be integrated recording solutions and ideas .

When 1.suit project download to a local, open, can not find the suit newspaper, began to think that suit is a separate third-party packages, but later found not, the solution, see Step 5


2.home path
# currently logged in user directory
Import os
Print (os.environ.keys ()) # see what Key
Print (os.environ [ 'USERNAME'])
Print (os.environ [ 'USERPROFILE'])
# print (os.environ [ 'HOMEPATH'] )


3. Check what is downloaded package - a list of third-party libraries.
Freeze pip list or PIP
PIP Freeze> package_list.txt the output file to a file in


4. Generate migration file, transition table generating
Python manage.py makemigrations
Python the migrate manage.py


5. File "F:\Download\GoogleChrome\api_automation_test-master\api_test\apps.py", line 2, in <module>
from suit.apps import DjangoSuitConfig
ModuleNotFoundError: No module named 'suit'

The reason may be the django-suit version to match with django
django-suit == 2.0a1 to be used in conjunction with Django == 1.10.6 This version can only be
a solution: pip install https://github.com/darklow/django-suit / tarball / v2
django-SUIT version of the download is: django-suit == 2.0a1 this time django version 2.0.2

 

6. migrate files may generate an error:

Problem: python manage.py makemigrations execute this error
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required ; you have 0.7.11.None
Solution: The solution:
find Python36-32 Python installation under the Road King \ Lib \ site-packages \ django \ db \ backends \ mysql \ base.py file
to file as code comments


7. Create superuser

python manage.py createsuperuser
username api
passwoed DDWang123456


8. vue installation environment, and configured to download Node.js environment, download manager NPM package, installation engineering VUE VUE scaffold template for generating
npm install --global vue-cli

npm: Package Manager under Nodejs.
webpack: Its main purpose is to put all through grammar CommonJS browser need to publish static resources to do the appropriate preparation, such as mergers and packaging resources.
vue-cli: user-generated Vue project template. (To help you quickly start a project vue, that is, to give you a vue structure, comprising a base dependent libraries, only npm install can be installed)


9 Installation vue environment:
first check whether the installation node under local windows, cmd command line input node under the
View node version node -v

After installing node.js, npm will install automatically
check the version node -v -v and npm   
npm install --global VUE-cli    

 

10.cmd into the front-end directory, run install to install dependent packages (into the frontend directory under the project, npm install execution) npm
execution being given and then I continue npm run build (package) or being given a
solution:
Compile failure, failure of the package, the next following command:
npm rebuild the Node-Sass

 

11 Project start:
Python manage.py the runserver 0.0.0.0:8000


12. Now you can log in to access http://127.0.0.1:8000,
http://127.0.0.1:8000/admin for the background management platform
(Note: If you can not log in, it may request the interface address error, modify api_automation_test /frontend/src/api/api.js comment other IP, reserved 127.0.0.1)

 

13. Will the user to create good, why has the site login prompt account or password wrong ???
reasons: (1) when npm run build execution error is ignored

             Time (2) npm install dependencies of the given installation, a request log, open F12, see Console, is not suggested that the lack of dependencies of the class.

Solution:

Followed by executing the following statement
npm Cache Clean --force
npm install -g npm
npm install -g CNPM --registry = HTTPS: //registry.npm.taobao.org

Audit FIX --force npm
npm RUN Build ----- incorrect report  

14.执行npm run build报:TypeError: Cannot read property 'compilation' of undefined

 

 Solution: https://www.jianshu.com/p/3f8f60e01797

 

 

Strands command, executed in the order

install PIP - r requirements.txt 
PIP install HTTPS: //github.com/darklow/django-suit/tarball/ v2 
modify the database connection settings under the user name and password python manage.py makemigrations # generate migrate files python manage.py migrate # Make table python manage.py createsuperuser # create a super user
to install node.js environment (similar to the JVM, download and install the package under the windows, after you install node, npm automatically installed, pay attention to check the corresponding version) npm install
- , Ltd. Free Join vue- cli # install scaffolding used to generate the VUE project template npm install # install dependencies, first go to the next frontend directory npm run build # packaged Python manage.py the runserver 0.0.0.0:8000 # run django project


---- based on the above command each step in the case of no error, the execution order to open the items

  

 

If an error during the installation of the dependent packages, run the following command

Cache Clean NPM - Force #npm the install execution of the command given 
NPM the install   -g NPM # NPM I module_name global mount -g
the install NPM -g CNPM --registry = HTTPS: //registry.npm.taobao.org # Taobao image using 
NPM Audit FIX --force
npm run build
performs error npm run build, see step 14, it can be resolved properly.
Re-run npm run build, and execute python manage.py runserver 0.0.0.0:8000 # run django project


 

 

 

Attach a successful visit to the picture a few items:

 

 

 

Guess you like

Origin www.cnblogs.com/eosclover/p/11263359.html