本文整理汇总了Python中util.iterate.getTextAsList函数的典型用法代码示例。如果您正苦于以下问题:Python getTextAsList函数的具体用法?Python getTextAsList怎么用?Python getTextAsList使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTextAsList函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hmdc_build
def test_hmdc_build(self):
"""
@Status this test has been updated for the new hmdc pages
checks the human and mouse build numbers on the HMDC query page
"""
#displays the HMDC qf
self.driver.get(PUBLIC_URL + "/diseasePortal")
#find the pulldown and select Genome Location
selectorbox = self.driver.find_element_by_class_name("queryBuilder")
pulldown = selectorbox.find_element_by_tag_name("select").find_elements_by_tag_name("option")
#print [x.text for x in pulldown]
searchTextItems = iterate.getTextAsList(pulldown)
#verifies all the items listed in the pulldown are correct and in order
self.assertEqual(searchTextItems, ['Please select a field', 'Gene Symbol(s) or ID(s)','Gene Name','Phenotype or Disease Name', 'Phenotype or Disease ID(s)', 'Genome Location', 'Gene File Upload'])
#click the Genome Location option
pulldown[5].click()
#self.assertIn("Genome Location", pulldown[3].Text)
#finds the human and mouse genome build numbers
buildnumber = self.driver.find_element_by_class_name('radio-group')
# get the parent element
mainbuild = buildnumber.find_elements_by_tag_name('label')
wait.forAjax(self.driver)
#confirms that GRCh38 is displayed
#print [x.text for x in mainbuild]
searchTextItems = iterate.getTextAsList(mainbuild)
self.assertEqual(searchTextItems, ['Human (GRCh38)', 'Mouse (GRCm38)'])
"""
示例2: test_pheno_show_hide
def test_pheno_show_hide(self):
"""
@status this test verifies these Alleles with phenotypes ribbon show/hide affected systems properly.
@bug under construction
"""
self.driver.find_element_by_name("nomen").clear()
self.driver.find_element_by_name("nomen").send_keys("Tg(ACTFLPe)9205Dym")
self.driver.find_element_by_class_name("buttonLabel").click()
self.driver.find_element_by_partial_link_text("Tg(ACTFLPe)9205Dym").click()
self.driver.find_element_by_link_text("show").click()
phenotypesort = self.driver.find_element_by_id("phenotable_id")
items = phenotypesort.find_elements_by_css_selector(
".phenoSummarySystemRow td:first-child, .phenoSummaryTermRow td:first-child"
)
# add all li text to a list for "assertIn" test
searchTreeItems = iterate.getTextAsList(items)
self.assertEqual(
[
"behavior/neurological",
"tremors",
"impaired balance",
"impaired coordination",
"abnormal gait",
"short stride length",
"cardiovascular system",
"cardiovascular system phenotype",
"hearing/vestibular/ear",
"abnormal ear physiology",
"mortality/aging",
"perinatal lethality",
"nervous system",
"abnormal synaptic vesicle recycling",
"abnormal excitatory postsynaptic currents",
],
searchTreeItems,
)
self.driver.get(config.FEWI_URL + "/allele/")
self.driver.find_element_by_name("nomen").clear()
self.driver.find_element_by_name("nomen").send_keys("Tg(ACTFLPe)9205Dym")
self.driver.find_element_by_class_name("buttonLabel").click()
self.driver.find_element_by_partial_link_text("Tg(ACTFLPe)9205Dym").click()
# self.driver.find_element_by_link_text('show').click()
phenotypesort = self.driver.find_element_by_id("phenotable_id")
items = phenotypesort.find_elements_by_css_selector(".phenoSummarySystemRow div:first-child")
# add all li text to a list for "assertIn" test
searchTreeItems = iterate.getTextAsList(items)
self.assertEqual(
[
"behavior/neurological",
"cardiovascular system",
"hearing/vestibular/ear",
"mortality/aging",
"nervous system",
],
searchTreeItems,
)
示例3: test_assaytype_column_sort
def test_assaytype_column_sort(self):
"""
@status: Tests that the assay type column sort works correctly
Assay Type column:
* Not applicable is not shown
* sort order should be type (with not specified last), followed by assay type and gene
* reverse order should still leave not specified last
* blot assays are last by default
"""
driver = self.driver
driver.get(config.PUBLIC_URL + "/gxd")
genebox = driver.find_element_by_name('nomenclature')
# put your marker symbol
genebox.send_keys("pax6")
genebox.send_keys(Keys.RETURN)
#find the Image tab
imagetab = driver.find_element_by_id("imagestab")
#click the image tab
imagetab.click()
wait.forAjax(driver)
time.sleep(.5)
assaylist = driver.find_element_by_id("imagesdata").find_elements_by_css_selector('td.yui-dt-col-assayType')
items = assaylist[0].find_elements_by_tag_name("li")
searchTextItems = iterate.getTextAsList(items)
self.assertEqual(searchTextItems, ["Immunohistochemistry", "Immunohistochemistry"])
assayheader = driver.find_element_by_id("imagesdata").find_element_by_css_selector('th.yui-dt-col-assayType')
#click the gene header column to sort
assayheader.click()
wait.forAjax(driver)
time.sleep(.5)
assaylist = driver.find_element_by_id("imagesdata").find_elements_by_css_selector('td.yui-dt-col-assayType')
items = assaylist[2].find_elements_by_tag_name("li")
searchTextItems = iterate.getTextAsList(items)
self.assertEqual(searchTextItems, ["RT-PCR"])
示例4: test_gene_column_sort
def test_gene_column_sort(self):
"""
@status: Tests that the Gene column sort works correctly
Gene column:
* sort order is gene, then assay type
"""
driver = self.driver
driver.get(config.PUBLIC_URL + "/gxd")
genebox = driver.find_element_by_name('nomenclature')
# put your marker symbol
genebox.send_keys("shh")
genebox.send_keys(Keys.RETURN)
#find the Image tab
imagetab = driver.find_element_by_id("imagestab")
#click the image tab
imagetab.click()
wait.forAjax(driver)
time.sleep(.5)
imagesdata = driver.find_element_by_id("imagesdata")
genelist = imagesdata.find_elements_by_css_selector('td.yui-dt-col-gene')
items = genelist[0].find_elements_by_tag_name("li")
searchTextItems = iterate.getTextAsList(items)
self.assertEqual(searchTextItems, ["Arx", "Olig2", "Shh"])
geneheader = imagesdata.find_element_by_css_selector('th.yui-dt-col-gene')
#click the gene header column to sort
geneheader.click()
wait.forAjax(driver)
time.sleep(.5)
genelist = driver.find_element_by_id("imagesdata").find_elements_by_css_selector('td.yui-dt-col-gene')
items = genelist[0].find_elements_by_tag_name("li")
searchTextItems = iterate.getTextAsList(items)
self.assertEqual(searchTextItems, ["Arx", "Olig2", "Shh"])
示例5: test_genes_tab_doids
def test_genes_tab_doids(self):
'''
@status this test verifies the correct DO IDs are returned for this query.
@bug: under construction
'''
my_select = self.driver.find_element_by_xpath("//select[starts-with(@id, 'field_0_')]")#identifies the select field and picks the gene symbols option
for option in my_select.find_elements_by_tag_name("option"):
if option.text == 'Gene Symbol(s) or ID(s)':
option.click()
break
self.driver.find_element_by_name("formly_3_input_input_0").send_keys("Gata1")#identifies the input field and enters gata1
wait.forAngular(self.driver)
self.driver.find_element_by_id("searchButton").click()
wait.forAngular(self.driver)
#identify the Genes tab and verify the tab's text
gene_tab = self.driver.find_element_by_css_selector("ul.nav.nav-tabs > li.uib-tab.nav-item.ng-scope.ng-isolate-scope:nth-child(3) > a.nav-link.ng-binding")
self.assertEqual(gene_tab.text, "Diseases (3)", "Diseases tab is not visible!")
gene_tab.click()
gene_table = Table(self.driver.find_element_by_id("diseaseTable"))
cells = gene_table.get_column_cells("DO ID")
print iterate.getTextAsList(cells)
#displays each row of gene data
doid1 = cells[1]
doid2 = cells[2]
doid3 = cells[3]
#asserts that the correct genes in the correct order are returned
self.assertEqual(doid1.text, 'DOID:14250')
self.assertEqual(doid2.text, 'DOID:4971')
self.assertEqual(doid3.text, 'DOID:1588')
示例6: testResultsTable
def testResultsTable(self):
"""
An example of getting data from the results table using
Table class
NOTE: this is only for example purposes. Not a real test
"""
driver = self.driver
form = self.form
form.enter_value('jnumid', '121946')
form.press_tab()
form.click_search()
results_table = driver.find_element_by_id("indexGrid")
table = Table(results_table)
header_cells = table.get_header_cells()
print iterate.getTextAsList(header_cells)
# print row 1
cells = table.get_row_cells(1)
print iterate.getTextAsList(cells)
# single cell
cell = table.get_cell("RNA-WM", "10.5")
print cell.text
# empty cell
cell = table.get_cell("prot-sxn", "A")
示例7: testMrkWildcardSearch
def testMrkWildcardSearch(self):
"""
@Status tests that a wildcard search for a marker works
"""
form = self.form
form.enter_value('marker_symbol', 'unc5%')
form.enter_value('_priority_key', 'low')
form.click_search()
marker_symbol = form.get_value('marker_symbol')
self.assertEqual(marker_symbol, 'Unc5a')
#find the search results table
results_table = self.driver.find_element_by_id("resultsTable")
table = Table(results_table)
#Iterate and print the search results headers
header_cells = table.get_header_cells()
print iterate.getTextAsList(header_cells)
# print row 1
cells = table.get_row_cells(1)
print iterate.getTextAsList(cells)
#print column 1
symbols_cells = table.get_column_cells('Marker')
symbols = iterate.getTextAsList(symbols_cells)
self.assertEqual(symbols, ['Marker','Unc5a', 'Unc5a', 'Unc5b', 'Unc5b', 'Unc5b', 'Unc5c', 'Unc5c', 'Unc5c', 'Unc5d', 'Unc5d', 'Unc5d'])
示例8: testModifiedBySearch
def testModifiedBySearch(self):
"""
@Status tests that searching the Modified by user field gives the correct results
"""
form = self.form
form.enter_value('_priority_key', 'Medium')
form.enter_value('_conditionalmutants_key', 'Conditional')
form.enter_value('is_coded', 'Yes')
form.enter_value('modifiedby_login', 'ijm')
form.press_tab()
form.click_search()#click the search button
#find the search results table
results_table = self.driver.find_element_by_id("resultsTable")
table = Table(results_table)
#Iterate and print the search results headers
header_cells = table.get_header_cells()
print iterate.getTextAsList(header_cells)
# print row 1
cells = table.get_row_cells(1)
print iterate.getTextAsList(cells)
#print column 1
symbols_cells = table.get_column_cells('Marker')
symbols = iterate.getTextAsList(symbols_cells)
self.assertEqual(symbols, ['Marker', 'Acta2', 'Fabp7', 'Hand1', 'Mbp'])
示例9: testLessThanEqualDateSearch
def testLessThanEqualDateSearch(self):
"""
@Status tests that searching by less than created by date gives the correct results
"""
form = self.form
form.enter_value('_priority_key', 'Medium')
form.press_tab()
form.enter_value('_conditionalmutants_key', 'Conditional (minor)')
form.press_tab()
form.enter_value('is_coded', 'Yes')
form.press_tab()
form.enter_value('creation_date', "<=09/28/2010")
form.press_tab()
form.click_search()#click the search button
#find the search results table
results_table = self.driver.find_element_by_id("resultsTable")
table = Table(results_table)
#Iterate and print the search results headers
header_cells = table.get_header_cells()
print iterate.getTextAsList(header_cells)
# print row 1
cells = table.get_row_cells(1)
print iterate.getTextAsList(cells)
#print column 1
symbols_cells = table.get_column_cells('Marker')
symbols = iterate.getTextAsList(symbols_cells)
self.assertEqual(symbols, ['Marker', 'Clec1b', 'Fgf8', 'Lmx1b', 'Lyve1', 'Pdpn', 'Wnt7a'])
示例10: testNotesWildcardSearch
def testNotesWildcardSearch(self):
"""
@Status tests that a wildcard search for a noteworks
"""
form = self.form
form.enter_value('comments', '%slot%')
form.press_tab()
form.enter_value('_priority_key', 'High')
form.press_tab()
form.enter_value('_conditionalmutants_key', '4834242')
form.press_tab()
form.enter_value('is_coded', 'true')
form.press_tab()
form.click_search()
note = form.get_value('comments')
self.assertEqual(note, 'Some of the northern data was obtained using slot blots. Age of embryo at noon of plug day not specified in reference.')
#finds the citation field
citation = form.get_value('citation')
self.assertEqual(citation, 'Chianale J, Biochim Biophys Acta 1995 Dec 27;1264(3):369-76')
#find the search results table
results_table = self.driver.find_element_by_id("resultsTable")
table = Table(results_table)
#Iterate and print the search results headers
header_cells = table.get_header_cells()
print iterate.getTextAsList(header_cells)
# print row 1, the table headers
cells = table.get_row_cells(1)
print iterate.getTextAsList(cells)
#print column 1, the marker symbols
symbols_cells = table.get_column_cells('Marker')
symbols = iterate.getTextAsList(symbols_cells)
print symbols
self.assertEqual(symbols, ['Marker','Abcb1a', 'Sdc1', 'Sptb', 'Sptbn1'])
示例11: testMultiFieldSearch
def testMultiFieldSearch(self):
"""
@Status tests that searching by priority, conditional, and coded fields gives the correct results
"""
form = self.form
form.enter_value('_priority_key', 'Medium')
form.press_tab()
form.enter_value('_conditionalmutants_key', 'Conditional (minor)')
form.press_tab()
form.enter_value('is_coded', 'Yes')
form.press_tab()
form.click_search()#click the search button
#find the search results table
results_table = self.driver.find_element_by_id("resultsTable")
table = Table(results_table)
#Iterate and print the search results headers
header_cells = table.get_header_cells()
print iterate.getTextAsList(header_cells)
# print row 1
cells = table.get_row_cells(1)
print iterate.getTextAsList(cells)
#print column 1
symbols_cells = table.get_column_cells('Marker')
symbols = iterate.getTextAsList(symbols_cells)
self.assertEqual(symbols, ['Marker', 'Acta2', 'Aqp2', 'Clec1b', 'Emcn', 'Fgf8', 'Lmx1b', 'Lyve1', 'Pdpn', 'Postn', 'Tagln', 'Upk1b', 'Upk3a', 'Upk3b', 'Wnt7a'])
示例12: testdeleteoneclipboard
def testdeleteoneclipboard(self):
"""
@status tests you can delete one item from the clipboard.
"""
self.performSearch(term="emb%")
result = self.driver.find_element_by_id("termResultList").find_elements_by_link_text("embryo")
clear = self.driver.find_element_by_id("clipboardFunctions").find_element_by_id("clipboardClear")
clear.click()
wait.forAngular(self.driver)
clipbox = self.driver.find_element_by_id("clipboardInput")
clipbox.send_keys("4-5")
clipbox.send_keys(Keys.RETURN)
wait.forAngular(self.driver)
clipsort = self.driver.find_element_by_id("emapClipBoardContent").find_element_by_id("clipboard")
items = clipsort.find_elements_by_css_selector("li")
# add all li text to a list for "assertIn" test
searchTreeItems = iterate.getTextAsList(items)
self.assertEqual(["TS4; embryo", "TS5; embryo"], searchTreeItems)
items[1].click()
wait.forAngular(self.driver)
self.driver.find_element_by_xpath("//*[@id='clipboard']/li[2]/img").click()
wait.forAngular(self.driver)
clipsort = self.driver.find_element_by_id("emapClipBoardContent").find_element_by_id("clipboard")
items = clipsort.find_elements_by_css_selector("li")
searchTreeItems = iterate.getTextAsList(items)
self.assertEqual(["TS4; embryo"], searchTreeItems)
示例13: testCitationWildcardSearch
def testCitationWildcardSearch(self):
"""
@Status tests that a wildcard search for a citation works
"""
form = self.form
form.enter_value('citation', '%Blood 1991% ')
form.click_search()
marker_symbol = form.get_value('marker_symbol')
self.assertEqual(marker_symbol, 'Ptpn1')
#finds the citation field
citation = form.get_value('citation')
self.assertEqual(citation, 'Yi T, Blood 1991 Nov 1;78(9):2222-8')
#find the search results table
results_table = self.driver.find_element_by_id("resultsTable")
table = Table(results_table)
#Iterate and print the search results headers
header_cells = table.get_header_cells()
print iterate.getTextAsList(header_cells)
# print row 1, the table headers
cells = table.get_row_cells(1)
print iterate.getTextAsList(cells)
#print column 1, the marker symbols
symbols_cells = table.get_column_cells('Marker')
symbols = iterate.getTextAsList(symbols_cells)
self.assertEqual(symbols, ['Marker','Ptpn1', 'Ptpn12', 'Ptpn6', 'Ptpra', 'Ptprc', 'Ptpre', 'Ptprj'])
示例14: testSearchIndex
def testSearchIndex(self):
"""
@Status tests that an index record(s) can be searched
"""
driver = self.driver
form = self.form
#find the Index grid
table_element = driver.find_element_by_id("indexGrid")
table = Table(table_element)
#puts an X in the Prot-wm by age 7 box
cell = table.get_cell("prot-wm", "7")
cell.click()
#puts an X in the Prot-wm by age 8 box
cell = table.get_cell("prot-wm", "8")
cell.click()
wait.forAngular(driver)
form.click_search()#click the search button
#find the search results table
results_table = driver.find_element_by_id("resultsTable")
table = Table(results_table)
#Iterate and print the search results headers
header_cells = table.get_header_cells()
print iterate.getTextAsList(header_cells)
# print row 1
cells = table.get_row_cells(1)
print iterate.getTextAsList(cells)
#print column 1
symbols_cells = table.get_column_cells('Marker')
symbols = iterate.getTextAsList(symbols_cells)
self.assertEqual(symbols, ['Marker','Adgre1', 'Cdh5', 'Cdx4', 'Eng', 'Fgf8', 'Foxa2', 'Gata6', 'Itga2b', 'Kdr', 'Kdr', 'Kdr', 'Kdr', 'Lrp2', 'Nanog', 'Pdgfra', 'Pecam1', 'Pou3f1', 'Ptprc', 'T', 'T', 'Tal1', 'Tek'])
示例15: testClipboardShortcut
def testClipboardShortcut(self):
"""
@status confirm the shortcut keys(CTRL + ALT + k) resets the clipboard input box
"""
actions = ActionChains(self.driver)
#search for the term tail
self.performSearch(term="tail")
result = self.driver.find_element_by_id("termResultList").find_element_by_css_selector("mark")
result.click()
wait.forAngular(self.driver)
#clear all items in the clipboard
clear = self.driver.find_element_by_id("clipboardFunctions").find_element_by_id("clipboardClear")
clear.click()
#Add 18 into the add to clipboard field
clipbox = self.driver.find_element_by_id("clipboardInput")
clipbox.send_keys("18")
clipbox.send_keys(Keys.RETURN)
clipdata = self.driver.find_element_by_id("emapClipBoardContent").find_element_by_id("clipboard")
items = clipdata.find_elements_by_css_selector("li")
searchTreeItems = iterate.getTextAsList(items)
#assert that TS18 tail is displayed in the clipboard
self.assertEqual(["TS18; tail"], searchTreeItems)
#clear the clipboard using the shortcut keys
actions.key_down(Keys.CONTROL).key_down(Keys.ALT).send_keys('k').key_up(Keys.CONTROL).key_up(Keys.ALT).perform()
time.sleep(5)
clipdata = self.driver.find_element_by_id("emapClipBoardContent")
items = clipdata.find_elements_by_css_selector("li")
searchTreeItems = iterate.getTextAsList(items)
#Assert that the clipboard is empty
self.assertEqual([], searchTreeItems)