How to use _text_content method in localstack

Best Python code snippet using localstack_python

test_signature.py

Source:test_signature.py Github

copy

Full Screen

...28 page = SignaturePage(top_login)29 page.goto("https://top.tezign.com/#/app/businessDetail")30 selector = SignaturePage.selectors["exception_reminder_assert"]31 page.exception_reminder()32 assert page._text_content(selector) == '共1454个签单业务总额:154,374,115.60签单总额:154,374,115.60'33 # 点击签单展开选项关联项目状态34 def test_associated_item_status(self, top_login):35 page = SignaturePage(top_login)36 page.goto("https://top.tezign.com/#/app/businessDetail")37 selector = SignaturePage.selectors["associated_item_not_associated_assert"]38 page.associated_item_status()39 assert page._text_content(selector) == '共2639个签单业务总额:144,433,226.42签单总额:127,983,435.42'40 # 点击签单展开选项签单凭证审核41 def test_signing_voucher_approval(self, top_login):42 page = SignaturePage(top_login)43 page.goto("https://top.tezign.com/#/app/businessDetail")44 selector = SignaturePage.selectors["signing_voucher_approval_assert"]45 page.signing_voucher_approval()46 assert page._text_content(selector) == '共4278个签单业务总额:336,380,244.38签单总额:319,930,453.38'47 # 点击签单展开选项,交付状态48 def test_delivery_status(self, top_login):49 page = SignaturePage(top_login)50 page.goto("https://top.tezign.com/#/app/businessDetail")51 selector = SignaturePage.selectors["delivery_status_assert"]52 page.delivery_status()53 assert page._text_content(selector) == '共197个签单业务总额:29,668,534.24签单总额:29,608,534.24'54 # 点击签单展开选项,开票状态55 def test_invoicing_status(self, top_login):56 page = SignaturePage(top_login)57 page.goto("https://top.tezign.com/#/app/businessDetail")58 selector = SignaturePage.selectors["invoicing_status_assert"]59 page.invoicing_status()60 assert page._text_content(selector) == '共2944个签单业务总额:195,551,850.30签单总额:179,122,059.30'61 # 点击签单展开选项,创意方结款状态62 def test_payment_status(self, top_login):63 page = SignaturePage(top_login)64 page.goto("https://top.tezign.com/#/app/businessDetail")65 selector = SignaturePage.selectors["payment_status_assert"]66 page.payment_status()67 assert page._text_content(selector) == '共3047个签单业务总额:193,746,530.26签单总额:177,296,739.26'68 # 点击签单展开选项,收款状态69 def test_collection_status(self, top_login):70 page = SignaturePage(top_login)71 page.goto("https://top.tezign.com/#/app/businessDetail")72 selector = SignaturePage.selectors["collection_status_assert"]73 page.collection_status()74 assert page._text_content(selector) == '共2998个签单业务总额:193,183,291.66签单总额:176,733,500.66'75 # 点击签单展开选项,关联案例76 def test_related_cases(self, top_login):77 page = SignaturePage(top_login)78 page.goto("https://top.tezign.com/#/app/businessDetail")79 selector = SignaturePage.selectors["related_cases_assert"]80 page.related_cases()81 assert page._text_content(selector) == '共425个签单业务总额:73,812,172.95签单总额:73,803,932.95'82 # 点击签单展开选项,校准状态83 def test_calibration_status(self, top_login):84 page = SignaturePage(top_login)85 page.goto("https://top.tezign.com/#/app/businessDetail")86 selector = SignaturePage.selectors["calibration_status_assert"]87 page.calibration_status()88 assert page._text_content(selector) == '共4277个签单业务总额:336,367,524.38签单总额:319,917,733.38'89 # 点击签单展开选项,收入金额变更时间90 def test_change_time_of_revenue_amount(self, top_login):91 page = SignaturePage(top_login)92 page.goto("https://top.tezign.com/#/app/businessDetail")93 selector = SignaturePage.selectors["change_time_of_revenue_amount_assert"]94 page.change_time_of_revenue_amount()95 # assert page._text_content(selector) == '共1个签单业务总额:12,000.00签单总额:12,000.00'96 # 点击来源搜索97 def test_source(self, top_login):98 page = SignaturePage(top_login)99 page.goto("https://top.tezign.com/#/app/businessDetail")100 selector = SignaturePage.selectors["source_assert"]101 page.source()102 assert page._text_content(selector) == '共113个签单业务总额:14,204,025.39签单总额:14,204,025.39'103 # 点击客户、部门搜索104 def test_customer_department(self, top_login):105 page = SignaturePage(top_login)106 page.goto("https://top.tezign.com/#/app/businessDetail")107 selector = SignaturePage.selectors["customer_department_assert"]108 page.customer_department()109 assert page._text_content(selector) == '共1个签单业务总额:151,000.00签单总额:151,000.00'110 # 选择开票时间111 def test_invoicing_time(self, top_login):112 page = SignaturePage(top_login)113 page.goto("https://top.tezign.com/#/app/businessDetail")114 selector = SignaturePage.selectors["invoicing_time_assert"]115 page.invoicing_time()116 assert page._text_content(selector) == '共0个签单业务总额:0.00签单总额:0.00'117 # 签单时间118 def test_signature_time(self, top_login):119 page = SignaturePage(top_login)120 page.goto("https://top.tezign.com/#/app/businessDetail")121 selector = SignaturePage.selectors["change_time_of_revenue_amount_assert"]122 page.change_time_of_revenue_amount()123 # assert page._text_content(selector) == '共0个签单业务总额:0.00签单总额:0.00'124 # 签单上级客户125 def test_parent_customer(self, top_login):126 page = SignaturePage(top_login)127 page.goto("https://top.tezign.com/#/app/businessDetail")128 selector = SignaturePage.selectors["parent_customer_assert"]129 page.parent_customer()130 assert page._text_content(selector) == '共3个签单业务总额:1,013,721.00签单总额:1,013,721.00'131 # 搜索交付时间132 def test_delivery_time(self, top_login):133 page = SignaturePage(top_login)134 page.goto("https://top.tezign.com/#/app/businessDetail")135 selector = SignaturePage.selectors["change_time_of_revenue_amount_assert"]136 page.delivery_time()137 assert page._text_content(selector) == '共1个签单业务总额:12,000.00签单总额:12,000.00'138 # 搜索业务类型139 def test_business_type(self, top_login):140 page = SignaturePage(top_login)141 page.goto("https://top.tezign.com/#/app/businessDetail")142 selector = SignaturePage.selectors["business_type_assert"]143 page.business_type()144 assert page._text_content(selector) == '共1个签单业务总额:100.00签单总额:100.00'145 # 搜索销售人员146 def test_salesman(self, top_login):147 page = SignaturePage(top_login)148 page.goto("https://top.tezign.com/#/app/businessDetail")149 page._wait(1)150 selector = SignaturePage.selectors["business_type_assert"]151 page.salesman()152 assert page._text_content(selector) == '共6个签单业务总额:1,038,541.00签单总额:1,038,541.00'153 # 签单列表,操作154 def test_operation(self, top_login):155 page = SignaturePage(top_login)156 page.goto("https://top.tezign.com/#/app/businessDetail")157 page.operation()158 # 点击签单进入详情页面159 def test_signature_detail(self, top_login):160 page = SignaturePage(top_login)161 page.goto("https://top.tezign.com/#/app/businessDetail")...

Full Screen

Full Screen

edin-food-health-training-hub.py

Source:edin-food-health-training-hub.py Github

copy

Full Screen

...4starting_url = 'http://www.foodandhealthtraining.org.uk/directory/?apage=%s'5def _text(node, class_name):6 result = node.find(attrs={'class': class_name})7 return result.text if result else ''8def _text_content(node, class_name):9 """Example:10 [u'The Voice of Carers Across Lothian provides is an organisation ... ',11 <br />,12 u'\r\nVOCAL supports carers in all family or relationship settings, ...']13 """14 return ''.join([tag for tag in node.find(attrs={'class': class_name}).contents if type(tag) is NavigableString])15def _address(node):16 pc = _text_content(vcard, 'street-address').strip().split('\n')[-1]17 return _text_content(vcard, 'street-address'), pc18def _url(node):19 a = node.a20 if a:21 return a.text, a['href']22 else:23 return node.text, ''24for i in range(1, 5):25 print 'page', i26 html = scraperwiki.scrape(starting_url % i)27 soup = BeautifulSoup(html)28 for vcard in soup.findAll('div', attrs={'class': 'vcard'}):29 name = _text(vcard, 'fn org')30 _, url = _url(vcard.find(attrs={'class': 'url'}))31 note = _text_content(vcard, 'note')32 # names not used currently33 # given_name = _text(vcard, 'given-name')34 # family_name = _text(vcard, 'family-name')35 street_address, postcode = _address(vcard)36 tel = _text(vcard, 'tel')37 description = '%s%s%s' % (38 note, 39 ('\n%s' % street_address) if street_address else '',40 ('\n%s' % tel) if tel else ''41 )42 record = { 43 'name': name, 44 'url': url, 45 'description': description, 46 'locations': postcode, 47 'tags': '#efht, food, nutrition',48 'address': street_address,49 'tel': tel 50 }51 scraperwiki.sqlite.save(["name"], record) 52import re53import scraperwiki54from BeautifulSoup import BeautifulSoup, NavigableString55starting_url = 'http://www.foodandhealthtraining.org.uk/directory/?apage=%s'56def _text(node, class_name):57 result = node.find(attrs={'class': class_name})58 return result.text if result else ''59def _text_content(node, class_name):60 """Example:61 [u'The Voice of Carers Across Lothian provides is an organisation ... ',62 <br />,63 u'\r\nVOCAL supports carers in all family or relationship settings, ...']64 """65 return ''.join([tag for tag in node.find(attrs={'class': class_name}).contents if type(tag) is NavigableString])66def _address(node):67 pc = _text_content(vcard, 'street-address').strip().split('\n')[-1]68 return _text_content(vcard, 'street-address'), pc69def _url(node):70 a = node.a71 if a:72 return a.text, a['href']73 else:74 return node.text, ''75for i in range(1, 5):76 print 'page', i77 html = scraperwiki.scrape(starting_url % i)78 soup = BeautifulSoup(html)79 for vcard in soup.findAll('div', attrs={'class': 'vcard'}):80 name = _text(vcard, 'fn org')81 _, url = _url(vcard.find(attrs={'class': 'url'}))82 note = _text_content(vcard, 'note')83 # names not used currently84 # given_name = _text(vcard, 'given-name')85 # family_name = _text(vcard, 'family-name')86 street_address, postcode = _address(vcard)87 tel = _text(vcard, 'tel')88 description = '%s%s%s' % (89 note, 90 ('\n%s' % street_address) if street_address else '',91 ('\n%s' % tel) if tel else ''92 )93 record = { 94 'name': name, 95 'url': url, 96 'description': description, ...

Full Screen

Full Screen

content.py

Source:content.py Github

copy

Full Screen

1import logging2logger = logging.getLogger('jsuite')3def _text_content(node):4 return " ".join([x.strip() for x in node.itertext() if x.strip() is not ""])5def body_text(etree):6 """ Extracts text content from the body element of a JATS XML ElementTree 7 instance"""8 BODY_XPATH = '/article/body'9 query_set = etree.xpath(BODY_XPATH)10 if len(query_set) is 0:11 logger.warn('No body element found in article.')12 return None13 if len(query_set) is 1:...

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 localstack 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