class TestNearbyDealers: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_nearby_dealers() def teardown_class(self): self.app.base_quit() def setup(self): pass def teardown(self): pass def test_switch_position(self): addr = self.main.switch_position() assert "泉州" in addr def test_nearby_dealers(self): sales_title = self.main.nearby_dealers() assert sales_title == "推荐销售" self.app.back() def test_map(self): addr = self.main.map() # 模拟器 # assert addr == "泉州展览城-东门" # OPPO assert addr == "泉州展览城"
class TestConditionSelection: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_condition_selection() def teardown_class(self): self.app.base_quit() def setup(self): pass def teardown(self): # self.main.my().more().goto_condition_selection().page_back() pass def test_condition_selection(self): car_name, brandtype_serial_name = self.main.condition_selection() assert car_name == brandtype_serial_name self.app.back() def test_clear(self): toast_msg = self.main.clear() assert "为您找到" in toast_msg def test_history(self): toast_msg = self.main.history() assert "为您找到" in toast_msg
class TestSecondHandCar: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_second_car() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): pass def test_conditions(self): title = self.main.condition() assert "2014款" in title self.app.back() def test_clear(self): self.main.clear() def test_change_city(self): addr = self.main.change_city() assert "沈阳" in addr
class TestCommentList: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_sales_ranking() def teardown_class(self): self.app.base_quit() def setup(self): pass def teardown(self): self.app.back() def test_sales_list(self): type = self.main.sales_list() assert type == "国产/中大型SUV" def test_comment_list(self): type = self.main.comment_list() assert type == "进口/中大型SUV" def test_popularity_list(self): type = self.main.popularity_list() assert type == "进口/中大型SUV" def test_rank_residualratio(self): type = self.main.rank_residualratio_list() assert type == "进口/中大型SUV"
class TestCalculator: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_cal() def teardown_class(self): self.app.base_quit() # self.app.back() def setup(self): pass def teardown(self): pass def test_calculator(self): btn = self.main.cal() assert btn == "必要花费" def test_loan(self): contains = self.main.loan() assert contains == "首付比例" def test_reset(self): btn_clear = self.main.reset() assert btn_clear == "清空历史"
class TestStartStop: def setup(self): self.main = App() def teardown(self): self.main.base_quit() def test_start_stop(self): # self.main.start_stop() self.main.start_stop()
class TestFourStepCarSelection: def setup(self): self.main = App() def teardown(self): self.main.base_quit() def test_four_step_car_selection(self): ask_price_btn = self.main.start().my().more( ).goto_four_step_car_selection().four_steps() assert ask_price_btn == "获取底价"
class TestBeautyChooseCar: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_beauty_choose_car() def teardown(self): self.app.base_quit() def test_beauty_choose_car(self): info = self.main.beauty_choose_car() assert info == "颜值太高了识别失败。请重新拍照上传清晰的照片吧"
class TestPriceCutRanking: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_price_cut_ranking() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): pass # 条件选车 def test_conditions(self): car_name, brandType_title = self.main.conditions() assert car_name == brandType_title self.app.back() # 贷款 def test_loan(self): btn = self.main.loan() assert "贷款" in btn # 提交贷款 def test_submit_loan(self): toast = self.main.submit_loan() assert toast == "提交成功" # 询底价 def test_ask_price(self): fapr_tv_title = self.main.ask_price() assert fapr_tv_title == "询价成功" self.app.back() # 清空 def test_clear(self): self.main.clear() # 切换城市 def test_change_city(self): addr = self.main.change_city() assert "南京" in addr # 批量询价 def test_ask_price_all(self): toast = self.main.ask_price_all() assert toast == "提交成功" # 400电话 # def test_tel(self): # alertTitle = self.main.tel() # assert alertTitle == "拨号失败,无法连接到通话网络。"
class TestCarReplacement: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_car_replacement() def teardown(self): self.app.base_quit() # 二手车置换 def test_car_replacement(self): msg, msg_list = self.main.car_replacement() assert msg in msg_list
class TestBorrowCash: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_borrow_cash() def teardown(self): self.app.base_quit() # 借现金 def test_borrow_cash(self): title = self.main.borrow_cash() assert title == "度小满金融"
class TestAppointMent: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_appointment() def teardown(self): self.app.base_quit() # 预约保养 def test_appoinment(self): title = self.main.appointment() assert title == "保养服务"
class TestSellCar: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_sell_car() def teardown(self): self.app.base_quit() # 高价卖车 def test_sell_car(self): msg, msg_list = self.main.sell_car() assert msg in msg_list
class TestLicenseScoring: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_license_scoring() def teardown(self): self.app.base_quit() # 驾照查分 def test_license_scoring(self): toast_msg = self.main.license_scoring() assert toast_msg == "查询失败,请稍后再试"
class TestTakePhotos: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_take_photos() def teardown(self): self.app.base_quit() # 拍照识车 def test_take_photos(self): car_name, brandtype_serial_name = self.main.take_photos() assert car_name == brandtype_serial_name
class TestDialIndicator: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_dial_indicator() def teardown(self): self.app.base_quit() # 表盘指示灯 def test_dial_indicator(self): alarm = self.main.dial_indicator() assert alarm == "保持模式指示灯"
class TestCarValuation: def setup(self): self.app = App() self.main = self.app.start().my().more().goto_car_valuation() def teardown(self): self.app.base_quit() # 爱车估值 def test_car_valuation(self): msg = self.main.car_valuation() assert msg == "暂无该车估值数据"
class TestTravelReminder: def setup(self): self.app = App() self.main = self.app.start().my() def teardown(self): self.app.base_quit() # 出行提醒 def test_travel_reminder(self): mine_weather_text = self.main.get_weather() weather = self.main.more().goto_travel_reminder().travel_reminder() assert weather in mine_weather_text
class TestIllegalInquiry: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_illegal_inquiry() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): pass # 查看详情-查看罚款 def test_detail_fine(self): fine = self.main.details_fine() assert fine == "200" self.app.back() # 查看详情-代缴 def test_detail_pay(self): title = self.main.details_pay() assert title == "上传相关证件复印件照片" self.app.back() # 查看详情-处罚判决书 def test_details_judgement(self): title = self.main.details_judgement() assert title == "汽车报价大全" self.app.back() # 违章查询 def test_illegal_inquiry(self): fine = self.main.illegal_inquiry() assert fine == "200" self.app.back() # 添加车辆 def test_add(self): number = self.main.add() assert number == "GD2126" # 删除 def test_delete(self): numbers = self.main.delete() assert "GD2126" not in numbers
class TestLotteryQuery: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_lottery_query() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): self.app.back() # 增加摇号信息 def test_add(self): name, name_query, number, number_query = self.main.add( "yang2", "6666666666666") assert name == name_query
class TestStartCompare: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_model_comparison() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): pass def test_add_recommended_models(self): car_name, compare_car_name = self.main.add_recommended_models() assert car_name in compare_car_name def test_edit_all_del(self): empty_info = self.main.edit_all_del() assert empty_info == "暂无对比车款"
class TestBake: def setup_class(self): self.app = App() self.main = self.app.start().my().more().goto_baike() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): self.app.back() def test_baike(self): title, topic_subject = self.main.baike() assert title == topic_subject def test_more(self): title = self.main.more() assert title == "灯泡损坏指示灯"
class TestYicheNumber: def setup_class(self): self.app = App() self.main = self.app.start().found().goto_yiche_number() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): self.app.back() # 选择新闻 def test_news(self): title, title_detail = self.main.news() assert title == title_detail # 选择视频 def test_video(self): title, title_detail = self.main.video() assert title == title_detail
class TestOriginal: def setup_class(self): self.app = App() self.main = self.app.start().found().goto_original() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): # self.app.back() pass # 查看新闻详情页的图片大图 # def test_new_car_detail_big_picture(self): # msg = self.main.new_car_detail_big_picture() # assert msg == "已保存到相册" # 点击新闻详情页相关推荐-车型 def test_new_car_detail_recommend_car(self): car_name, brand_car = self.main.new_car_detail_recommend_car() assert brand_car in car_name # 点击新闻详情页相关推荐-询底价 def test_new_car_detail_recommend_ask_price(self): btn = self.main.new_car_detail_recommend_ask_price() assert btn == "获取底价" # 点击新闻详情页相关推荐-资讯 def test_new_car_detail_recommend_news(self): news_title, title = self.main.new_car_detail_recommend_news() assert title in news_title # 点击新闻详情页-评论 def test_new_car_detail_comment(self): msg = self.main.new_car_detail_comment() assert msg == "评论成功!" # 点击新闻详情页-查看全部评论 def test_new_car_detail_comment_all(self): comment = self.main.new_car_detail_comment_all() assert comment == "不错诶" # 点击新闻详情页-收藏 def test_new_car_detail_collection(self): lis = ["收藏成功", "已取消收藏"] msg = self.main.new_car_detail_collection() assert msg in lis # 点击新闻详情页-分享 def test_new_car_detail_share(self): weixin = self.main.new_car_detail_share() assert weixin == "微信好友" # 点击新闻详情页-看车 def test_new_car_detail_look_car(self): car_name, brand_name = self.main.new_car_detail_look_car() assert car_name == brand_name # 点击新闻详情页-询底价 def test_new_car_detail_look_car_ask_price(self): btn = self.main.new_car_detail_look_car_ask_price() assert btn == "获取底价" # 点击新闻详情页-看车-参数配置 def test_new_car_detail_look_car_parameter(self): notice = self.main.new_car_detail_look_car_parameter() assert notice == "注:以上仅供参考,请以店内实车为准" # 点击新闻详情页-看车-图片 def test_new_car_detail_look_car_picture(self): msg = self.main.new_car_detail_look_car_picture() assert msg == "已保存到相册" # 点击新闻详情页-看车-最新资讯 def test_new_car_detail_look_car_news(self): status = self.main.new_car_detail_look_car_news() assert status == True # 点击新闻详情页-看车-车款列表 def test_new_car_detail_look_car_cartypelist(self): status = self.main.new_car_detail_look_car_cartypelist() assert status == True # 评论数大于20条的新闻详情-新增主评论 # def test_add_comment(self): # content, content_send = self.main.add_comment() # assert content == content_send # 进入评测tab def test_goto_evaluating(self): title, title_detail = self.main.goto_evaluating() assert title == title_detail # 进入导购tab def test_goto_shopping(self): title, title_detail = self.main.goto_shopping() assert title == title_detail # 进入图片tab def test_goto_picture(self): title, title_detail = self.main.goto_picture() assert title == title_detail # 图片新闻列表页 查看图片大图 def test_list_picture(self): msg = self.main.list_picture() assert msg == "已保存到相册"
class TestSmallVideo: def setup_class(self): self.app = App() self.main = self.app.start().found().goto_small_video() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): self.app.back() # 收藏 def test_collection(self): collection = self.main.collection() assert collection == True # 更多分享分享 def test_more_share(self): weixin = self.main.more_share() assert weixin == "微信好友" # 进入销售详情页面 def test_sale_detail(self): sale_name, name = self.main.goto_sale_detail() assert sale_name == name # 销售详情页-微聊 def test_sale_detail_chat(self): name, title = self.main.sale_detail_chat() assert name in title # 销售详情页-关注 def test_sale_detail_focus(self): msg = self.main.sale_detail_focus() assert msg == "已关注" # 销售详情页-查看粉丝 def test_sale_detail_fans(self): name = self.main.sale_detial_fans() assert name == "大全儿6359微博" # 销售详情页-话题-点赞 def test_sale_detail_like(self): count, count_like = self.main.sale_detail_topic_like() assert count_like == (count + 1) # 销售详情页-话题-评论 def test_sale_detail_comment(self): msg = self.main.sale_detail_topic_comment() assert msg == "评论成功,已进入审核" # 销售详情页-话题-关联车型 def test_sale_detail_topic_car(self): car_name, brandtype_serial_name = self.main.sale_detail_topic_car() assert car_name == brandtype_serial_name # 销售详情页-TA的评论 def test_sale_detail_salecomment(self): info = self.main.sale_detail_salecomment() assert info == "TA还没有发表过评论" # 销售详情页-发布话题 def test_sale_detail_post_topic(self): msg = self.main.sale_datail_post_topic() assert msg == "话题发表中…" # 小视频详情页-点赞 def test_small_video_like(self): count, count_like = self.main.small_video_like() assert count_like == (count + 1) # 小视频详情页-评论 def test_small_video_comment(self): msg = self.main.small_video_comment() assert msg == "聊一聊你的想法吧~" # 小视频详情页-分享 def test_small_video_share(self): pyq = self.main.small_video_share() assert pyq == "朋友圈" # 小视频详情页-询底价, 有接口逻辑,暂不做UI自动化 # def test_small_video_ask_price(self): # ask_btn = self.main.small_video_ask_price() # assert ask_btn == "获取底价" # 小视频详情页-微聊 def test_small_video_chat(self): sale_name, title = self.main.small_video_chat() assert sale_name in title # 经销商详情页-地图导航 def test_dealer_detail_map(self): addr, addr_map = self.main.dealer_detail_map() assert addr_map in addr # 经销商详情页-推荐销售 def test_dealer_detail_sale(self): name, sale_name = self.main.dealer_detail_sale() assert name == sale_name # 经销商详情页-经销商小视频 def test_dealer_detail_small_video(self): video_title, title = self.main.dealer_detail_small_video() assert video_title in title # 经销商详情页-贷款 def test_dealer_detail_loan(self): btn = self.main.dealer_detail_loan() assert btn == "申请贷款" # 经销商详情页-预约保养 def test_dealer_detail_appointment(self): title = self.main.dealer_detail_appointment() assert title == "填写预约信息" # 经销商详情页-获取底价 def test_dealer_detail_ask_price(self): btn = self.main.dealer_detail_ask_price() assert btn == "获取底价" # 小视频详情页-暂停播放 def test_smal_video_stop(self): status = self.main.smal_video_stop() assert status == True # 小视频tab-发布小视频 # def test_post_small_video(self): # msg = self.main.post_small_video() # assert "话题发表中" in msg
class TestHeadlines: def setup_class(self): self.app = App() self.main = self.app.start().found().goto_headlines() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): pass # 专题 def test_special(self): is_enabled = self.main.special() assert is_enabled == True self.app.back() # 资讯 def test_news(self): news_title, topic_subject = self.main.news() assert news_title in topic_subject self.app.back() # 广告 def test_adver(self): is_enabled = self.main.adver() # print(is_enabled) if is_enabled == "没有广告": assert is_enabled == "没有广告" else: assert is_enabled == True self.app.back() # 小视频 def test_small_video(self): title, title_detail = self.main.small_video() if title == "头条tab下没有小视频": assert title_detail == "头条tab下没有小视频" else: assert title_detail == title self.app.back() # 动态 def test_dynamic(self): content, content_lis = self.main.dynamic() assert content_lis in content self.app.back() # 动态点赞 def test_dynamic_like(self): count, count_like = self.main.dynamic_like() assert count_like == (count + 1) # 动态-评论 def test_dynamic_comment(self): comment, comment_content = self.main.dynamic_comment() assert comment == comment_content self.app.back() # 动态-销售详情 def test_dynamic_sales_detail(self): name, sale_name = self.main.dynamic_sales_detail() assert name == sale_name self.app.back() # 动态-销售红包 def test_dynamic_red_packet(self): title = self.main.dynamic_red_packet() assert title == "限时领取" self.app.back() # 动态-动态详情-微聊 def test_dynamic_detail_chat(self): sale_name, title = self.main.dynamic_detail_chat() assert sale_name in title self.app.back() # 动态详情-图片放大 def test_dynamic_list_picture(self): msg = self.main.dynamic_list_picture() assert msg == "已保存到相册" self.app.back() # 视频-播放 def test_video_start(self): start = self.main.video_start() assert start == False # 视频-详情 def test_video_detail(self): title, title_detail = self.main.video_detail() assert title == title_detail self.app.back() # 资讯-关联车型 def test_news_serial_name(self): news_serial_name, brandtype_serial_name = self.main.news_serial_name() assert brandtype_serial_name in news_serial_name self.app.back() # 新车-新闻详情页-车型链接 def test_news_detail_car_link(self): car, brand_car = self.main.news_detail_car_link() assert car == brand_car self.app.back() # 新闻详情页 - 参数链接 def test_news_detail_parameter_link(self): notice = self.main.news_detail_parameter_link() assert notice == "注:以上仅供参考,请以店内实车为准" self.app.back() # 新闻详情页 - 询价链接 def test_news_detail_ask_price_link(self): btn = self.main.news_detail_ask_price_link() assert btn == "获取底价" self.app.back() # 新闻详情页 - 图片链接 def test_news_detail_picture_link(self): msg = self.main.news_detail_picture_link() assert msg == "已保存到相册"
class TestSquare: def setup_class(self): self.app = App() self.main = self.app.start().found().goto_square() def setup(self): pass def teardown_class(self): self.app.base_quit() def teardown(self): pass # 搜索帖子或用户 def test_search(self): user, name = self.main.search() assert user == name # 热门话题-精选tab-点赞 def test_selected_topic_like(self): count, count_liked = self.main.selected_topic_like() assert abs(count_liked-count) == 1 # 热门话题-精选tab-评论 def test_selected_topic_comment(self): msg = self.main.selected_topic_comment() assert msg == "评论成功,已进入审核" # 热门话题-精选tab-话题详情 def test_selected_topic_detail(self): name, user = self.main.selected_topic_detail() assert name == user # 热门话题-精选tab-图文话题详情-进入发布者详情页-关注 def test_selected_topic_detail_author_focus(self): focus = self.main.selected_topic_detail_author_focus() assert focus == "已关注" # 热门话题-精选tab-图文话题详情-进入发布者详情页-粉丝 def test_selected_topic_detail_author_fans(self): username = self.main.selected_topic_detail_author_fans() assert username == "大全儿6359微博" # 热门话题-精选tab-进入图文话题详情-分享-消息 def test_selected_topic_detail_share_news(self): msg_title = self.main.selected_topic_detail_share_news() assert msg_title == "社区消息 " # 热门话题-精选tab-进入图文话题详情-评论 def test_selected_topic_detail_comment(self): msg = self.main.selected_topic_detail_comment() assert msg == "评论成功,已进入审核" # 热门话题-精选tab-进入图文话题详情-收藏 def test_selected_topic_detail_collection(self): msg = self.main.selected_topic_detail_collection() assert msg == "话题收藏成功" # 热门话题-最新tab-进入小视频话题详情 # def test_selected_newest_detail(self): # username, name = self.main.selected_newest_detail() # assert username in name # 车型社区列表-选择车型-关注 def test_car_community_select_car_focus(self): focus = self.main.car_community_select_car_focus() assert focus == "已关注" # 固定车型社区-精华tab def test_essence(self): author, username = self.main.essence() assert author == username # 固定车型社区-最新tab def test_newest(self): author, username = self.main.newest() assert author == username # 固定车型社区-经销商tab-经销商详情 def test_dealers_detail(self): dealer_name, dealer_name_detail = self.main.dealers_detail() assert dealer_name_detail == dealer_name # 固定车型社区-经销商tab-贷款 def test_dealers_loan(self): submit = self.main.dealers_loan() assert submit == "申请贷款" # 固定车型社区-经销商tab-询底价 def test_dealers_ask_price(self): btn = self.main.dealers_ask_price() assert btn == "获取底价" # 车型社区列表页-点击第一条数据 def test_car_community_list(self): topic_user, user = self.main.car_community_list() assert topic_user == user # 每日榜单—热门帖子-图文帖子详情 def test_daily_list_hot_topic_detail(self): topic_user, user = self.main.daily_list_hot_topic_detail() assert topic_user == user # 每日榜单—热门帖子-小视频帖子详情 def test_daily_list_hot_video_detail(self): title, title_detail = self.main.daily_list_hot_video_detail() assert title == title_detail # 每日榜单—评论最多-帖子详情 def test_daily_list_most_comments_detail(self): count, count_detail = self.main.daily_list_most_comments_detail() assert count == count_detail # 每日榜单—获赞最多-帖子详情 def test_daily_list_most_likes_detail(self): topic_user, user = self.main.daily_list_most_likes_detail() assert topic_user == user # 提车 def test_pick_up_the_car(self): title = self.main.pick_up_the_car() assert title == "提 车" # 活动 def test_activity(self): title = self.main.activity() assert title == "活 动" # 选车 def test_select(self): title = self.main.select() assert title == "选 车" # 用车 def test_use_car(self): title = self.main.use_car() assert title == "用 车" # 视频 def test_video(self): title = self.main.video() assert title == "视 频" # 游记 def test_travel(self): title = self.main.travel() assert title == "游 记" # 问答 def test_qa(self): title = self.main.qa() assert title == "问 答" # 新鲜事 def test_something_new(self): title = self.main.something_new() assert title == "新 鲜 事" # 点击广场中的图文帖子 def test_square_topic_detail(self): topic_user, user = self.main.square_topic_detail() assert topic_user == user # 发布小视频 def test_post_video(self): msg = self.main.post_video() assert "话题发表中" in msg