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 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 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 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 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 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 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 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 testDeleteIndex(self): """ @Status tests that an index record can be deleted """ driver = self.driver form = self.form form.enter_value('jnumid', '225216') # click the Tab key form.press_tab() #finds the citation field citation = form.get_value('citation') print citation self.assertEqual(citation, 'Alvarez-Saavedra M, Nat Commun 2014;5():4181') #finds the marker field form.enter_value('marker_symbol', 'Bmp2') marker_symbol = form.get_value('marker_symbol') form.press_tab() print marker_symbol self.assertEqual(marker_symbol, 'Bmp2') #find the table field to check table_element = driver.find_element_by_id("indexGrid") table = Table(table_element) #puts an X in the Prot-sxn by age 7.5 box cell = table.get_cell("prot-sxn", "7.5") cell.click() wait.forAngular(driver) self.assertEqual(cell.text, 'X', "the cell is not checked") form.click_modify() form.click_delete()#click the delete button
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 __init__(self, competition_folder: str): """Konstruktor. Args: competition_folder (str): Ordner der Veranstaltung """ Table.__init__(self, competition_folder, FILENAME) self.settings = {}
def __init__(self, competition_folder: str, settings: SettingsTable, database: Database): """Konstruktor Args: competition_folder (str): Ordner der Veranstaltung settings (SettingsTable): Einstellungen database (Database): Datenbank """ self.settings = settings self.database = database Table.__init__(self, competition_folder, self.settings["attendees_file"])
def __init__(self, competition_folder: str, settings: SettingsTable, database: Database): """Konstruktor. Args: competition_folder (str): Ordner der Veranstaltung settings (SettingsTable): Einstellungen database (Database): Datenbank """ self.settings = settings self.database = database self.table_reader: TableReader = None Table.__init__(self, competition_folder, self.settings["clubs_template"])
def write(self, folder=None, filename=None) -> bool: """Schreiben der Tabelle Args: folder (str, optional): Ordner. Defaults to None. filename (str, optional): Dateiname. Defaults to None. Returns: bool: True, wenn erfolgreich """ filename = filename or self.settings["stations_output"] try: self.table_reader = TableReader.from_settings(self, self.settings, "groups") for station in self.database.get_stations(): for group in self.database.get_groups(): self.__create_worksheet(station, group) if self.progress: self.progress.inc_value() for station in self.database.get_stations(): self.remove_worksheet(station[STATION_SHORT]) if self.progress: self.progress.inc_value() return Table.write(self, folder, filename) except: logging.exception("Fehler beim Erstellen der Stationsübersicht.") return False
def __init__(self, competition_folder: str, settings: SettingsTable, database: Database, progress: ProgressTask = None): """Konstruktor. Args: competition_folder (str): Ordner settings (SettingsTable): Einstellungen database (Database): Datenbank progress (ProgressTask, optional): Fortschrittsanzeige. Defaults to None. """ self.settings = settings self.database = database self.progress = progress self.table_reader: TableReader = None Table.__init__(self, competition_folder, self.settings["stations_template"])
def write(self, folder=None, filename=None) -> bool: """Schreiben der Tabelle Args: folder (str, optional): Ordner. Defaults to None. filename (str, optional): Dateiname. Defaults to None. Returns: bool: True, wenn erfolgreich """ generated_filename = self.settings["values_output"] % { "station": self.station[STATION_SHORT], "riege": self.group[GROUP_NAME]} filename = filename or generated_filename try: self.table_reader = TableReader.from_settings(self, self.settings, "values") self.__create_worksheet() # Löschen aller anderen Arbeitsblätter for station in self.database.get_stations(): if station[STATION_SHORT] in self.workbook.sheetnames: self.remove_worksheet(station[STATION_SHORT]) return Table.write(self, folder, filename) except: logging.exception("Wertetabelle %s konnte nicht erstellt werden.", filename) return False
def write(self, folder=None, filename=None) -> bool: """Schreiben der Tabelle Args: folder (str, optional): Ordner. Defaults to None. filename (str, optional): Dateiname. Defaults to None. Returns: bool: True, wenn erfolgreich """ generated_filename = self.settings["scoring_output"] % { "time": time.strftime("%H%M") } filename = filename or generated_filename try: self.table_reader = TableReader.from_settings( self, self.settings, "scoring") for sclass in self.database.get_sclasses(): self.__fill_worksheet(sclass) if self.progress: self.progress.inc_value() return Table.write(self, folder, filename) except: logging.exception("Fehler beim Erstellen der Auswertung.") return False
def __init__(self, competition_folder: str, settings: SettingsTable, database: Database, station, group): """Konstruktor. Args: competition_folder (str): Ordner der Veranstaltung settings (SettingsTable): Einstellungen database (Database): Datenbank station (typing.Dict): Station group (typing.Dict): Gruppe """ self.settings = settings self.database = database self.station = station self.group = group self.table_reader: TableReader = None Table.__init__(self, competition_folder, self.settings["values_template"])
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 open(self): """Öffnen der Einstellungen. Auslesen der Einstellungen """ try: self.settings = {} if not Table.open(self): return self.__read_settings() except: logging.exception("Fehler beim Lesen der Einstellungsdatei.")
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, '')
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 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 __init__(self, competition_folder: str, settings: SettingsTable, database: Database, station, group): """Konstruktor. Args: competition_folder (str): Ordner der Veranstaltung settings (SettingsTable): Einstellungen database (Database): Datenbank station (typing.Dict): Station group (typing.Dict): Riege """ self.settings = settings self.database = database self.station = station self.group = group self.table_reader: TableReader = None self.status = logging.INFO filename = self.settings["values_input_file"] % { "station": self.station[STATION_SHORT], "riege": self.group[GROUP_NAME] } Table.__init__(self, competition_folder, filename)
def open(self) -> bool: """Öffnen der Tabelle Eintragen der Teilnehmer in die Datenbank Erstellen der Listen für Alter und Vereine in der Datenbank Returns: bool: True, wenn das Öffnen und Lesen der Daten erfolgreich war. """ if not Table.open(self): return False try: reader = TableReader.from_settings(self, self.settings, "attendees") self.database.clear_attendees() reader.read(lambda row, row_data: self.database.append_attendee(row_data)) self.database.refresh_ages() self.database.refresh_clubs() except: logging.exception("Fehler beim Auslesen der Meldungen.") return False return True
def open(self) -> bool: """Öffnen der Tabelle und Auslesen der Werte Returns: bool: True, wenn erfolgreich """ if not Table.open(self): self.status = logging.ERROR return False try: reader = TableReader.from_settings(self, self.settings, "values_input") if not reader.read(self.process_row): self.status = logging.ERROR except: logging.exception( "Fehler beim Auslesen der Daten aus der Tabelle %s", self.filename) self.status = logging.ERROR return False return True
def write(self, folder=None, filename=None) -> bool: """Schreiben der Tabelle Args: folder (str, optional): Ordner. Defaults to None. filename (str, optional): Dateiname. Defaults to None. Returns: bool: True, wenn erfolgreich """ filename = filename or self.settings["clubs_output"] try: self.table_reader = TableReader.from_settings( self, self.settings, "clubs") for club in self.database.get_clubs(): self.__create_worksheet(club) self.remove_worksheet(TEMPLATE_SHEET_NAME) return Table.write(self, folder, filename) except: logging.exception("Fehler beim Erstellen der Vereinsübersicht.") return False
def testClearFields(self): """ @Status tests that when an index record is cleared the correct fields get cleared """ driver = self.driver form = self.form form.enter_value("jnumid", "74162") # click the Tab key form.press_tab() # finds the citation field citation = form.get_value("citation") print citation self.assertEqual(citation, "Abdelwahid E, Cell Tissue Res 2001 Jul;305(1):67-78") # finds the marker field form.enter_value("marker_symbol", "Bmp2") marker_symbol = form.get_value("marker_symbol") form.press_tab() print marker_symbol self.assertEqual(marker_symbol, "Bmp2") form.click_search() # finds the coded? field is_coded = form.get_value("is_coded") print is_coded self.assertEqual(is_coded, "false") # finds the priority field priority = form.get_selected_text("_priority_key") print priority self.assertEqual(priority, "High") # finds the conditional mutants field conditional = form.get_selected_text("_conditionalmutants_key") print conditional self.assertEqual(conditional, "Not Specified") # finds the created by field created_user = form.get_value("createdby_login") print created_user self.assertEqual(created_user, "MGI_2.97") # finds the modified by field modified_user = form.get_value("modifiedby_login") # .find_element_by_css_selector('td') print modified_user self.assertEqual(modified_user, "MGI_2.97") # finds the created by date field created_date = form.get_value("creation_date") print created_date self.assertEqual(created_date, "04/23/2002") # finds the created by date field modified_date = form.get_value("modification_date") print modified_date self.assertEqual(modified_date, "04/23/2002") # find the table field to check table_element = driver.find_element_by_id("indexGrid") table = Table(table_element) # puts an X in the Prot-sxn by age 7.5 box cell = table.get_cell("RT-PCR", "A") # cell.click() wait.forAngular(driver) self.assertEqual(cell.text, "X", "the cell is not checked") form.click_clear() # press the clear button # finds the citation field citation = form.get_value("citation") print citation self.assertEqual(citation, "") # finds the marker field marker_symbol = form.get_value("marker_symbol") print marker_symbol self.assertEqual(marker_symbol, "") # finds the coded? field is_coded = form.get_value("is_coded") print is_coded self.assertEqual(is_coded, "") # finds the priority field priority = form.get_selected_text("_priority_key") print priority self.assertEqual(priority, "Search All") # finds the conditional mutants field conditional = form.get_selected_text("_conditionalmutants_key") print conditional self.assertEqual(conditional, "Search All") # finds the created by field created_user = form.get_value("createdby_login") print created_user self.assertEqual(created_user, "") # finds the modified by field modified_user = form.get_value("modifiedby_login") # .find_element_by_css_selector('td') print modified_user self.assertEqual(modified_user, "") # finds the created by date field created_date = form.get_value("creation_date") print created_date self.assertEqual(created_date, "") # finds the created by date field modified_date = form.get_value("modification_date") print modified_date self.assertEqual(modified_date, "") # find the table field to check table_element = driver.find_element_by_id("indexGrid") table = Table(table_element) # puts an X in the Prot-sxn by age 7.5 box cell = table.get_cell("RT-PCR", "A") # cell.click() wait.forAngular(driver) self.assertNotEqual(cell.text, "X", "the cell is not checked")
def testCtrlAltc(self): """ @Status tests that when an index record is cleared using Ctrl+Alt+c the correct fields are cleared """ driver = self.driver form = self.form action = ActionChains(self.driver) form.enter_value('jnumid', '74162') # click the Tab key form.press_tab() #finds the citation field citation = form.get_value('citation') print citation try: self.assertEqual(citation, 'Abdelwahid E, Cell Tissue Res 2001 Jul;305(1):67-78') self.report.AppendToReport("gxdIdx1-0", "testctrrlaltc", "citation text displays", "correct citation text displays", citation, "Pass", "") except Exception: self.report.AppendToReport("gxdIdx1-0", "testctrrlaltc", "citation text displays", "correct citation text displays", citation, "Fail", "") #finds the marker field form.enter_value('marker_symbol', 'Bmp2') marker_symbol = form.get_value('marker_symbol') form.press_tab() print marker_symbol try: self.assertEqual(marker_symbol, 'Bmp2') self.report.AppendToReport("gxdIdx1-1", "testctrrlaltc", "marker symbol displays", "correct marker symbol displays", "symbol is ", "Pass", "") except Exception: self.report.AppendToReport("gxdIdx1-1", "testctrrlaltc", "marker symbol displays", "correct marker symbol displays", "symbol is ", "Fail", "") form.click_search() time.sleep(2) action.key_down(Keys.CONTROL).key_down(Keys.ALT).send_keys('c').key_up(Keys.CONTROL).key_up(Keys.ALT).perform() time.sleep(5) #finds the citation field citation = form.get_value('citation') print citation self.assertEqual(citation, '') #finds the marker field marker_symbol = form.get_value('marker_symbol') print marker_symbol self.assertEqual(marker_symbol, '') #finds the coded? field is_coded = form.get_value('is_coded') print is_coded self.assertEqual(is_coded, '') #finds the priority field priority = form.get_selected_text('_priority_key') print priority self.assertEqual(priority, 'Search All') #finds the conditional mutants field conditional = form.get_selected_text('_conditionalmutants_key') print conditional self.assertEqual(conditional, 'Search All') #finds the created by field created_user = form.get_value('createdby_login') print created_user self.assertEqual(created_user, '') #finds the modified by field modified_user = form.get_value('modifiedby_login')#.find_element_by_css_selector('td') print modified_user self.assertEqual(modified_user, '') #finds the created by date field created_date = form.get_value('creation_date') print created_date self.assertEqual(created_date, '') #finds the created by date field modified_date = form.get_value('modification_date') print modified_date self.assertEqual(modified_date, '') #find the table field to check table_element = driver.find_element_by_id("indexGrid") table = Table(table_element) #verifies there is no X in the RNA-sxn by age 10.5 box cell = table.get_cell(2, 21) #cell.click() wait.forAngular(driver) self.assertEqual(cell.text, '', "the cell is checked")
def testCtrlAlts(self): """ @Status tests that when a reference is entered then Ctrl+Alt+s is pressed the correct results are returned """ driver = self.driver form = self.form actions = ActionChains(self.driver) form.enter_value('jnumid', '124809') # click the Tab key form.press_tab() #finds the citation field citation = form.get_value('citation') print citation try: self.assertEqual(citation, 'Cheong N, J Biol Chem 2007 Aug 17;282(33):23811-7') self.report.AppendToReport("gxdIdx1-2", "testctrrlalts", "Citation is displayed", "correct citation displays", "citation is ", "Pass", "") except Exception: self.report.AppendToReport("gxdIdx1-2", "testctrrlalts", "Citation is displayed", "correct citation displays", "citation is ", "Fail", "") actions.key_down(Keys.CONTROL).key_down(Keys.ALT).send_keys('s').key_up(Keys.CONTROL).key_up(Keys.ALT).perform() time.sleep(5) #finds the citation field citation = form.get_value('citation') print citation self.assertEqual(citation, 'Cheong N, J Biol Chem 2007 Aug 17;282(33):23811-7') #finds the marker field marker_symbol = form.get_value('marker_symbol') print marker_symbol self.assertEqual(marker_symbol, 'Abca3') #finds the coded? field is_coded = form.get_value('is_coded') print is_coded self.assertEqual(is_coded, 'false') #finds the priority field priority = form.get_selected_text('_priority_key') print priority self.assertEqual(priority, 'Medium') #finds the conditional mutants field conditional = form.get_selected_text('_conditionalmutants_key') print conditional self.assertEqual(conditional, 'Not Specified') #finds the created by field created_user = form.get_value('createdby_login') print created_user self.assertEqual(created_user, 'terryh') #finds the modified by field modified_user = form.get_value('modifiedby_login')#.find_element_by_css_selector('td') print modified_user self.assertEqual(modified_user, 'terryh') #finds the created by date field created_date = form.get_value('creation_date') print created_date self.assertEqual(created_date, '10/01/2007') #finds the created by date field modified_date = form.get_value('modification_date') print modified_date self.assertEqual(modified_date, '10/01/2007') #find the table field to check table_element = driver.find_element_by_id("indexGrid") table = Table(table_element) #verifies there is an X in the Prot-sxn by age 18.5 box cell = table.get_cell(1, 37) wait.forAngular(driver) self.assertEqual(cell.text, 'X', "the cell is checked")