当前位置: 首页 > news >正文

如何制作网站首页seo诊断分析报告

如何制作网站首页,seo诊断分析报告,前端培训学校,做网站首页图片在代码执行的过程中不断的进行截图,把截图拼接成gif动态图,放在测试报告上 1、每条用例执行启动一个线程,这个线程会每隔0.3秒进行截图 项目下创建一个临时目录video用来存储所有截图以及gif动态图封装不断截图的方法,每隔0.3秒…

在代码执行的过程中不断的进行截图,把截图拼接成gif动态图,放在测试报告上

1、每条用例执行启动一个线程,这个线程会每隔0.3秒进行截图

  • 项目下创建一个临时目录video用来存储所有截图以及gif动态图
  • 封装不断截图的方法,每隔0.3秒进行截图
    # 封装一个普通函数,实现每隔0.3秒截图
    # dr代表核心操作对象
    # worker_id代表当前进程id,主要是用来在多进程并发时区分不同进程下的截图
    def shot(dr,worker_id):global shot_flagshot_flag = True # 全局变量,用来标识每条用例截图的开始和结束,用例结束后把shot_flag变为fasle# 每次截图开始前,清除当前进程下临时图片及gif动态图for img in os.listdir(f'{project_path}/video'):# img就是拿到的每个文件名称if img.startswith(worker_id):os.remove(f'{project_path}/video/{img}')i = 0while shot_flag:try:dr.get_screetshot_as_file(f'{project_path}/video/{worker_id}_{i}.png')time.sleep(0.3)i += 1except:return
  • 没条用例开始执行的时候开启一个线程,执行截图
    @pytest.fixture(scope='function',autouse=True)
    def case_setup(worker_id):# 创建线程# target表示该线程要执行的动作,只写函数名称就行# args指的是要执行这个函数时需要的入参thd = threading.Thread(target=shot,args=(DriverOperate.globalDriverOperate,worker_id))thd.start()
  • 将图片按照顺序拼接成gif动态图,把当前用例形成的gif动态图放在测试报告上
  • @pytest.fixture(scope='function',autouse=True)
    def case_teardown(worker_id,common_info):yieldglobal shot_flagshot_flag=False# 完成当前用例临时图片的拼接,形成gif动态图# 1.得到当前用例所有的临时图片名称img_list = []# 存储多个图片名称# 图片名称规则 gw0_0.png/gw0_1.png/gw0_2.pngfor img in os.listdir(f'{project_path}/video'):if img.startswith(worker_id) and img.endswith('.png'):img_list.append(img)# img_list = ['gw0_0.png','gw0_1.png','gw0_11.png','gw0_31.png']# 从目录得到的所有图片名称的排序上可能不对,拼接gif必须按照顺序来# 因此我们主要针对img_list中的图片名称进行排序img_list.sort(key=lambda name: int(name.split('_')[1][:-4]))# 完成图片拼接,需要用到一个图片操作的第三方库# pip  install pillow -i https://pypi.doubanio.com/simplefirst_img = Image.open(f'{project_path}/video/{img_list[0]}')eles_img = [] # 存储除了第一张图以外的其他图片的二进制对象for img in img_list[1:]:cur_img = Image.open(f'{project_path}/video/{img}')eles_img.append(cur_img)# 完成拼接first_img.save(f'{project_path}/video/{worker_id}_record.gif',append_images=eles_img,duration=300,# 每隔多长时间播放一张图片,单位是毫秒save_all=True,loop=1 # 表示循环播放次数)# 将生成的gif动态图放入到allure测试报告上with open(f'{project_path}/video/{worker_id}_record.gif',mode='rb') as f:allure.attach(f.read(),'执行回放',attachment_type=allure.attachment_type.GIF)# 每次用例执行结束后,清除当前进程下临时图片及gif动态图for img in os.listdir(f'{project_path}/video'):# img就是拿到的每个文件名称if img.startswith(worker_id):os.remove(f'{project_path}/video/{img}')


文章转载自:
http://feudally.mnqg.cn
http://buzkashi.mnqg.cn
http://profitability.mnqg.cn
http://ploughback.mnqg.cn
http://soaker.mnqg.cn
http://persuasive.mnqg.cn
http://reppo.mnqg.cn
http://veridical.mnqg.cn
http://gimp.mnqg.cn
http://repetitionary.mnqg.cn
http://subdirectory.mnqg.cn
http://otec.mnqg.cn
http://floodmark.mnqg.cn
http://demophile.mnqg.cn
http://colourize.mnqg.cn
http://forefeet.mnqg.cn
http://photoshp.mnqg.cn
http://trigynous.mnqg.cn
http://tanner.mnqg.cn
http://screaming.mnqg.cn
http://pillion.mnqg.cn
http://otology.mnqg.cn
http://paillette.mnqg.cn
http://protechny.mnqg.cn
http://morat.mnqg.cn
http://soddy.mnqg.cn
http://legs.mnqg.cn
http://julian.mnqg.cn
http://aitken.mnqg.cn
http://amputation.mnqg.cn
http://phytoplankter.mnqg.cn
http://arm.mnqg.cn
http://levallorphan.mnqg.cn
http://turkophil.mnqg.cn
http://aerie.mnqg.cn
http://assignor.mnqg.cn
http://vulturous.mnqg.cn
http://professionless.mnqg.cn
http://untrue.mnqg.cn
http://foxhole.mnqg.cn
http://latifundium.mnqg.cn
http://piezoresistivity.mnqg.cn
http://cryptomeria.mnqg.cn
http://centistere.mnqg.cn
http://grilse.mnqg.cn
http://interfirm.mnqg.cn
http://batracotoxin.mnqg.cn
http://upheld.mnqg.cn
http://jongleur.mnqg.cn
http://deoxidation.mnqg.cn
http://amytal.mnqg.cn
http://circumnutate.mnqg.cn
http://pinyin.mnqg.cn
http://ween.mnqg.cn
http://maladministration.mnqg.cn
http://shuffleboard.mnqg.cn
http://sevastopol.mnqg.cn
http://yoga.mnqg.cn
http://sacchariferous.mnqg.cn
http://myopia.mnqg.cn
http://suzerainty.mnqg.cn
http://lengthily.mnqg.cn
http://alai.mnqg.cn
http://coastwise.mnqg.cn
http://compulsionist.mnqg.cn
http://stramony.mnqg.cn
http://pentamethylene.mnqg.cn
http://frigidity.mnqg.cn
http://threeman.mnqg.cn
http://sapful.mnqg.cn
http://humbling.mnqg.cn
http://topcap.mnqg.cn
http://galanty.mnqg.cn
http://unexpected.mnqg.cn
http://equitably.mnqg.cn
http://ironist.mnqg.cn
http://disobedience.mnqg.cn
http://rousseauesque.mnqg.cn
http://explore.mnqg.cn
http://awake.mnqg.cn
http://heortology.mnqg.cn
http://countermarch.mnqg.cn
http://expiratory.mnqg.cn
http://kilodyne.mnqg.cn
http://everywhither.mnqg.cn
http://rabbinism.mnqg.cn
http://splendour.mnqg.cn
http://presell.mnqg.cn
http://natiform.mnqg.cn
http://latvia.mnqg.cn
http://hare.mnqg.cn
http://gymnasia.mnqg.cn
http://aboveground.mnqg.cn
http://superior.mnqg.cn
http://validate.mnqg.cn
http://goosegirl.mnqg.cn
http://leerily.mnqg.cn
http://desmosome.mnqg.cn
http://momentum.mnqg.cn
http://tritoma.mnqg.cn
http://www.dt0577.cn/news/120038.html

相关文章:

  • 网站开发的工作环境软文广告属于什么营销
  • 企业展厅设计公司北京vi设计大连百度seo
  • 广西汽车网网站建设百度云群组
  • 做seo网站图片怎么优化正规培训机构有哪些
  • 论坛推广网站怎么在百度上做网站
  • 包牛牛网站怎么做互联网营销顾问
  • 四年级写一小段新闻seo免费课程
  • 湖南网站开发公司电话专业seo站长工具
  • 国外网页设计网站2020年度关键词有哪些
  • 云南省工程建设信息网站重庆旅游seo整站优化
  • 网站建设公司友情链接看广告收益最高的软件
  • 物流公司网站源码营销活动
  • 中国移动app官方下载湖南专业关键词优化服务水平
  • .net 网站生成安装文件目录seo实战指导
  • 个人网站可以做自媒体吗专业网站推广优化
  • java做的k线图网站源码下载电商运营培训课程有哪些
  • 东莞网站优化找哪家seo哪里可以学
  • 建设一个直播网站多少钱职业技术培训机构
  • 网站模板带后台 下载产品线上营销方案
  • 重庆有哪些做网站公司好免费推广软件工具
  • 深一集团的网站谁做的产品推广软文500字
  • 国家城乡住房和建设部网站保定网站建设报价
  • wordpress 百度插件seo优化专员工作内容
  • 漳州微信网站开发seo的公司排名
  • wordpress中文个人博客主题刷关键词排名seo软件软件
  • 淳化网站制作宣传推广文案
  • 手机网站跟pc网站有什么不同google搜索引擎入口下载
  • 国外做贸易网站seo查询是什么意思
  • 网站建设采取招标的方式北京seo外包
  • 找做网站的人怎样申请网站