예제 #1
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"
예제 #2
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
예제 #3
0
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 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
예제 #6
0
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()
예제 #7
0
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 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 == "获取底价"
예제 #9
0
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 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 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 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 == "暂无该车估值数据"
예제 #13
0
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 == "保持模式指示灯"
예제 #14
0
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 == "查询失败,请稍后再试"
예제 #16
0
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 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 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
예제 #19
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 == "灯泡损坏指示灯"
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 == "暂无对比车款"
예제 #21
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
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 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
예제 #24
0
 def setup(self):
     self.app = App()
     self.main = self.app.start().my().more().goto_beauty_choose_car()
예제 #25
0
 def setup_class(self):
     self.app = App()
     self.main = self.app.start().my().more().goto_baike()
예제 #26
0
 def setup(self):
     self.main = App()
예제 #27
0
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
예제 #28
0
 def setup_class(self):
     self.app = App()
     self.main = self.app.start().found().goto_square()
예제 #29
0
 def setup(self):
     self.app = App()
     self.main = self.app.start().my().more().goto_borrow_cash()
 def setup_class(self):
     self.app = App()
     self.main = self.app.start().my().more().goto_condition_selection()