Automated-Test/README.md

59 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Automated-Test
## Web自动化测试框架
### 测试框架:
python3+Selenium+unittest+HTMLTestRunner+pageObject Web自动化测试框架
selenium+unittest搭建的WebUI自动化测试框架
环境部署: python3、selenium3
开发工具: Pycharm
集成工具: Jenkins
测试代码托管平台GitHub
通过主从服务器执行测试
### 测试代码结构:
![](https://raw.githubusercontent.com/linyuli861/Automated-Test/master/z-README-image/structure.png)
* common文件夹存放公有元素如url测试报告发送邮件地址使用信息等
* file文件夹存放测试过程中需要使用的文件如图片txtzip文件等
* page文件夹用于存放测试过程中需要使用的页面元素
* report文件夹用于存放测试生成的测试报告
* testcase文件夹中存放测试用例
* HTMLTestRunner.py是将测试结果生成为html版的测试报告的文件
* run.py 执行run.py文件可以执行全部测试用例
###生成的测试报告例子如下所示
![](https://raw.githubusercontent.com/linyuli861/Automated-Test/master/z-README-image/report.png)
###发送邮件如下所示:
调用common中的sendEmail向指定邮箱发送最新的测试报告文件
![](https://raw.githubusercontent.com/linyuli861/Automated-Test/master/z-README-image/email.jpg)
###PageObject设计模式
由于Web页面自动化测试的过程中会存在许多重复的元素且很多Web页面测试的元素值不稳定经常变更
为了使得Web页面自动化测试的代码更具有健壮性因此使用PageObject设计模式
将web自动化测试的测试用例和测试用例中需要使用到的元素解耦。
*解耦后的代码方便修改,增强了自动化测试代码的复用性。*