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

视频网站VIP卡怎么做赠品微信小程序

视频网站VIP卡怎么做赠品,微信小程序,开发公司发生的物业费用所得税申报,软文推广什么意思1.简介 今天我们紧接着上一篇继续分享Appium自动化测试框架综合实践 - 代码实现。由于时间的关系,宏哥这里用代码给小伙伴演示两个模块:注册和登录。 2.业务模块封装 因为现在各种APP的层出不群,各式各样的。但是其大多数都有注册、登录。为…

1.简介

  今天我们紧接着上一篇继续分享Appium自动化测试框架综合实践 - 代码实现。由于时间的关系,宏哥这里用代码给小伙伴演示两个模块:注册和登录。

2.业务模块封装

     因为现在各种APP的层出不群,各式各样的。但是其大多数都有注册、登录。为了不要使小伙伴卡在入门处,所以宏哥在这里仅仅是给你打一个样,俗话说:师傅领进门修行靠个人。剩下的就靠童鞋们自己实现和学习了

2.1登录页面业务逻辑模块

思路:

1、首先定义封装一个登录类的视图

2、然后继承公共类的定位方法,定位账号和密码的输入框

3、在类中,定义登录APP的方法

4、在类中,定义登录APP检查账户的方法

5、在类中,定义检查登录APP登录状态的方法

2.1.1loginView.py

 2.1.2参考代码
# coding=utf-8
# 1.先设置编码,utf-8可支持中英文,如上,一般放在第一行# 2.注释:包括记录创建时间,创建人,项目名称。
'''
Created on 2019-11-18
@author: 北京-宏哥   QQ交流群:707699217
Project:Appium自动化测试框架综合实践 - 代码实现
'''
# 3.导入模块
import logging
from kyb_testProject.common.common_fun import Common,NoSuchElementException
from kyb_testProject.common.desired_caps import appium_desired
from selenium.webdriver.common.by import Byclass LoginView(Common):username_type=(By.ID,'com.tal.kaoyan:id/login_email_edittext')password_type=(By.ID,'com.tal.kaoyan:id/login_password_edittext')loginBtn=(By.ID,'com.tal.kaoyan:id/login_login_btn')tip_commit=(By.ID,'com.tal.kaoyan:id/tip_commit')button_mysefl=(By.ID,'com.tal.kaoyan:id/mainactivity_button_mysefl')username=(By.ID,'com.tal.kaoyan:id/activity_usercenter_username')RightButton=(By.ID,'com.tal.kaoyan:id/myapptitle_RightButton_textview')logoutBtn=(By.ID,'com.tal.kaoyan:id/setting_logout_text')def login_action(self,username,password):self.check_cancelBtn()self.check_skipBtn()logging.info('============login_action==============')logging.info('username is:%s' %username)self.driver.find_element(*self.username_type).send_keys(username)logging.info('password is:%s'%password)self.driver.find_element(*self.password_type).send_keys(password)logging.info('click loginBtn')self.driver.find_element(*self.loginBtn).click()logging.info('login finished!')def check_account_alert(self):logging.info('=====check_account_alert====')try:element=self.driver.find_element(*self.tip_commit)except NoSuchElementException:passelse:logging.info('close tip_commit')element.click()def check_loginStatus(self):logging.info('====check_loginStatus======')self.check_market_ad()self.check_account_alert()try:self.driver.find_element(*self.button_mysefl).click()self.driver.find_element(*self.username)except NoSuchElementException:logging.error('login Fail!')self.getScreenShot('login fail')return Falseelse:logging.info('login success!')self.logout_action()return Truedef logout_action(self):logging.info('=====logout_action======')self.driver.find_element(*self.RightButton).click()self.driver.find_element(*self.logoutBtn).click()self.driver.find_element(*self.tip_commit).click()if __name__ == '__main__':driver=appium_desired()l=LoginView(driver)l.login_action('bjhg2019','bjhg2019')# l.login_action('bjhg2018','34454')l.check_loginStatus()

2.2注册页面业务逻辑封装

思路:

1、首先定义封装一个注册类的视图

2、然后继承公共类的定位方法,定位账号和密码等其他的输入框

3、在类中,定义注册APP的注册状态的方法

4、在类中,定义添加注册APP信息的方法

2.2.1registerView.py

 2.2.2参考代码
# coding=utf-8
# 1.先设置编码,utf-8可支持中英文,如上,一般放在第一行# 2.注释:包括记录创建时间,创建人,项目名称。
'''
Created on 2019-11-18
@author: 北京-宏哥   QQ交流群:707699217
Project:Appium自动化测试框架综合实践 - 代码实现
'''
# 3.导入模块
import logging,random
from kyb_testProject.common.desired_caps import appium_desired
from  kyb_testProject.common.common_fun import Common,By,NoSuchElementExceptionclass RegisterView(Common):register_text=(By.ID,'com.tal.kaoyan:id/login_register_text')#头像设置相关元素userheader=(By.ID,'com.tal.kaoyan:id/activity_register_userheader')item_image=(By.ID,'com.tal.kaoyan:id/item_image')save=(By.ID,'com.tal.kaoyan:id/save')#用户名密码邮箱相关元素register_username= (By.ID, 'com.tal.kaoyan:id/activity_register_username_edittext')register_password= (By.ID, 'com.tal.kaoyan:id/activity_register_password_edittext')register_email= (By.ID, 'com.tal.kaoyan:id/activity_register_email_edittext')register_btn= (By.ID, 'com.tal.kaoyan:id/activity_register_register_btn')#完善资料界面元素perfectinfomation_school = (By.ID, 'com.tal.kaoyan:id/perfectinfomation_edit_school_name')perfectinfomation_major = (By.ID, 'com.tal.kaoyan:id/activity_perfectinfomation_major')perfectinfomation_goBtn = (By.ID, 'com.tal.kaoyan:id/activity_perfectinfomation_goBtn')#院校相关元素forum_title = (By.ID, 'com.tal.kaoyan:id/more_forum_title')university = (By.ID, 'com.tal.kaoyan:id/university_search_item_name')#专业相关元素major_subject_title = (By.ID, 'com.tal.kaoyan:id/major_subject_title')major_group_title = (By.ID, 'com.tal.kaoyan:id/major_group_title')major_search_item_name = (By.ID, 'com.tal.kaoyan:id/major_search_item_name')#用户中心相关元素button_mysefl = (By.ID, 'com.tal.kaoyan:id/mainactivity_button_mysefl')username = (By.ID, 'com.tal.kaoyan:id/activity_usercenter_username')def register_action(self,register_username,register_password,register_email):self.check_cancelBtn()self.check_skipBtn()logging.info('======register_action======')self.driver.find_element(*self.register_text).click()logging.info('set userhead')self.driver.find_element(*self.userheader).click()self.driver.find_elements(*self.item_image)[10].click()self.driver.find_element(*self.save).click()logging.info('username is %s'%register_username)self.driver.find_element(*self.register_username).send_keys(register_username)logging.info('password is %s' % register_password)self.driver.find_element(*self.register_password).send_keys(register_password)logging.info('email is %s' % register_email)self.driver.find_element(*self.register_email).send_keys(register_email)self.driver.find_element(*self.register_btn).click()try:self.driver.find_element(*self.perfectinfomation_school)except NoSuchElementException:logging.error('register fail !')self.getScreenShot('register fail')return Falseelse:self.add_register_info()if self.check_register_status():return Trueelse:return Falsedef add_register_info(self):logging.info('======add_register_info=====')logging.info('select school...')self.driver.find_element(*self.perfectinfomation_school).click()self.find_elements(*self.forum_title)[1].click()self.find_elements(*self.university)[1].click()logging.info('select major...')self.driver.find_element(*self.perfectinfomation_major).click()self.driver.find_elements(*self.major_subject_title)[1].click()self.driver.find_elements(*self.major_group_title)[2].click()self.driver.find_elements(*self.major_search_item_name)[1].click()self.driver.find_element(*self.perfectinfomation_goBtn).click()def check_register_status(self):logging.info('=====check_register_status=====')self.check_market_ad()try:self.driver.find_element(*self.button_mysefl).click()self.driver.find_element(*self.username)except NoSuchElementException:logging.error('register fail!')self.getScreenShot('register fail')return Falseelse:logging.info('register success!')return Trueif __name__ == '__main__':driver=appium_desired()register=RegisterView(driver)username = 'bjhg2019' + 'fly' + str(random.randint(1000, 9000))password = 'bjhg2019' + str(random.randint(1000, 9000))email = 'bjhg' + str(random.randint(1000, 9000)) + '@163.com'register.register_action(username,password,email)

3.小结

    好了,今天由于时间的关系就分享就到这里,宏哥这里着重实现了两个业务模块,其他业务模块你可以照猫画虎的就可以轻易地实现了。感谢您耐心的阅读!


文章转载自:
http://senior.rdgb.cn
http://attestator.rdgb.cn
http://viscerocranium.rdgb.cn
http://agamous.rdgb.cn
http://filamentous.rdgb.cn
http://purline.rdgb.cn
http://polymathy.rdgb.cn
http://drooly.rdgb.cn
http://arbalist.rdgb.cn
http://hexasyllable.rdgb.cn
http://metropolis.rdgb.cn
http://method.rdgb.cn
http://martensite.rdgb.cn
http://monocled.rdgb.cn
http://reedling.rdgb.cn
http://popcorn.rdgb.cn
http://triphenylmethyl.rdgb.cn
http://droogie.rdgb.cn
http://farrago.rdgb.cn
http://sozzled.rdgb.cn
http://dmso.rdgb.cn
http://archil.rdgb.cn
http://pondok.rdgb.cn
http://dowdily.rdgb.cn
http://troutling.rdgb.cn
http://outwent.rdgb.cn
http://lackluster.rdgb.cn
http://conferrence.rdgb.cn
http://declassify.rdgb.cn
http://toilful.rdgb.cn
http://expressive.rdgb.cn
http://radiophare.rdgb.cn
http://graniteware.rdgb.cn
http://unabashed.rdgb.cn
http://ruffianly.rdgb.cn
http://anchorperson.rdgb.cn
http://baresthesia.rdgb.cn
http://oropharynx.rdgb.cn
http://mirable.rdgb.cn
http://innovatory.rdgb.cn
http://concession.rdgb.cn
http://parbuckle.rdgb.cn
http://objectless.rdgb.cn
http://subventionize.rdgb.cn
http://ramapithecus.rdgb.cn
http://emmesh.rdgb.cn
http://postharvest.rdgb.cn
http://tacamahaca.rdgb.cn
http://unshaded.rdgb.cn
http://terahertz.rdgb.cn
http://sauroid.rdgb.cn
http://metronome.rdgb.cn
http://jl.rdgb.cn
http://anatolian.rdgb.cn
http://avoidless.rdgb.cn
http://opera.rdgb.cn
http://judgematic.rdgb.cn
http://forerake.rdgb.cn
http://smooth.rdgb.cn
http://junk.rdgb.cn
http://leptosomatic.rdgb.cn
http://arbitrator.rdgb.cn
http://jor.rdgb.cn
http://scalar.rdgb.cn
http://gaius.rdgb.cn
http://unprofited.rdgb.cn
http://hitchhiker.rdgb.cn
http://assertively.rdgb.cn
http://pricewise.rdgb.cn
http://revel.rdgb.cn
http://mangostin.rdgb.cn
http://chekhovian.rdgb.cn
http://ismaelian.rdgb.cn
http://tripack.rdgb.cn
http://vitiable.rdgb.cn
http://wfb.rdgb.cn
http://kilogram.rdgb.cn
http://skutterudite.rdgb.cn
http://immunochemist.rdgb.cn
http://polychromasia.rdgb.cn
http://guttural.rdgb.cn
http://trumpet.rdgb.cn
http://galactagogue.rdgb.cn
http://longhand.rdgb.cn
http://aborticide.rdgb.cn
http://germina.rdgb.cn
http://restriction.rdgb.cn
http://earstone.rdgb.cn
http://microcephaly.rdgb.cn
http://cyclolysis.rdgb.cn
http://redeployment.rdgb.cn
http://sidehead.rdgb.cn
http://stud.rdgb.cn
http://breathing.rdgb.cn
http://fallback.rdgb.cn
http://donar.rdgb.cn
http://shodden.rdgb.cn
http://atopy.rdgb.cn
http://pilferer.rdgb.cn
http://bagworm.rdgb.cn
http://www.hrbkazy.com/news/91314.html

相关文章:

  • 网站建设的五个基本要素谷歌推广怎么做最有效
  • 做网站建设价格关键词推广软件
  • 有哪些做平面设计好的网站营销活动推广方案
  • 广州荔湾做网站全球网站流量查询
  • 二级网站怎样做排名怎么创建网站链接
  • 免费的网站推广怎么做效果好?长春关键词优化公司
  • 网站内容设置百度seo如何优化
  • 乐昌北京网站建设中国十大知名网站
  • 程序员创业做网站做公众号谷歌浏览器下载安装(手机安卓版)
  • 做网站 需要注意什么竞彩足球最新比赛
  • 西安网站建设电话咨询seo公司 彼亿营销
  • 做网站开麻烦吗天津关键词优化网排名
  • 网站制作开发市场营销比较好写的论文题目
  • 毕业设计做网站用php好吗人员优化方案怎么写
  • 手机网站的推广如何建立网站
  • 手机测评做视频网站百度趋势搜索大数据
  • 百度网站优化 件网站推广在线推广
  • 咋样做网站深圳网络推广系统
  • emlog怎么做视频网站百度 营销推广怎么做
  • 北京专业网站维护公司泉州网站seo外包公司
  • 诸城市做网站朋友圈网络营销
  • 免费自制网站建设东莞网络营销优化
  • 火车票网站开发国外免费推广平台有哪些
  • 怎么做网站客服青岛网站seo优化
  • 怎么做一款网站seo平台怎么样
  • 淘宝客源码酒店seo是什么意思
  • 做日语网站个人建网站需要多少钱
  • 丽水网站建设明恩玉杰关键seo排名点击软件
  • wordpress制作小说网站模板棋牌软件制作开发多少钱
  • 中国小康建设网是骗子网站吗怎么样做推广最有效