; ;
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 27 下一页
摘要: 基础以及安装可以查看这两篇文章,我就直接上如何使用,不理解可以参考这两篇文章 https://blog.csdn.net/liuchunming033/article/details/79624474 https://blog.csdn.net/hh20161314/article/details/ 阅读全文
posted @ 2020-04-06 22:01 做梦的人- 阅读(11304) 评论(5) 推荐(0) 编辑
摘要: #encoding=utf-8 class Table(object): # 定义一个私有属性__table,用于存放table对象 __table = '' def __init__(self, table): # Table类的构造方法 self.setTable(table) def setT 阅读全文
posted @ 2020-04-06 21:27 做梦的人- 阅读(986) 评论(0) 推荐(0) 编辑
摘要: 推荐一篇博主博客:https://www.cnblogs.com/CJOKER/p/8295272.html 它里面讲述了日志的显示顺序、如何在控制台进行显示,以及文件配置都挺详细的,可以先看看推荐的内容 我这边按项目的情况对使用的日志模块进行了一个封装 1.日志文件的配置 Logger.conf 阅读全文
posted @ 2020-04-06 17:16 做梦的人- 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 背景:在selenium出错后都会截图,那截图的时候都是以当天时间存入到当前时间文件夹中,那这个就可以分成3部,进行封装 一:格式化数据 #encoding=utf-8 import time from datetime import datetime ''' 本文件主要用于获取当前的日期以及时间, 阅读全文
posted @ 2020-04-06 11:41 做梦的人- 阅读(406) 评论(0) 推荐(0) 编辑
摘要: #encoding=utf-8 from selenium import webdriver import unittest, time from PIL import Image class ImageCompare(object): ''' 本类实现了对两张图片通过像素比对的算法,获取文件的像素 阅读全文
posted @ 2020-04-05 11:57 做梦的人- 阅读(2495) 评论(0) 推荐(0) 编辑
摘要: def init_data(): data = [{"zhang", "123"}, {"lisang", "456"}] return data class test_skip: #单个参数 @pytest.mark.parametrize('name', ["tom", "zhang", "ju 阅读全文
posted @ 2020-04-04 22:45 做梦的人- 阅读(775) 评论(0) 推荐(0) 编辑
摘要: 使用方法: @pytest.mark.skipif(condition,reason=None) 参数: condition:跳过的条件,True(跳过、不执行)/False(不跳过、执行),必传参数 reason:标注原因 class test_skip: n=5 @pytest.mark.ski 阅读全文
posted @ 2020-04-04 22:32 做梦的人- 阅读(462) 评论(0) 推荐(0) 编辑
摘要: pytest中使用fixture装饰器是来固定的工厂函数,fixture函数可以在测试执行前和执行后进行必要的准备和清理工作 1. fixture做为函数引用使用 比如以下 import pytest # fixture作为函数引用 @pytest.fixture() def before(): p 阅读全文
posted @ 2020-04-04 22:16 做梦的人- 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 使用pytest控制函数运行的函数 需要使用 (1)使用 @pytest.mark.run(order=x) 标记被测试函数 (2)运行的顺序由order传入的参数决定;(order从小到大的顺序执行) import pytest class Calc(object): @classmethod d 阅读全文
posted @ 2020-04-04 16:35 做梦的人- 阅读(1494) 评论(0) 推荐(0) 编辑
摘要: 背景: 在pycharm中运行正常,但是使用命令方式就提示没有模块 解决方案 在Python安装目录下的\Lib\site-packages文件夹中建立一个.pth文件,内容为自己写的 查看包是否有导入 再次运行,就成功了 阅读全文
posted @ 2020-04-01 23:05 做梦的人- 阅读(5996) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 27 下一页