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

郑州市建设工程造价信息网站关于工程项目建设的网站

郑州市建设工程造价信息网站,关于工程项目建设的网站,一个品牌的策划方案,网站备案是域名备案还是服务器备案pyse 更名为 seldom WebUI automation testing framework based on Selenium and unittest. 基于 selenium 和 unittest 的 Web UI自动化测试框架。 特点 提供更加简单API编写自动化测试。提供脚手架#xff0c;快速生成自动化测试项目。自动生成HTML测试报告生成。自带断言方… pyse 更名为 seldom WebUI automation testing framework based on Selenium and unittest. 基于 selenium 和 unittest 的 Web UI自动化测试框架。 特点 提供更加简单API编写自动化测试。提供脚手架快速生成自动化测试项目。自动生成HTML测试报告生成。自带断言方法断言title、URL 和 text。支持用例参数化。支持用例失败重跑。用例失败/错误截图。 安装 pip install seldom If you want to keep up with the latest version, you can install with github repository url: pip install -U githttps://github.com/defnngj/seldom.gitmaster Quick Start 1、查看帮助 seldom -h usage: seldom [-h] [-V] [--startproject STARTPROJECT] [-r R]WebUI automation testing framework based on Selenium.optional arguments:-h, --help show this help message and exit-V, --version show version--startproject STARTPROJECTSpecify new project name.-r R run test case 2、创建项目 seldom --startproject mypro 3、目录结构 mypro/ ├── test_dir/ │ ├── test_sample.py ├── report/ └── run.py test_dir/目录实现用例编写。report/ 目录存放生成的测试报告。run.py 文件运行测试用例。 3、运行项目 seldom -r run.py Python 3.7.1 _ _| | | |___ ___ | | __| | ___ _ __ ___ / __| / _ \| | / _ | / _ \ | _ _ \ \__ \| __/| || (_| || (_) || | | | | | |___/ \___||_| \__,_| \___/ |_| |_| |_| -----------------------------------------itest.infogenerated html file: file:///D:\mypro\reports\2019_11_12_22_28_53_result.html .1 4、查看报告 你可以到 mypro\reports\ 目录查看测试报告。 API Documents simple demo 请查看 demo/test_sample.py 文件 import seldomclass YouTest(seldom.TestCase):def test_case(self):a simple test case self.open(https://www.baidu.com)self.type(id_kw, textseldom)self.click(css#su)self.assertTitle(seldom)if __name__ __main__:seldom.main(test_sample.py)说明 创建测试类必须继承 seldom.TestCase。测试用例文件命名必须以 test 开头。seldom的封装了assertTitle、assertUrl 和 assertText等断言方法。 main() 方法 import seldom# ...if __name__ __main__:seldom.main(path./,browserchrome,title百度测试用例, description测试环境chrome, debugFalse,rerun0,save_last_runFalse) 说明 path 指定测试目录或文件。browser: 指定测试浏览器默认Chrome。title 指定测试报告标题。description 指定测试报告描述。debug debug模式设置为True不生成测试HTML测试默认为False。rerun : 设置失败重新运行次数默认为 0。save_last_run : 设置只保存最后一次的结果默认为False。 Run the test import seldomseldom.main(path./) # 当前目录下的所有测试文件 seldom.main(path./test_dir/) # 指定目录下的所有测试文件 seldom.main(path./test_dir/test_sample.py) # 指定目录下的测试文件 seldom.main(pathtest_sample.py) # 指定当前目录下的测试文件 说明 如果指定的目录测试文件必须以test 开头。如果要运行子目录下的文件必须在子目录下加 __init__.py 文件。 支持的浏览器及驱动 如果你想指定测试用例在不同的浏览器中运行非常简单只需要在seldom.main()方法中通过browser 参数设置。 import seldomif __name__ __main__:seldom.main(browserchrome) # chrome浏览器,默认值seldom.main(browserfirefox) # firefox浏览器seldom.main(browserie) # IE浏览器seldom.main(browseropera) # opera浏览器seldom.main(browseredge) # edge浏览器seldom.main(browserchrome_headless) # chrome浏览器headless模式seldom.main(browserfirefox_headless) # Firefox浏览器headless模式不同浏览器驱动下载地址 geckodriver(Firefox):Releases · mozilla/geckodriver · GitHub Chromedriver(Chrome):https://sites.google.com/a/chromium.org/chromedriver/home IEDriverServer(IE):http://selenium-release.storage.googleapis.com/index.html operadriver(Opera):Releases · operasoftware/operachromiumdriver · GitHub MicrosoftWebDriver(Edge):Microsoft Edge WebDriver - Microsoft Edge Developer 元素定位 form idform classfm action/s namefspan classbg s_ipt_wr quickdelete-wrapinput idkw classs_ipt namewd 定位方式 self.type(id_kw, textseldom) self.type(namewd, textseldom) self.type(class_names_ipt, textseldom) self.type(taginput, textseldom) self.type(link_texthao123, textseldom) self.type(partial_link_texthao, textseldom) self.type(xpath//input[idkw], textseldom) self.type(css#kw, textseldom)参数化测试用例 seldom 支持参数化测试用例集成了parameterized。 import seldom from seldom import ddt# ...class BaiduTest(seldom.TestCase):ddt.data([(1, seldom),(2, selenium),(3, unittest),])def test_baidu(self, name, keyword):used parameterized test:param name: case name:param keyword: search keywordself.open(https://www.baidu.com)self.type(id_kw, textkeyword)self.click(css#su)self.assertTitle(search_key_百度搜索) page objects 设计模式 seldom 支持Page objects设计模式可以配合poium 使用。 import seldom from poium import Page, PageElementclass BaiduPage(Page):baidu pagesearch_input PageElement(id_kw)search_button PageElement(id_su)class BaiduTest(seldom.TestCase):Baidu serach test casedef test_case(self):A simple testpage BaiduPage(self.driver)page.get(https://www.baidu.com)page.search_input seldompage.search_button.click()self.assertTitle(seldom_百度搜索)if __name__ __main__:seldom.main(test_po_demo.py)poium提供了更多好用的功能使Page层的创建更加简单。 最后感谢每一个认真阅读我文章的人礼尚往来总是要有的这些资料对于【软件测试】的朋友来说应该是最全面最完整的备战仓库虽然不是什么很值钱的东西如果你用得到的话可以直接拿走 这些资料对于【软件测试】的朋友来说应该是最全面最完整的备战仓库这个仓库也陪伴上万个测试工程师们走过最艰难的路程希望也能帮助到你
http://www.pierceye.com/news/559121/

相关文章:

  • 网站建设情况报告范文wordpress用户注册提醒
  • 湛江商城网站制作公司闵行建设机械网站
  • 做网站seo赚钱吗平面广告设计作品集
  • 购物中心网站建设六安政务中心网站
  • 做网站公司赚钱吗?抖音小程序推广怎么挂才有收益
  • 滁州网站建设建设银行租房平台网站6
  • h5自适应网站模板下载阿里云域名注册好了怎么做网站
  • 德州做网站多少钱网站实现搜索功能
  • 帝国cms7.0网站搬家换域名换空间等安装教程万网云虚拟主机上传网站
  • 网站建设推广接单语wordpress 所有文章
  • 申请域名后怎么做网站网站建设与维护中国出版社
  • 洛阳做网站那家好课程网站建设开题报告
  • 到哪里建网站商务网站建设学期总结
  • 铜陵app网站做营销招聘网站开发公司需要投入什么资源
  • 建购物的网站需要多少钱wordpress不显示头像
  • 如何做一个个人网站长春网站建设wang
  • 湖南省做网站的网站资讯建设
  • 滨江网站建设制作如何建设网站方便后期维护
  • dedecms手机网站插件wordpress模板中文
  • 网站建设合同封面模板下载天津专业网站设计
  • 毕业设计网站做几个2345浏览器网页版
  • 南阳市网站建设国家建设协会工程质量分会网站
  • 苗木网站开发需求自己做网站转发新闻违法么
  • 招商网站建设解决方案wordpress页面转移
  • 门户网站开发方案文档做网站切片
  • 中国房地产新闻关键词seo排名优化如何
  • 网站大型网页游戏上海装修公司排名统帅
  • hostinger建站wordpress互联网营销方案策划
  • 门户网站维护方案杭州网站建设公司哪家好
  • 深泽网站建设在wordpress加入文件管理器