Example #1
0
def test_change_pw():  # 修改密码
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').change_pw('3201', '3201', 'q5310543',
                                            '邮箱').change_pw(
                                                '3201', '3201', 'q5310543',
                                                '手机')
    ins.browser.close()
Example #2
0
def test_get_current_url():
    ins = Utomarket('test129', '3201')
    ins.login()

    assert get_current_url(ins.browser) == Settings.login_url
    time.sleep(2)
    ins.browser.close()
Example #3
0
def test_others_information():  # 已登录状态下查看他人用户信息
    ins = Utomarket('uitest7', '3201')
    ins.login().others_information()
    url = get_current_url(ins.browser)
    url_true = 'https://dev.utomarket.com:9094/#/personage'
    assert url_true in url
    ins.browser.close()
Example #4
0
def test_logout():  # 退出登录
    ins = Utomarket('test129', '3201')
    ins.login()
    time.sleep(3)
    ins.logout('退出登录')
    now_url = ins.get_url()
    assert now_url == 'https://dev.utomarket.com:9094/#/user/login'
    ins.browser.close()
Example #5
0
def test_center():  # 进入个人中心
    ins = Utomarket('test129', '3201')
    ins.login()
    ins.my_center('个人中心')
    assert get_current_url(
        ins.browser) == 'https://dev.utomarket.com:9094/#/user-center/index'
    time.sleep(2)
    ins.browser.close()
Example #6
0
def test_reload_webpage():
    ins = Utomarket('test129', '3201')
    ins.login()

    for _ in range(3):
        reload_webpage(ins.browser)
    time.sleep(2)
    ins.browser.close()
Example #7
0
def test_order():  # 进入我的订单
    ins = Utomarket('test129', '3201')
    ins.login()
    ins.my_center('我的订单')
    assert get_current_url(
        ins.browser) == 'https://dev.utomarket.com:9094/#/order/my'
    time.sleep(2)
    ins.browser.close()
Example #8
0
def test_auth():  # C1、C2认证
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').auth_c1(
        '谷志军', '431081199103136091').auth_c2().my_center("个人中心")
    grade = ins.browser.find_element_by_xpath(
        "//span[contains(text(),'认证等级')]/..")
    assert grade.text == '认证等级: C2'
    ins.browser.close()
Example #9
0
def test_cancel_order():  # 取消订单
    # ins_owner = Utomarket('test129', '3201')  # 广告主
    ins_trader = Utomarket('test128', '3201')  # 交易对象
    massege_content = '你是傻逼斯达克警方扩大解放开绿灯顺'
    ins_trader.login().ad_detail('test129').create_buy(
        type='交易数量').send_massege(massege_content)
    ins_owner = Utomarket('test129', '3201')  # 广告主
    ins_owner.login().progress_order()
    ins_owner.judge_massege_result(massege_content)
    ins_trader.cancel_order_buyer()
    ins_owner.cancel_order_seller()
    ins_trader.browser.close()
    ins_owner.browser.close()
Example #10
0
def test_release_shell_ad():  # 发布出售广告,固定价格
    ins = Utomarket('test129', '3201')
    ins.login().ad_btn('出售').release_ad(transaction_type='固定价格',
                                        payment_method='微信支付',
                                        transaction_volume='1.8887',
                                        min_volume='100',
                                        max_volume='20,000',
                                        payment_limit='11',
                                        trading_term='这是自动化的出售广告的交易条款')
    ins.browser.close()


# def test_delete_ad():  # 清空账号广告
#     ins = Utomarket('test129', '3201')
#     ins.login().enter_menu('广告管理').remove_ad().delete_ad()
Example #11
0
def test_add_alipay():  # 添加支付方式并删除
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').payment_alipay('支付宝', '谷志军', '13028812388', 'fesdffds.jpg'). \
        payment_alipay('PayTm', '这是paytm', '13027788555812388', 'fesdffds.jpg'). \
        payment_alipay('微信支付', '这是微信支付', '13027788812388', 'fesdffds.jpg'). \
        payment_western_union("西联汇款", "谷志军", "这是西联付款详细信息大理石科技发达"
                                             "时间里凯迪拉克撒娇大厦就说的是肯定撒爱撒"
                                             "娇的萨克拉萨大家快来啊圣诞快乐就打算离开"). \
        payment_bank("银行卡", "谷志军", "兴业银行高新园支行", "55467843454546545")
    # add_btn = ins.browser.find_element_by_xpath("//span[contains(text(),'添加新的支付方式')]/..")
    status = is_exist_element(ins.browser, "xpath",
                              "//span[contains(text(),'添加新的支付方式')]/..")
    assert not status
    for _ in range(1, 6):
        time.sleep(2)
        ins.delete_payment()
    ins.browser.close()
Example #12
0
def test_buy_process():  # 主动购买全流程
    ins_trader = Utomarket('test128', '3201')  # 买家
    massege_content = '你是傻逼斯达克警方扩大解放开绿灯顺丰快递副书记撒大陆军撒'
    ins_trader.login().ad_detail('test129').create_buy(
        type='交易数量').send_massege(massege_content)
    ins_owner = Utomarket('test129', '3201')  # 卖家
    ins_owner.login().progress_order()
    ins_owner.judge_massege_result(massege_content)
    ins_trader.confirm_payment_buyer()
    ins_owner.confirm_payment_seller().send_massege("你好,我已经支付了")
    ins_trader.judge_massege_result("你好,我已经支付了")
    ins_owner.confirm_release_buyer()
    ins_trader.confirm_release_seller()
    ins_owner.order_rating(content='这是卖家的交易评价')
    ins_trader.order_rating(content='这是买家的交易评价')
    ins_trader.browser.close()
    ins_owner.browser.close()
Example #13
0
def test_get_page_title():
    ins = Utomarket('test129', '3201')
    ins.login()
    assert ins.browser.title == '乌托市场(TEST)'
    time.sleep(2)
    ins.browser.close()
Example #14
0
def test_release_buy_ad():  # 发布购买广告,浮动价格
    ins = Utomarket('test129', '3201')
    ins.login().ad_btn('购买').release_ad(transaction_type='浮动价格')
    ins.browser.close()
Example #15
0
def test_band_telephone():  # 绑定手机号
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').band_telephone('13028857899', '3201', '中国')
    ins.browser.close()
Example #16
0
def test_ad_home_btn():  # 导航栏广告管理
    ins = Utomarket('test129', '3201')
    ins.login()
    ins.enter_menu('广告管理')
    time.sleep(2)
    ins.browser.close()
Example #17
0
def test_change_mail():  # 修改邮箱
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').change_mail('*****@*****.**', '3201')
    ins.browser.close()
Example #18
0
def test_band_google():  # 绑定谷歌验证码
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').band_google('3201').stop_google('3201')
    ins.browser.close()
Example #19
0
def test_change_telephone():  # 修改手机号
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').change_telephone('13028718489', '3201', '中国')
    ins.browser.close()
Example #20
0
def test_upload_avatar():  # 上传头像
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').upload_avatar()
    ins.browser.close()
Example #21
0
def test_buy_btn():  # 导航栏购买
    ins = Utomarket('test129', '3201')
    ins.login()
    ins.enter_menu('购买')
    time.sleep(2)
    ins.browser.close()
Example #22
0
def test_ad_screen():  # 首页筛选
    ins = Utomarket('test129', '3201')
    ins.login().ad_screen("全部国家", "全部币种", "全部支付方式")
    ins.browser.close()
Example #23
0
def test_sell_btn():  # 导航栏出售
    ins = Utomarket('test129', '3201')
    ins.login()
    ins.enter_menu('出售')
    time.sleep(2)
    ins.browser.close()
Example #24
0
def test_top_notice():  # 置顶公告
    ins = Utomarket('test129', '3201')
    ins.login().top_notice_internal()
    ins.browser.close()
Example #25
0
def test_switch_language():  # 切换语言
    ins = Utomarket('test129', '3201')
    ins.login().switch_language("English")
    ins.browser.close()
Example #26
0
def test_ad_detail():  # 出售广告详情
    # ins_owner = Utomarket('test129', '3201')  # 广告主
    ins_trader = Utomarket('test128', '3201')  # 交易对象
    ins_trader.login().ad_detail('test129')
    ins_trader.browser.close()
Example #27
0
def test_cut_type():  # 首页切换广告
    ins = Utomarket('test129', '3201')
    ins.login().cut_type("出售")
    ins.browser.close()
Example #28
0
def test_band_google_login():  # 绑定谷歌后登录
    ins = Utomarket('uitest7', '3201')
    ins.login().my_center('个人中心').band_google('3201').logout(
        '退出登录').login_two().my_center('个人中心').stop_google('3201')
    ins.browser.close()