Score
0
Watch 6 Star 12 Fork 5

Andrew / GenesisPython

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
基于Python的CLI自动化项目,适合于电子产品自动化功能测试. spread retract

https://genesis-docs.readthedocs.io/en/latest/

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Genesis - CLI based Automatic Test Framework

如果有对CLI(命令行)自动化感兴趣的同学,请注意这个项目。这个项目用一种可视化的方式监督命令发送的全过程。

这个项目基于B/S模式,后台Python3,前台Vue.js,有完整的安装过程,与示例代码,是CLI自动化测试不二之利器。

Image

Take an Example

Human could manually type commands in Terminal to get the Python version.

[root@genesis ~]# python3 --version
Python 3.6.7
[root@genesis ~]#

Genesis is able to do the exact same thing.

uut = lib.conn.UUT
uut.open()
uut.send('python3 --version\r', expectphrase=']#', timeout=60)
if 'Python 3.6.7' not in uut.recbuf:
    raise Exception('Did not found [Python 3.6.7], go to failure')

If print uut.recbuf here, it looks like:

>>> print(uut.recbuf)
python3 --version
Python 3.6.7
[root@genesis ~]#
>>>

以下是安装全过程:

Install CentOS 7

  1. During installation, choose GNOME Desktop & Development Tool
  2. Create Guest account genesis/genesis and set it as administrator

Login CentOS 7 with root

  1. Open a terminal

Install Python3.6

  1. Run yum install -y https://centos7.iuscommunity.org/ius-release.rpm
  2. Run rpm -Uvh https://centos7.iuscommunity.org/ius-release.rpm
  3. Run yum install -y python36u python36u-libs python36u-devel python36u-pip
  4. Make sure python3 & pip3 work

Install Redis

  1. Run yum install -y redis

Install Apache

  1. Run yum install -y httpd
  2. Run yum install -y mod_ssl

Noted: later Genesis will re-config apache silently

Disable SELinux

  1. Run vi /etc/selinux/config, set SELINUX=disabled
  2. Reboot CentOS 7 System to take effect

Login CentOS 7 with root again!

  1. Open a terminal

Install Genesis

  1. Run cd /opt
  2. Run git clone https://gitee.com/andrew2015/genesis.git
  3. Run cd /opt/genesis & pip3 install -r requirements.txt
  4. Run cp /opt/genesis/certificate.crt /opt/
  5. Run python3 manage.py makemigrations & python3 manage.py migrate
  6. Run ln -s /opt/genesis/gen.py /usr/bin/gen
  7. Run chmod +x /opt/genesis/gen.py
  8. Run chown -R genesis:genesis /opt

Noted: If you meet any issue above, please raise your hand.

Enjoy Your Time

Change username to genesis from now on.

If you don't have code yet, please use example code:

  1. Run gen -h
  2. Run gen stop
  3. Run cp /opt/genesis/example/example.py /opt/prod/
  4. Run cp /opt/genesis/example/example_run.py /opt/prod/
  5. Run cp /opt/genesis/example/__init__.py /opt/prod/
  6. Run cp /opt/genesis/example/example_config.py /opt/config/

Start Work!

  1. Run gen start
  2. Open Browser - Google Chrome, use address - localhost or ip address

Comments ( 0 )

Sign in for post a comment

Python
1
https://gitee.com/andrew2015/genesis.git
git@gitee.com:andrew2015/genesis.git
andrew2015
genesis
Genesis
master

Help Search