コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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"
コード例 #4
0
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 == "泉州展览城"
コード例 #5
0
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 == "拨号失败,无法连接到通话网络。"
コード例 #6
0
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
コード例 #7
0
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 == "灯泡损坏指示灯"
コード例 #8
0
class TestNewCar:
    def setup_class(self):
        self.app = App()
        self.main = self.app.start().my().more().goto_new_car()

    def teardown_class(self):
        # self.main.base_quit()
        self.app.back()

    def setup(self):
        pass

    def teardown(self):
        self.app.back()

    def test_new_car(self):
        car_name, brandtype_serial_name = self.main.new_car()
        assert car_name == brandtype_serial_name

    def test_ask_price(self):
        car_name, car_name_askprice = self.main.ask_price()
        assert car_name in car_name_askprice
コード例 #9
0
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
コード例 #10
0
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
コード例 #11
0
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
コード例 #12
0
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 == "已保存到相册"