Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e91adf3

Browse files
committed
优化
1 parent 2b080fe commit e91adf3

File tree

21 files changed

+1403
-465
lines changed

21 files changed

+1403
-465
lines changed

‎README.md‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
# python+selenium +HTMLTestRunner+yaml自动化
2-
## python 3 +selenium2 +HTMLTestRunner(python3版本)
3-
### 使用的框架是python自带的unittest。
4-
5-
### base 文件来放着对Login_tes,Zhuce_tes,Zaohui_tes等类的封装,我在case只要调用这里面的类传入相应的参数就可以。
6-
### testcase用来放置测试用例的地方,我写了几个用例文件,每个用例的命名是为了让我以后可以更好的查代码,
7-
## paged用来放数据的,包括页面的定位的数据,还有测试用例所用的数据,(注:这里使用yaml文件是因为python很好解析该类文件)
8-
### jietu汉语的字面意思,我在运行测试用例的时候。我需要截图的地方,利用selenium自动的截图功能来截取,(这里命名一定要与测试用例相对应)
9-
### lo 放置log。同样我也吧log模块的简单封装放到这里
10-
### report 这里放置的是测试报告,我吧执行的测试用例的一个脚本放在这里。我可以在命令行直接运行
11-
### testsuite 组织测试的suite
1+
# python+selenium +HTMLTestRunner自动化测试
2+
## python 3 +selenium3 +HTMLTestRunner(python3版本)
3+
### 使用的框架是python自带的unittest。使用ddt数据驱动,Excel管理测试用例
4+
### bussinses 公共的逻辑模块编写
5+
### data存放测试用例,界面定位元素
6+
### report存放测试报告
7+
### testcase存放测试用例。
8+
### testlog 存放测试过程中的测试日志
9+
### testreposepang存放测试过程中的截图
10+
### testsuite 测试用例集
1211
### util 公共模块
13-
### run.py运行的注模块
12+
### run.py 执行脚本。

‎__init__.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
@Version: 1.0
3+
@Project: BeautyReport
4+
@Author: Raymond
5+
@Data: 2017年11月16日 下午6:01
6+
@File: __init__.py
7+
@License: MIT
8+
"""
9+
10+
from .BeautifulReport import BeautifulReport
11+
12+
13+
__all__ = ['BeautifulReport']

‎base/blo.py‎ renamed to ‎bussinses/blo.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import yaml,os
2-
from selenium import webdriver
32
path=os.getcwd()
43
class Login_tes:#登录模块封装
54
def __init__(self,driver):#
65
self.driber=driver
7-
self.file=open(path+"\\page\\page_data.yaml", "r",encoding= "utf-8")
6+
self.file=open(path+"\\data\\page_data.yaml", "r",encoding= "utf-8")
87
self.data=yaml.load(self.file)
98
self.file.close()
109
self.lo_url=self.data['login'].get('url')

‎data/case.xlsx‎

11.6 KB
Binary file not shown.
File renamed without changes.

‎geckodriver.log‎

Lines changed: 297 additions & 0 deletions
Large diffs are not rendered by default.

‎page/lo_data.yaml‎

Lines changed: 0 additions & 145 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /