Exemple #1
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)
Exemple #2
0
def step_keywords_search(content):
    SeleniumApi.step_send_keys(content, "//*[@placeholder='请输入标题']", 'KV测试组案例')
    SeleniumApi.step_click(
        content,
        '//*[@id="rc-root"]/div/div[3]/div/div/div[3]/div[1]/div[2]/div[1]/div/div/div[4]/'
        'div/button[1]')
    time.sleep(2)
Exemple #3
0
def step_click_share(content):
    SeleniumApi.step_click(
        content,
        '//*[@id="rc-root"]/div/div[3]/div/div/div[3]/div[1]/div[2]/div[2]/div[2]/div/div/'
        'div[1]/div/div/div/div/div[2]/div/div/table/tbody/tr/td/span/button[1]'
    )
    time.sleep(1)
Exemple #4
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
Exemple #5
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
Exemple #6
0
def step_new_sharinglink(content):
    if '分享链接已生成' in SeleniumApi.step_text_cssselector(content,
                                                      '.modal-header'):
        assert True
    else:
        ExceptionCatch.catch_exception(content)
        assert False
Exemple #7
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
Exemple #8
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
Exemple #9
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
Exemple #10
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
Exemple #11
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
Exemple #12
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)
Exemple #13
0
def step_login(self, username, password):
    time.sleep(1)
    SeleniumApi.step_send_keys(self, "//*[@placeholder='邮箱']", username)
    time.sleep(1)
    SeleniumApi.step_send_keys(self, "//*[@placeholder='密码']", password)
    SeleniumApi.step_click(self, "//*[@type='button']")
    time.sleep(3)
Exemple #14
0
def step_back_to_portfolio_group(content):
    SeleniumApi.step_back(content)
    time.sleep(1)
    SeleniumApi.step_click(
        content, '//*[@id="root"]/div/div[2]/div[1]/div/div[1]/span')
    SeleniumApi.step_click(
        content,
        '//*[@id="root"]/div/div[2]/div[1]/div/div[2]/div/div/ul/li[2]/a')
Exemple #15
0
def step_keywords_search(content):
    SeleniumApi.step_send_keys(
        content,
        '//*[@id="rc-root"]/div/div[3]/div/div/div/div[3]/div[1]/div[2]/div[3]/div[1]/'
        'div[2]/div[1]/div[2]/div[1]/div[2]/div/div/div/div/div/ul/li/div/input',
        '插画')
    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[1]/div[2]/div[1]/div[2]/div/div/div/div/div/ul/li/div/input'
    )
    time.sleep(1)
    SeleniumApi.step_click(content,
                           '/html/body/div[2]/div/div/div/ul/li[1]/ul/li[1]')
    time.sleep(1)
    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[1]/div[2]/div[7]/div/button[1]')
Exemple #16
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
Exemple #17
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)
Exemple #18
0
def step_open(self):
    SeleniumApi.step_startup(self)
Exemple #19
0
def step_login(self, username, passward):
    time.sleep(1)
    SeleniumApi.step_send_keys(self, _mobile_field, passward)
    SeleniumApi.step_send_keys(self)
Exemple #20
0
def step_forward_top(self):
    if '用户名' in SeleniumApi.step_text_cssselector(self, "hidden-sm"):
        assert True
    else:
        assert False
    SeleniumApi.step_quit(self)
Exemple #21
0
def step_click_user_management(content):
    SeleniumApi.step_click(
        content,
        '//*[@id="rc-root"]/div/div[1]/div/div/div/ul/li[3]/div/span/span')
    time.sleep(1)
Exemple #22
0
def step_click_innerdesigner(content):
    SeleniumApi.step_click(content, '//*[@id="subMenu-3$Menu"]/li[3]')
    time.sleep(5)
Exemple #23
0
def step_click_sharinglist(content):
    SeleniumApi.step_click(content, '//*[@id="subMenu-3$Menu"]/li[5]')
    time.sleep(5)