def test_go_direct_to_leu_page(self): self.driver.get( f'{SEARCH_URL}/periods/{PERIOD}/types/LEU/units/{UBRN}') self.assert_title(UNIT_NAME_ID, legal_unit.get('vars').get('name')) self.assertEqual( self.driver.find_element_by_id(UNIT_BADGE_ID).text, 'LEGAL UNIT') self.assertEqual( self.driver.find_element_by_id(UNIT_ID_ID).text, f'UBRN {UBRN}') self.assert_dict_values_present_on_page(legal_unit.get('vars'))
def test_leu_page_contents(self): self.search_by_unit_id_type_period(UBRN, 'LEU', '201810') self.assertEqual( self.driver.current_url, f'{SEARCH_URL}/periods/{PERIOD}/types/LEU/units/{UBRN}') self.assert_title(UNIT_NAME_ID, legal_unit.get('vars').get('name')) self.assertEqual( self.driver.find_element_by_id(UNIT_BADGE_ID).text, 'LEGAL UNIT') self.assertEqual( self.driver.find_element_by_id(UNIT_ID_ID).text, f'UBRN {UBRN}') self.assert_dict_values_present_on_page(legal_unit.get('vars'))
def test_browser_back_button_leu_to_ent(self): """ To ensure there aren't caching issues, we need to test the browser back button. """ self.search_by_unit_id_type_period(UBRN, LEGAL_UNIT, PERIOD) self.assertEqual(self.driver.current_url, f'{SEARCH_URL}/periods/{PERIOD}/types/{LEGAL_UNIT}/units/{UBRN}') self.assert_dict_values_present_on_page(legal_unit.get('vars')) self.driver.find_element_by_id(BREADCRUMB_ENT_ID).click() self.assertEqual(self.driver.current_url, f'{SEARCH_URL}/periods/{PERIOD}/types/{ENTERPRISE}/units/{ERN}') self.assert_dict_values_present_on_page(enterprise.get('vars')) self.driver.back() self.assertEqual(self.driver.current_url, f'{SEARCH_URL}/periods/{PERIOD}/types/{LEGAL_UNIT}/units/{UBRN}') self.assert_dict_values_present_on_page(legal_unit.get('vars'))