def test_go_direct_to_ent_page(self): self.driver.get( f'{SEARCH_URL}/periods/{PERIOD}/types/ENT/units/{ENTREF}') self.assert_title(UNIT_NAME_ID, enterprise.get('vars').get('name')) self.assertEqual( self.driver.find_element_by_id(UNIT_BADGE_ID).text, 'ENTERPRISE') self.assertEqual( self.driver.find_element_by_id(UNIT_ID_ID).text, f'ERN {ENTREF}') self.assert_dict_values_present_on_page(enterprise.get('vars'))
def test_ent_page_contents(self): self.search_by_unit_id_type_period(ENTREF, 'ENT', '201810') self.assertEqual( self.driver.current_url, f'{SEARCH_URL}/periods/{PERIOD}/types/ENT/units/{ENTREF}') self.assert_title(UNIT_NAME_ID, enterprise.get('vars').get('name')) self.assertEqual( self.driver.find_element_by_id(UNIT_BADGE_ID).text, 'ENTERPRISE') self.assertEqual( self.driver.find_element_by_id(UNIT_ID_ID).text, f'ERN {ENTREF}') self.assert_dict_values_present_on_page(enterprise.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'))