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 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 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 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 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 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 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 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 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 testModifyDateSearch(self): """ @Status tests that searching by modified date gives the correct results """ form = self.form form.enter_value('modification_date', '05/06/2015') 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', 'Emp1', 'Gcg', 'Gjb1', 'Gjc1', 'Mbp', 'Sst', 'Zdbf2'])
def test_genes_tab_genes(self): ''' @status this test verifies the correct genes are returned for this query. ''' 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(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 = Table(self.driver.find_element_by_id("geneTable")) cells = gene_table.get_column_cells("Gene Symbol") print iterate.getTextAsList(cells) #displays each row of gene data gene1 = cells[1] gene2 = cells[2] gene3 = cells[3] gene4 = cells[4] gene5 = cells[5] gene6 = cells[6] #asserts that the correct genes in the correct order are returned self.assertEqual(gene1.text, 'Gata1') self.assertEqual(gene2.text, 'GATA1') self.assertEqual(gene3.text, 'Tg(Gata1)#Mym') self.assertEqual(gene4.text, 'Tg(Gata1*)#Mym') self.assertEqual(gene5.text, 'Tg(Gata1*V205G)1Mym') self.assertEqual(gene6.text, 'Tg(HBB-Gata1)G4Phi')
def test_genes_tab_diseases(self): ''' @status this test verifies the correct diseases are returned for this query. ''' 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(2) > a.nav-link.ng-binding") self.assertEqual(gene_tab.text, "Genes (6)", "Genes tab is not visible!") gene_tab.click() gene_table = Table(self.driver.find_element_by_id("geneTable")) cells = gene_table.get_column_cells("Associated Human Diseases (Source)") print iterate.getTextAsList(cells) #displays each row of gene data disease1 = cells[1] disease2 = cells[2] disease3 = cells[3] disease4 = cells[4] disease5 = cells[5] disease6 = cells[6] #asserts that the correct genes in the correct order are returned self.assertEqual(disease1.text, 'myelofibrosis\nthrombocytopenia') self.assertEqual(disease2.text, 'Down syndrome\nthrombocytopenia') self.assertEqual(disease3.text, '') self.assertEqual(disease4.text, '') self.assertEqual(disease5.text, 'thrombocytopenia') self.assertEqual(disease6.text, '')