def get_hidden_coin():
        # get config TRY coins
        hidden_coin = GetConf().get_coins('theCoins', 'hidden_coin')

        driver = Browser().open_browser()
        bs=BasePage(driver)
        driver.get('https://wallet.trias.one/api/getCoinbase/')
        # Gets the file name under the downloadfile folder
        mydir = os.path.abspath('..')
        url = mydir + "\\downloadfile\\"
        files = GetFileName().getfilename(url)
        # Calculate folder length
        len1 = len(os.listdir(url))
        w = files[len1-2]
        w1 = w.split('--')[2]
        # Check the private address
        time.sleep(10)
        driver.find_element_by_name('user').send_keys(w1)

        element0 = driver.find_elements_by_xpath("//*[@id='send_type_select']/label")
        for ele0 in element0:
            if ele0.is_displayed():
                ele0.click()
        time.sleep(3)
        '''
        creat  hidden TRY coin
        '''
        for i in range(int(hidden_coin)//100):
            bs.find_element('classname<=>content-form-signup').click()
            time.sleep(1)
        driver.quit()
Beispiel #2
0
    def getcoin():
        # get config TRY coins
        coin = GetConf().get_coins('theCoins','coin')

        driver = Browser().open_browser()
        bs = BasePage(driver)
        driver.get('https://wallet.trias.one/api/getCoinbase/')
        # Gets the file name under the downloadfile folder
        mydir = os.path.abspath('..')
        url = mydir + "\\downloadfile\\"
        files=GetFileName().getfilename(url)
        # Calculate folder length
        len1 = len(os.listdir(url))
        w = files[len1-2]
        w1 = w.split('--')[2]
        time.sleep(10)
        driver.find_element_by_xpath('//*[@id="change_margin_1"]/input').send_keys(w1)
        time.sleep(3)
        '''
        creat  TRY coin
        '''
        for i in range(int(coin)//100):
            bs.find_element('classname<=>content-form-signup').click()
            time.sleep(1)
        driver.quit()
Beispiel #3
0
 def register_check(self):
     try:
         WebDriverWait(self.driver, 20).until(
             EC.visibility_of_element_located((By.XPATH,'//p[text() = "以下信息需要审核填写真实信息"]')))
         return  True
     except:
         BasePage(self.driver).save_web_screenshot('信息填写页面校验失败')
         return False
Beispiel #4
0
 def success_register(self):
     try:
         WebDriverWait(self.driver, 20).until(
             EC.visibility_of_element_located((By.XPATH,'// p[text() = "提交成功"]')))
         return  True
     except:
         BasePage(self.driver).save_web_screenshot('注册校验失败')
         return False
Beispiel #5
0
 def jiaru_success(self):
     try:
         WebDriverWait(self.driver,20).until(
             EC.visibility_of_element_located((By.XPATH,'//div[text()="已成功加入购物车"]')))
         return  True
     except:
         BasePage(self.driver).save_web_screenshot('加入购物车校验失败')
         return False
Beispiel #6
0
def access_web():
    global driver
    # 前置操作
    driver = BasePage.open_browser()
    lg = LoginPage(driver)
    yield driver, lg  # 分割线;返回值
    # 后置操作
    driver.quit()
Beispiel #7
0
 def login_check(self):
     WebDriverWait(self.driver, 30).until(
         EC.visibility_of_element_located((By.ID,'gosupplier')))
     time.sleep(2)
     #判断结果获取失败截图
     try:
         self.driver.find_element_by_xpath('//a[contains(text(),"您好")]')
         return True
     except:
         BasePage(self.driver).save_web_screenshot('登陆校验失败')
         return False
Beispiel #8
0
def login_success():
    global driver
    # 前置操作
    driver = BasePage.open_browser()
    LoginPage(driver).login(LD.success_data["用户名"], LD.success_data["密码"])
    yield driver
Beispiel #9
0
def test1():
    page = BasePage()
    #page.get_url('http://192.168.191.80')
    page.get_url('http://www.baidu.com')