How to use asset_name method in avocado

Best Python code snippet using avocado_python

account_balance_page.py

Source:account_balance_page.py Github

copy

Full Screen

1from selenium import webdriver2import time3class AccountBalancePage(object):4 def __init__(self,driver):5 self.driver = webdriver.Chrome()6 # self.driver = driver7 # 获得row_num行次,xpath tr_num 8 def get_row_tr_num(self,asset_name):9 if asset_name == '货币资金':10 return row_num = 1,tr_num = 211 elif asset_name == '短期投资' :12 return row_num = 2,tr_num = 3 13 elif asset_name == '应收票据':14 return row_num = 3,tr_num = 415 elif asset_name == '应收账款':16 return row_num = 4,tr_num = 517 elif asset_name == '预付款项:18 return row_num = 5 ,tr_num = 619 elif asset_name == '应收股利':20 return row_num = 6, tr_num = 721 elif asset_name == '应收利息':22 return row_num = 7, tr_num = 823 elif asset_name == '其他应收款':24 return row_num = 8, tr_num = 925 elif asset_name == '存货':26 return row_num = 9,tr_num = 1027 elif asset_name == '其中:原材料':28 return row_num = 10,tr_num = 1129 elif asset_name == '在产品':30 return row_num = 11, tr_num = 1231 elif asset_name == '库存商品':32 return row_num = 12,tr_num = 1333 elif asset_name == '周转材料':34 return row_num = 13,tr_num = 14 35 elif asset_name == '其他流动资产':36 return row_num = 14,tr_num = 1537 elif asset_name == '流动资产合计':38 return row_num = 15,tr_num = 1639 elif asset_name == '长期债券投资':40 return row_num = 16,tr_num = 1841 elif asset_name == '长期股权投资':42 return row_num = 17,tr_num = 1943 elif asset_name == '固定资产原价':44 return row_num = 18,tr_num = 2045 elif asset_name == '减:累积折旧':46 return row_num = 19,tr_num = 2147 elif asset_name == '固定资产帐面价值':48 return row_num = 20,tr_num = 2249 elif asset_name == '在建工程':50 return row_num = 21,tr_num = 2351 elif asset_name == '工程物资':52 return row_num = 22,tr_num = 2453 elif asset_name == '固定资产清理':54 return row_num = 23,tr_num = 2555 elif asset_name == '生产性生物资产':56 return row_num = 24,tr_num = 2657 elif asset_name == '无形资产':58 return row_num = 25,tr_num = 2759 elif asset_name == '开发支出':60 return row_num = 26,tr_num = 2861 elif asset_name == '长期待摊费用':62 return row_num = 27,tr_num = 2963 elif asset_name == '其他非流动资产':64 return row_num = 28,tr_num = 3065 elif asset_name == '非流动资产合计':66 return row_num = 29,tr_num = 3167 elif asset_name == '资产合计':...

Full Screen

Full Screen

assets.py

Source:assets.py Github

copy

Full Screen

1import os23def _asset(asset_name: str, pardir:str="", relative:bool=False) -> str:4 if pardir:5 asset_name = f"{pardir}/{asset_name}"67 asset_name = f"assets/{asset_name}"89 if relative:10 asset_name = os.path.abspath(asset_name)1112 return asset_name1314def construct_background_filename(colour: str, w: int, h: int, relative:bool=False):15 return _asset("{}x{}-{}-solid-color-background.jpg".format \16 (w, h, "-".join(colour.strip().split())),pardir="backgrounds", relative=relative)1718class Assets:1920 image_icon = _asset("image.png")21 logo = _asset("logo.png") ...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run avocado automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful