def test_12_revert_to_old_values(self): facility_data = [] default_data = [] for incr in range(0, 3): if '$' in CashFE.facility_existing_values[0]: facility_data.append( CashFE.facility_existing_values[incr].replace('$ ', '').replace(',', '').replace('.', '')) default_data.append( CashFE.default_existing_values[incr].replace('$ ', '').replace(',', '').replace('.', '')) elif '' in CashFE.facility_existing_values: facility_data.append(CashFE.facility_existing_values[incr]) default_data.append(CashFE.default_existing_values[incr]) else: facility_data.append(int(float(CashFE.facility_existing_values[incr]) * 10000)) default_data.append(int(float(CashFE.default_existing_values[incr]) * 10000)) alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath=self.click_xpath, pageNum=CashFE.pageNum) alert_default = GetPutValues.putDefaultValues(self, driver=self.driver, defaultXpaths=self.defaultsXpath, defaultValues=default_data) if CashFE.dropdown_ind: dropdown = self.driver.find_element_by_xpath('//*[@id="range"]') Select(dropdown).select_by_value(CashFE.dropdown_val) if CashFE.radio_ind: radio = self.driver.find_element_by_name('allow-lag') radio.click() if CashFE.POS_ind: pos_input = self.driver.find_element_by_xpath('//*[@id="pos-days"]') pos_input.clear() pos_input.send_keys(CashFE.pos) self.driver.save_screenshot(self.urlName + "_step_12_revert_to_old_values.jpg")
def test_5_bottom_zone_greater_than_top_zone(self): loggingFE.logger.info("checking if bottom zone can be greater than top zone") facility_data = ['', 700000, 500000] default_data = ['', 750000, 650000] alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath = self.click_xpath, pageNum = ClaimsFE.pageNum) self.assertEqual(alert_facility, self.error_3) alert_default = GetPutValues.putDefaultValues(self, driver=self.driver, defaultXpaths=self.defaultsXpath, defaultValues=default_data) self.assertEqual(alert_default, self.error_3) self.driver.save_screenshot(self.urlName + "_step_5_bottom_zone_greater_than_top_zone.jpg")
def test_4_target_greater_than_top_zone(self): loggingFE.logger.info("checking if target greater than top zone") facility_data = [621234, 201234, 501234] default_data = [751234, 351234, 651234] alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath = self.click_xpath, pageNum = ClaimsFE.pageNum) self.assertEqual(alert_facility, self.error_2) alert_default = GetPutValues.putDefaultValues(self, driver=self.driver, defaultXpaths=self.defaultsXpath, defaultValues=default_data) self.assertEqual(alert_default, self.error_2) self.driver.save_screenshot(self.urlName + "_step_4_target_greater_than_top_zone.jpg")
def test_3_target_less_than_bottom_zone(self): loggingFE.logger.info("checking target less than bottom zone") facility_data = [120000, 200000, 500000] default_data = [150000, 350000, 650000] alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath = self.click_xpath, pageNum = ClaimsFE.pageNum) self.assertEqual(alert_facility, self.error_1) alert_default = GetPutValues.putDefaultValues(self, driver=self.driver, defaultXpaths=self.defaultsXpath, defaultValues=default_data) self.assertEqual(alert_default, self.error_1) self.driver.save_screenshot(self.urlName+"_step_3_target_less_than_bottom_zone.jpg")
def test_8_only_default_values(self): loggingFE.logger.info("checking for the facility to get overridden with the default numbers.") facility_data = ['', '', ''] alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath = self.click_xpath, pageNum = ClaimsFE.pageNum) facility_return_values = GetPutValues.getFacilityValues(self, driver=self.driver, facilityName=self.facility_name, click_xpath = self.click_xpath, pageNum = ClaimsFE.pageNum) facility_new_values = facility_return_values[0] default_new_values = GetPutValues.getDefaultValues(self, driver=self.driver, defaultXpaths=self.defaultsXpath) self.assertEqual(facility_new_values, default_new_values) self.driver.save_screenshot(self.urlName + "_step_8_only_default_values.jpg")
def test_6_only_facility_values(self): facility_data = [500000, 200000, 900000] alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath = self.click_xpath, pageNum = ManagementFE.pageNum) facility_return_values = GetPutValues.getFacilityValues(self, driver=self.driver, facilityName=self.facility_name, click_xpath = self.click_xpath, pageNum = ManagementFE.pageNum) facility_new_values = facility_return_values[0] formatted_facility_data = [] for incr in facility_data: if '$' in facility_new_values[0]: formatted_facility_data.append('$ {:,.2f}'.format(incr/100) ) else: formatted_facility_data.append(incr)
def test_7_revert_to_old_values(self): facility_data = [] for incr in range(0,3): if '$' in ManagementFE.facility_existing_values[0]: facility_data.append(ManagementFE.facility_existing_values[incr].replace('$ ','').replace(',','').replace('.','')) elif '' in ManagementFE.facility_existing_values: facility_data.append(ManagementFE.facility_existing_values[incr]) else: facility_data.append(ManagementFE.facility_existing_values[incr]) alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath = self.click_xpath, pageNum = ManagementFE.pageNum) self.driver.save_screenshot(self.urlName + "_step_7_only_default_values.jpg")
def test_6_only_facility_values(self): facility_data = [500000, 200000, 900000] default_data = ['', '', ''] alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath = self.click_xpath, pageNum = ClaimsFE.pageNum) alert_default = GetPutValues.putDefaultValues(self, driver=self.driver, defaultXpaths=self.defaultsXpath, defaultValues=default_data) facility_return_values = GetPutValues.getFacilityValues(self, driver=self.driver, facilityName=self.facility_name, click_xpath = self.click_xpath, pageNum = ClaimsFE.pageNum) facility_new_values = facility_return_values[0] formatted_facility_data = [] for incr in facility_data: if '$' in facility_new_values[0]: formatted_facility_data.append('$ {:,.2f}'.format(incr/100) ) else: formatted_facility_data.append(incr/10000)
def test_9_revert_to_old_values(self): facility_data = [] default_data = [] for incr in range(0,3): if '$' in ClaimsFE.facility_existing_values[0]: facility_data.append(ClaimsFE.facility_existing_values[incr].replace('$ ','').replace(',','').replace('.','')) default_data.append(ClaimsFE.default_existing_values[incr].replace('$ ', '').replace(',','').replace('.','')) elif '' in ClaimsFE.facility_existing_values: facility_data.append(ClaimsFE.facility_existing_values[incr]) default_data.append(ClaimsFE.default_existing_values[incr]) else: facility_data.append(int(float(ClaimsFE.facility_existing_values[incr]) * 10000)) default_data.append(int(float(ClaimsFE.default_existing_values[incr]) * 10000)) alert_facility = GetPutValues.putFacilityValues(self, driver=self.driver, facilityName=self.facility_name, facilityValues=facility_data, click_xpath = self.click_xpath, pageNum = ClaimsFE.pageNum) alert_default = GetPutValues.putDefaultValues(self, driver=self.driver, defaultXpaths=self.defaultsXpath, defaultValues=default_data) self.driver.save_screenshot(self.urlName + "_step_9_only_default_values.jpg")