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)']) """
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, )
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"])
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"])
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')
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")
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'])
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'])
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'])
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'])
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'])
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)
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'])
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'])
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)
def testGreaterThanEqualDateSearch(self): """ @Status tests that searching by greater than or equal to 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', ">=11/10/2015") form.press_tab() wait.forAngular(self.driver) 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', 'Emcn', 'Postn', 'Tagln', 'Upk1b', 'Upk3a', 'Upk3b'])
def testBetweenDateSearch(self): """ @Status tests that searching by inclusive dates gives the correct results """ form = self.form form.enter_value('_priority_key', 'Medium') form.press_tab() form.enter_value('_conditionalmutants_key', 'Conditional') form.press_tab() form.enter_value('is_coded', 'Yes') form.press_tab() form.enter_value('creation_date', "10/01/2015..12/01/2015") form.press_tab() wait.forAngular(self.driver) 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', 'Flrt3', 'Ntn1', 'Pecam1', 'Slit1', 'Tlx1'])
def testClipboardBasicSort(self): """ @status tests that a basic sort works by displaying the clip board results in smart alpha order. """ 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("5-7") 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(["TS5; embryo","TS6; embryo","TS7; embryo"], searchTreeItems) clipbox.clear() # do a new search for endoderm self.performSearch(term="endoderm") result = self.driver.find_element_by_id("termResultList").find_elements_by_link_text("endoderm") clipbox = self.driver.find_element_by_id("clipboardInput") clipbox.send_keys("6-8") 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(["TS5; embryo","TS6; embryo","TS7; embryo","TS6; endoderm","TS7; endoderm","TS8; endoderm"], searchTreeItems) sort = self.driver.find_element_by_id("clipboardFunctions").find_element_by_id("clipboardSort") sort.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") # add all li text to a list for "assertIn" test searchTreeItems = iterate.getTextAsList(items) self.assertEqual(["TS5; embryo","TS6; embryo","TS6; endoderm","TS7; embryo","TS7; endoderm","TS8; endoderm"], searchTreeItems)
def testCommaStages(self): """ @status adding stages to the clipboard separated by commas. """ self.performSearch(term="epithelium") result = self.driver.find_element_by_id("termResultList").find_element_by_css_selector("mark") result.click() wait.forAngular(self.driver) 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("15,16,17,19") 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(["TS15; epithelium", "TS16; epithelium", "TS17; epithelium", "TS19; epithelium"], searchTreeItems)
def testMinimalStageLinks(self): """ tests that all stage links exist in the term detail section and clicking them function correctly; this is for a case with only a few stages; jlewis """ self.performSearch(term="second polar body") detailArea = self.driver.find_element_by_id("termDetailContent") stageItems = detailArea.find_elements_by_class_name("stageSelector") # add all link text to a list for "assertIn" test stages = iterate.getTextAsList(stageItems) self.assertEqual(stages, ["All", "1", "2", "3", "4"]) # click stage 1 stage1 = detailArea.find_element_by_link_text("1").click() wait.forAjax(self.driver) #verify EMAPS term is loaded for second polar body detailItems = self.driver.find_elements_by_css_selector("#termDetailContent dd") self.assertEqual(detailItems[2].text,"EMAPA:16034") # verify stage is active activeStage = self.driver.find_element_by_css_selector(".stageSelector.active") self.assertEqual(activeStage.text,"1")
def testWildcardStage(self): """ @status adding all stages to clip board using a *. """ self.performSearch(term="epiblast") result = self.driver.find_element_by_id("termResultList").find_element_by_css_selector("mark") result.click() wait.forAngular(self.driver) 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("*") 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(["TS6; epiblast", "TS7; epiblast", "TS8; epiblast"], searchTreeItems)
def testDashStages(self): """ @status adding stages to the clip board separated by a dash. """ self.performSearch(term="neck") result = self.driver.find_element_by_id("termResultList").find_element_by_css_selector("mark") result.click() wait.forAngular(self.driver) 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("22-25") 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(["TS22; neck", "TS23; neck", "TS24; neck", "TS25; neck"], searchTreeItems)
def test_table_headers(self): """ @status: Tests that the Gene Ontology Classifications page in Tabular view, table headers are correct Headers are: Aspect, Category, Classification Term, Context, Proteoform, Evidence, Inferred From, Reference(s) """ driver = self.driver driver.get(config.FEWI_URL + "/marker") genebox = driver.find_element_by_name('nomen') # put your marker symbol genebox.send_keys("Ccdc40") genebox.send_keys(Keys.RETURN) time.sleep(3) #finds the correct marker link and clicks it driver.find_element_by_link_text("Ccdc40").click() wait.forAjax(driver) #Finds the All sequences link and clicks it driver.find_element_by_class_name("goRibbon").find_element_by_link_text("26").click() wait.forAjax(driver) #Locates the marker header table and finds the table headings tabularheaderlist = driver.find_element_by_id("dynamicdata") items = tabularheaderlist.find_elements_by_tag_name("th") searchTextItems = iterate.getTextAsList(items) wait.forAjax(driver) print searchTextItems #verifies all the table headings are correct and in order self.assertEqual(searchTextItems, ['Aspect','Category','Classification Term', 'Context', 'Proteoform', 'Evidence', 'Inferred From', 'Reference(s)']) wait.forAjax(driver)
def test_diseases_tab_headers(self): ''' @status this test verifies the headings on the disease tab are correct and in the correct order. @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")#indentifies the input field and enters gata1 wait.forAngular(self.driver) self.driver.find_element_by_id("searchButton").click() #identify the Genes tab and verify the tab's text disease_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") print disease_tab.text self.assertEqual(disease_tab.text, "Diseases (3)", "Diseases tab is not visible!") disease_tab.click() gene_table_headers = self.driver.find_element_by_id("diseaseTable").find_element_by_css_selector("tr") items = gene_table_headers.find_elements_by_tag_name("th") searchTermItems = iterate.getTextAsList(items) self.assertEqual(searchTermItems[0], "Disease") self.assertEqual(searchTermItems[1], "DO ID") self.assertEqual(searchTermItems[2], "OMIM ID(s)") self.assertEqual(searchTermItems[3], "Mouse Models") self.assertEqual(searchTermItems[4], "Associated Genes from Mouse Models") self.assertEqual(searchTermItems[5], "Associated Human Genes (Source)") self.assertEqual(searchTermItems[6], "References using\nMouse Models")
def testDuplicateStage(self): """ @status trying to add a duplicate term/stage to the clip board. """ self.performSearch(term="brain") result = self.driver.find_element_by_id("termResultList").find_element_by_css_selector("mark") result.click() wait.forAngular(self.driver) 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("18,19,20,20,21,22,23,24,25") 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(["TS18; brain", "TS19; brain", "TS20; brain", "TS21; brain", "TS22; brain", "TS23; brain", "TS24; brain", "TS25; brain"], searchTreeItems)
def test_table_headers(self): """ @status: Tests that the summaries table headers are correct """ driver = self.driver #opens the PWI marker form driver.get(PWI_URL + '/#markerForm') nomenbox = driver.find_element_by_id('nomen') # put your marker symbol in the box nomenbox.send_keys("gata1") nomenbox.send_keys(Keys.RETURN) time.sleep(3) #finds the marker link and clicks it driver.find_element_by_link_text("Gata1").click() wait.forAjax(driver) driver.find_element_by_link_text("GXD Lit Index").click() wait.forAjax(driver) #Locates the summary table and finds the table headings headerlist = driver.find_element_by_id('indexRefsTable') items = headerlist.find_elements_by_tag_name("th") searchTextItems = iterate.getTextAsList(items) wait.forAjax(driver) #verifies all the table headings are correct and in order self.assertEqual(searchTextItems, ['*','Reference','Priority','Conditional'])
def testStageLinks(self): """ tests that all stage links exist in the term detail section and clicking them function correctly """ self.performSearch(term="mouse") detailArea = self.driver.find_element_by_id("termDetailContent") stageItems = detailArea.find_elements_by_class_name("stageSelector") # add all li text to a list for "assertIn" test stages = iterate.getTextAsList(stageItems) self.assertEqual(stages, ["All","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28"]) # click stage 10 stage10 = detailArea.find_element_by_link_text("10").click() wait.forAngular(self.driver) #verify EMAPS term is loaded for mouse detailItems = self.driver.find_elements_by_css_selector("#termDetailContent dd") self.assertEqual(detailItems[2].text, "EMAPA:2576510") # verify stage is active activeStage = self.driver.find_element_by_css_selector(".stageSelector.active") self.assertEqual(activeStage.text, "10")
def test_geno_popup_data(self): """ @status this test verifies the data found in a genotype popup page. @bug under construction """ self.driver.find_element_by_name("nomen").clear() self.driver.find_element_by_name("nomen").send_keys("lepr") self.driver.find_element_by_class_name("buttonLabel").click() self.driver.find_element_by_link_text("Leprdb").click() main_window = self.driver.window_handles[0] self.driver.find_element_by_link_text("hm1").click() wait.forNewWindow(self.driver) page_title = self.driver.find_element_by_class_name("titleBarMainTitle") self.assertEqual(page_title.text, "Phenotypes Associated with This Genotype") mgi_id = self.driver.find_element_by_class_name("genoID") self.assertEqual(mgi_id.text, "MGI:4429457") geno_type_id = self.driver.find_element_by_css_selector(".hmGeno.genotypeType") self.assertEqual(geno_type_id.text, "hm1") allelesystems = self.driver.find_elements_by_class_name("mpSystemRow") allelesystems = iterate.getTextAsList(allelesystems) print allelesystems self.assertEqual(allelesystems, ["homeostasis/metabolism", "behavior/neurological", "renal/urinary system"]) """
def test_genes_tab_headers(self): ''' @status this test verifies all the table headers on the genes tab are correct and in the correct order. ''' 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")#indentifies the input field and enters gata1 wait.forAngular(self.driver) self.driver.find_element_by_id("searchButton").click() #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(2) > a.nav-link.ng-binding") print gene_tab.text self.assertEqual(gene_tab.text, "Genes (6)", "Genes tab is not visible!") gene_tab.click() gene_table_headers = self.driver.find_element_by_id("geneTable").find_element_by_css_selector("tr") items = gene_table_headers.find_elements_by_tag_name("th") searchTermItems = iterate.getTextAsList(items) self.assertEqual(searchTermItems[0], "Organism") self.assertEqual(searchTermItems[1], "Gene Symbol") self.assertEqual(searchTermItems[2], "Genetic Location") self.assertEqual(searchTermItems[3], "Genome Coordinates") self.assertEqual(searchTermItems[4], "Associated Human Diseases (Source)") self.assertEqual(searchTermItems[5], "Abnormal Mouse Phenotypes\nReported in these Systems") self.assertEqual(searchTermItems[6], "References in MGI") self.assertEqual(searchTermItems[7], "Mice With Mutations\nIn this Gene (IMSR)")
def test_table_headers(self): """ @status: Tests that the Sequence Summary table headers are correct Headers are: Select, Sequence, Type, Length, Strain/Species, Description from Sequence Provider, Clone Collection, Marker Symbol """ driver = self.driver driver.get(config.FEWI_URL + "/marker") genebox = driver.find_element_by_name("nomen") # put your marker symbol genebox.send_keys("Bloc1s2") genebox.send_keys(Keys.RETURN) time.sleep(3) # finds the correct marker link and clicks it driver.find_element_by_link_text("Bloc1s2").click() wait.forAjax(driver) # Finds the All sequences link and clicks it driver.find_element_by_link_text("15").click() wait.forAjax(driver) # Locates the marker header table and finds the table headings markerheaderlist = driver.find_element_by_class_name("summaryHeaderCat1") items = markerheaderlist.find_elements_by_tag_name("div") searchTextItems = iterate.getTextAsList(items) wait.forAjax(driver) # verifies all the table headings are correct and in order self.assertEqual(searchTextItems, ["Symbol", "Name", "ID"]) wait.forAjax(driver) # Locates the sequence summary table and finds the table headings columnheaderlist = driver.find_elements_by_class_name("yui-dt-label") searchTextItems = iterate.getTextAsList(columnheaderlist) wait.forAjax(driver) # verifies all the table headings are correct and in order self.assertEqual( searchTextItems, [ "Select", "Sequence", "Type", "Length", "Strain/Species", "Description From\nSequence Provider", "Clone\nCollection", "Marker\nSymbol", ], )