Exemplo n.º 1
0
def step_find_innerdesigner(content):
    if '分享列表' in SeleniumApi.step_text_xpath(
            content, '//*[@id="subMenu-3$Menu"]/li[5]'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 2
0
def step_new_sharinglink(content):
    if '分享链接已生成' in SeleniumApi.step_text_cssselector(content,
                                                      '.modal-header'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 3
0
def step_back_to_sharing(content):
    if '分享链接已生成' in SeleniumApi.step_text_xpath(
            content, '/html/body/div[2]/div/div[2]/div/div[2]/div/div/div[1]'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 4
0
def step_back_to_loginpage(content):
    if 'We are the new sexy' in SeleniumApi.step_text_xpath(
            content, '//*[@id="rc-root"]/div/div/div[1]'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 5
0
def step_click_portfolio(content):
    SeleniumApi.step_click(
        content,
        '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]/div[2]/div[3]/div[1]/'
        'div[2]/div[3]/div[1]/div[1]/div/div[2]/div[2]/div[1]')
    time.sleep(3)
    ExceptionCatch.catch_exception(content)
Exemplo n.º 6
0
def step_check_innderdesigner(content):
    if '个案例符合条件' in SeleniumApi.step_text_xpath(
            content, '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]/'
            'div[2]/div[3]/div[1]/div[2]/div[2]/div[2]/span'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 7
0
def step_verify_search_result(content):
    if '1' == SeleniumApi.step_text_xpath(
            content,
            '//*[@id="rc-root"]/div/div[3]/div/div/div[3]/div[1]/div[2]/div[2]/'
            'div[1]/p/span'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 8
0
def step_portfolio_ok(content):
    SeleniumApi.step_switch_to_a_tab(content)
    time.sleep(1)
    if '案例详情' in SeleniumApi.step_text_xpath(
            content, '//*[@id="rc-root"]/div/div[3]/div/div/div[1]/span[1]'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 9
0
def step_verify_search_result(content):
    if '特赞插画作品' in SeleniumApi.step_text_xpath(
            content, '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]'
            '/div[2]/div[3]/div[1]/div[2]/div[3]/div[1]/div[1]/div/div[1]/div/div[2]'
    ):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
    time.sleep(3)
Exemplo n.º 10
0
def step_check_portfolio(content):
    selected = SeleniumApi.step_text_xpath(
        content,
        '//*[@id="rc-root"]/div/div[3]/div/div/div[1]/div/div/div/div/div[1]/div[1]'
    )
    locator = (
        By.XPATH,
        '//*[@id="rc-root"]/div/div[3]/div/div/div[1]/div/div/div/div/div[1]/div[1]'
    )
    SeleniumApi.step_wait_expected(content, locator)

    if '案例分享列表' in selected:
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 11
0
def before_feature(content, feature):
    content.driver = webdriver.Chrome()
    content.driver.get(
        "https://*****:*****@top.tezign.com")
    content.driver.implicitly_wait(10)
    content.driver.maximize_window()
    time.sleep(1)
    SeleniumApi.step_send_keys(content, "//*[@placeholder='邮箱']",
                               '*****@*****.**')
    time.sleep(1)
    SeleniumApi.step_send_keys(content, "//*[@placeholder='密码']", '111111')
    SeleniumApi.step_click(content, "//*[@type='button']")
    if '特赞基地' == SeleniumApi.step_text_cssselector(content, ".side-header"):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemplo n.º 12
0
def step_check_shareing(content):
    sharing_url = SeleniumApi.step_text_cssselector(content, '.link-detail')
    time.sleep(2)
    SeleniumApi.step_switch_to_new_tab(content, sharing_url)
    time.sleep(5)
    if '免费咨询' in SeleniumApi.step_text_xpath(
            content, '//*[@id="rc-root"]/div/div[2]/div/div[1]/div[3]/button'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
    SeleniumApi.step_click(
        content,
        '//*[@id="rc-root"]/div/div[2]/div/div[3]/div[1]/div/div[1]/div[2]/div[1]'
    )
    time.sleep(3)
    if '平台出品' in SeleniumApi.step_text_xpath(
            content,
            '/html/body/div[4]/div/div[2]/div/div[1]/div/div[1]/div[2]/'
            'div[1]/div/span'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
    ExceptionCatch.catch_exception(content)
    SeleniumApi.step_switch_to_original_tab(content)