コード例 #1
0
    def test_N_DSNAPC(self, setup):
        self.logger.info(
            "**************** Test Regression Cycle ****************")
        self.driver = setup
        self.driver.maximize_window()
        self.driver.get(self.url)
        time.sleep(3)
        self.lp = LoginPage(self.driver)
        self.lp.EnterUsername(self.username)
        time.sleep(1)
        self.lp.EnterPassword(self.password)
        time.sleep(1)
        self.lp.ClickLogin()
        time.sleep(5)
        self.logger.info("***** Login has been successfully done. *****")
        self.lp.SelectDis(self.Sdis)
        time.sleep(2)
        self.lp.SelectDisSite(self.SdisS)
        time.sleep(2)
        self.lp.ClickGoto()
        time.sleep(2)
        self.lp.ClickAccept()
        time.sleep(3)
        self.logger.info(
            "***** Selected disaster and disaster site successfully. *****")
        self.driver.get(self.HH_url)
        time.sleep(8)
        self.logger.info("***** Creation of HH *****")
        self.CHH = CreateHHPO(self.driver)  # Creation of HH
        self.CHH.Click_New()
        time.sleep(5)
        self.CHH.Click_IsHomless()
        time.sleep(1)
        self.CHH.Click_IsHomless_N()
        time.sleep(1)
        self.CHH.Enter_ResAdd_Str1(self.ResAddstr1)
        time.sleep(1)
        self.CHH.Enter_ResAdd_Str2(self.ResAddstr2)
        time.sleep(1)
        self.CHH.Enter_ResAdd_City(self.ResAddCity)
        time.sleep(1)
        self.CHH.Enter_ResAdd_ZipC(self.ResAddZip)
        time.sleep(1)
        actions = ActionChains(setup)
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_POO()
        time.sleep(1)
        self.CHH.Click_POO_Acadia()
        time.sleep(1)
        self.CHH.Click_MailAdd_Same()
        time.sleep(1)
        self.CHH.Click_MailAdd_Same_Y()
        self.CHH.Click_MailAdd_Str2()
        time.sleep(1)
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_Rec_SNAP()
        time.sleep(1)
        self.CHH.Click_Rec_SNAP_N()
        time.sleep(1)
        self.CHH.Click_Mem_DCFS()
        time.sleep(1)
        self.CHH.Click_Mem_DCFS_N()
        self.CHH.Click_SNAPState()
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_AuthRep()
        time.sleep(1)
        self.CHH.Click_AuthRep_N()
        time.sleep(1)
        self.CHH.Click_Save()
        time.sleep(8)
        self.logger.info("***** HH has been created successfully *****")
        self.driver.save_screenshot(
            "C:\\Users\\mkalamshabaz\\PycharmProjects\\DSNAP\\Screenshots\\HHCreated.png"
        )
        self.logger.info("***** Creation of HOH *****")
        self.CHOH = CreateHOH(self.driver)
        self.CHOH.ClickNewHHMem()
        time.sleep(6.5)

        self.rows = XLUtils.getRowCount(self.path, 'Regression details')
        for r in range(1, self.rows):
            self.FN = XLUtils.readData(self.path, 'Regression details', r, 1)
            self.LN = XLUtils.readData(self.path, 'Regression details', r, 2)
            self.DOB = XLUtils.readData(self.path, 'Regression details', r, 3)

        self.CHOH.EnterFN(self.FN)
        time.sleep(1.5)
        self.CHOH.EnterLN(self.LN)
        time.sleep(1)
        self.CHOH.EnterDOB(self.DOB)
        time.sleep(1)
        self.CHOH.SelectGender(self.GenderValue)
        time.sleep(1)
        self.CHOH.EnterSSN(self.SSN)
        time.sleep(1)
        self.CHOH.Click_Save()
        time.sleep(5.5)
        self.CHOH.ClickNewHHMem()
        time.sleep(6)

        for r in range(1, self.rows + 1):
            self.FN = XLUtils.readData(self.path, 'Regression details', r, 1)
            self.LN = XLUtils.readData(self.path, 'Regression details', r, 2)
            self.DOB = XLUtils.readData(self.path, 'Regression details', r, 3)

        self.CHOH.EnterFN(self.FN)
        time.sleep(1.5)
        self.CHOH.EnterLN(self.LN)
        time.sleep(1)
        self.CHOH.EnterDOB(self.DOB)
        time.sleep(1)
        self.CHOH.SelectGender(self.GenderValue)
        time.sleep(1)
        self.CHOH.EnterSSN(self.MSSN)
        time.sleep(1)
        self.CHOH.Click_Save()
        time.sleep(5)
        self.logger.info(
            "***** HOH and member have been added successfully *****")
        self.logger.info("***** Performing MPI Search for HOH *****")
        self.MPIS = MPISearch(self.driver)
        self.MPIS.ClickHOH()
        time.sleep(4.5)
        self.MPIS.ClickLS()
        time.sleep(5)
        self.MPIS.ClickLS_Cancl()
        time.sleep(3.5)
        self.MPIS.ClickMPIS()
        time.sleep(5)
        self.MPIS.ClickMPIS_Cancl()
        time.sleep(3.5)
        self.logger.info(
            "***** MPI search for HOH has been done successfully *****")
        self.MPIS.ClickHOHBck()
        time.sleep(4)
        self.logger.info("***** Performing MPI Search for Member *****")
        actions.send_keys(Keys.PAGE_DOWN, Keys.PAGE_DOWN).perform()
        time.sleep(4)
        self.MPIS.ClickMem()
        time.sleep(6)
        self.driver.refresh()
        time.sleep(8)
        self.MPIS.ClickLS_M()
        time.sleep(5.5)
        self.MPIS.Click_Excep_Cncl_LS()
        time.sleep(3.5)
        self.MPIS.ClickMPIS_M()
        time.sleep(5)
        self.MPIS.Click_Excep_Cncl_LS()
        time.sleep(4)
        self.logger.info(
            "***** MPI search for Member has been done successfully *****")
        self.MPIS.ClickMBck()
        time.sleep(6.5)
        self.logger.info("***** Adding Interviewee *****")
        self.AI = Interviewee(self.driver)
        self.AI.Click_MenuOptn()
        time.sleep(2)
        self.AI.Click_New_Inter()
        time.sleep(4)
        self.AI.Click_SearchMem()
        time.sleep(2.5)
        self.AI.Click_Mem()
        time.sleep(1.5)
        self.AI.Select_DocID(self.DocIDvalue)
        time.sleep(1.5)
        elm = self.driver.find_element_by_tag_name('html')
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.TAB, Keys.ENTER)
        time.sleep(4)
        self.logger.info("***** Interviewee has been added successfully *****")
        self.logger.info(
            "***** New DSNAP case creation has been started *****")
        self.NDSNPC = N_DSNAPCase(self.driver)
        self.NDSNPC.Click_MenuOptn()
        time.sleep(2)
        self.NDSNPC.Click_New_DSNAPC()
        time.sleep(4)
        self.NDSNPC.Click_DisName(self.Sdis)
        time.sleep(2.5)
        self.NDSNPC.Sel_DisName()
        time.sleep(1.5)
        self.NDSNPC.Click_IntSel()
        time.sleep(2)
        self.NDSNPC.Click_OptnIntSel()
        time.sleep(2)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.TAB, Keys.TAB, Keys.TAB,
                      Keys.ENTER)
        time.sleep(6.5)
        self.logger.info(
            "***** New DSNAP case has been created successfully *****")
        self.driver.save_screenshot(
            "C:\\Users\\mkalamshabaz\\PycharmProjects\\DSNAP\\Screenshots\\DSNAPCaseCreated.png"
        )
        self.logger.info("***** Certification of DSNAP Case *****")
        self.logger.info(
            "***** Inserting Voter Registration Information *****")
        self.DC_Cert = DC_CertPO(self.driver)
        self.DC_Cert.Click_VR()
        time.sleep(4.5)
        self.DC_Cert.Sel_VRQ1(self.VRQ1)
        time.sleep(1)
        self.DC_Cert.Sel_VRQ2(self.VRQ2)
        time.sleep(2.5)
        self.DC_Cert.Click_PunderVRQ2()
        time.sleep(1.5)
        actions.send_keys(Keys.TAB, Keys.ENTER).perform()
        time.sleep(4)
        self.logger.info(
            "***** Voter Registration Information has been entered successfully *****"
        )
        self.logger.info("***** Inserting Disaster Impact Details *****")
        self.DC_Cert.Click_DID()
        time.sleep(3.5)
        self.DC_Cert.Sel_DIDQ1(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ2(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ3(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ4(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ5(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ6(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Ent_DIDQ7(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Ent_DIDQ8(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Ent_DIDQ9(self.Exp)
        time.sleep(1)
        actions.send_keys(Keys.TAB, Keys.ENTER).perform()
        time.sleep(4)
        self.logger.info(
            "***** Disaster Impact Details has been entered successfully *****"
        )
        self.logger.info(
            "***** Inserting Rights and Responsibilities Details *****")
        self.DC_Cert.Click_RR()
        time.sleep(4)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.SPACE)
        time.sleep(2)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.SPACE)
        time.sleep(2)
        self.DC_Cert.Click_RRQ1(self.Sign)
        time.sleep(1)
        self.DC_Cert.Click_RRQ2(self.Sign)
        time.sleep(1)
        self.DC_Cert.Click_RRQ2_Sign(self.Sign)
        time.sleep(1.5)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.SPACE)
        time.sleep(2.5)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.TAB, Keys.ENTER)
        time.sleep(5)
        self.logger.info(
            "***** Rights and Responsibilities Details has been entered successfully *****"
        )
        self.logger.info("***** Performing Address Verification *****")
        self.DC_Cert.Click_MenuOptn()
        time.sleep(2.5)
        self.DC_Cert.Click_AddVer_Optn()
        time.sleep(4)
        actions.send_keys(Keys.PAGE_DOWN).perform()
        time.sleep(2)
        self.DC_Cert.Click_Save_AddVer()
        time.sleep(3.5)
        self.DC_Cert.Click_MenuOptn()
        time.sleep(2.5)
        self.DC_Cert.Click_Certify()
        time.sleep(6)
        self.TextMess = self.MPIS.ToastMess()
        if self.TextMess == "The record has been Saved successfully.":
            assert True
            self.logger.info(
                "***** DSNAP Case has been certified successfully *****")
            self.driver.close()
        else:
            self.logger.info(
                "***** DSNAP Case has not been certified successfully *****")
            self.driver.save_screenshot(
                "C:\\Users\\mkalamshabaz\\PycharmProjects\\DSNAP\\Screenshots\\CaseNotCertified.png"
            )
            self.driver.close()
            assert False
コード例 #2
0
ファイル: test_MPISearch.py プロジェクト: makpowerful/DSNAP
    def test_CreateHH(self, setup):
        self.logger.info("**************** Test HOH Creation ****************")
        self.driver = setup
        self.driver.maximize_window()
        self.driver.get(self.url)
        time.sleep(3)
        self.lp = LoginPage(self.driver)
        self.lp.EnterUsername(self.username)
        time.sleep(1)
        self.lp.EnterPassword(self.password)
        time.sleep(1)
        self.lp.ClickLogin()
        time.sleep(5)
        self.logger.info("***** Login has been successfully done. *****")
        self.lp.SelectDis(self.Sdis)
        time.sleep(2)
        self.lp.SelectDisSite(self.SdisS)
        time.sleep(2)
        self.lp.ClickGoto()
        time.sleep(2)
        self.lp.ClickAccept()
        time.sleep(3)
        self.logger.info(
            "***** Selected disaster and disaster site successfully. *****")
        self.driver.get(self.HH_url)
        time.sleep(8)
        self.logger.info("***** Creation of HH *****")
        self.CHH = CreateHHPO(self.driver)  # Creation of HH
        self.CHH.Click_New()
        time.sleep(5)
        self.CHH.Click_IsHomless()
        time.sleep(1)
        self.CHH.Click_IsHomless_N()
        time.sleep(1)
        self.CHH.Enter_ResAdd_Str1(self.ResAddstr1)
        time.sleep(1)
        self.CHH.Enter_ResAdd_Str2(self.ResAddstr2)
        time.sleep(1)
        self.CHH.Enter_ResAdd_City(self.ResAddCity)
        time.sleep(1)
        self.CHH.Enter_ResAdd_ZipC(self.ResAddZip)
        time.sleep(1)
        actions = ActionChains(setup)
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_POO()
        time.sleep(1)
        self.CHH.Click_POO_Acadia()
        time.sleep(1)
        self.CHH.Click_MailAdd_Same()
        time.sleep(1)
        self.CHH.Click_MailAdd_Same_Y()
        self.CHH.Click_MailAdd_Str2()
        time.sleep(1)
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_Rec_SNAP()
        time.sleep(1)
        self.CHH.Click_Rec_SNAP_N()
        time.sleep(1)
        self.CHH.Click_Mem_DCFS()
        time.sleep(1)
        self.CHH.Click_Mem_DCFS_N()
        self.CHH.Click_SNAPState()
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_AuthRep()
        time.sleep(1)
        self.CHH.Click_AuthRep_N()
        time.sleep(1)
        self.CHH.Click_Save()
        time.sleep(5)
        self.logger.info("***** HH has been created successfully *****")
        self.logger.info("***** Creation of HOH *****")
        self.CHOH = CreateHOH(self.driver)
        self.CHOH.ClickNewHHMem()
        time.sleep(5)

        self.rows = XLUtils.getRowCount(self.path, 'HOH details')
        for r in range(2, self.rows + 1):
            self.FN = XLUtils.readData(self.path, 'HOH details', r, 1)
            self.LN = XLUtils.readData(self.path, 'HOH details', r, 2)
            self.DOB = XLUtils.readData(self.path, 'HOH details', r, 3)

        self.CHOH.EnterFN(self.FN)
        time.sleep(1.5)
        self.CHOH.EnterLN(self.LN)
        time.sleep(1)
        self.CHOH.EnterDOB(self.DOB)
        time.sleep(1)
        self.CHOH.SelectGender(self.GenderValue)
        time.sleep(1)
        self.CHOH.EnterSSN(self.SSN)
        time.sleep(1)
        self.CHOH.Click_Save()
        time.sleep(3)
        self.logger.info("***** HOH has been added successfully *****")
        self.logger.info("***** Performing MPI Search *****")
        self.MPIS = MPISearch(self.driver)
        self.MPIS.ClickHOH()
        time.sleep(4)
        self.MPIS.ClickLS()
        time.sleep(4)
        self.MPIS.ClickLS_Cancl()
        time.sleep(3)
        self.MPIS.ClickMPIS()
        time.sleep(4)
        self.MPIS.ClickMPIS_Cancl()
        time.sleep(3)
        self.TextMess = self.MPIS.ToastMess()
        if self.TextMess == "SSN is validated with provided SSN number.":
            assert True
            self.logger.info(
                "***** MPI search has been done successfully *****")
            self.driver.close()
        else:
            self.logger.info(
                "***** MPI search has not been done successfully *****")
            self.driver.save_screenshot(
                "C:\\Users\\mkalamshabaz\\PycharmProjects\\DSNAP\\Screenshots\\MPISearch.png"
            )
            self.driver.close()
            assert False
コード例 #3
0
ファイル: test_DSNAPC_Cert.py プロジェクト: makpowerful/DSNAP
class Test_DSNAPC_Cert():

    url = ReadConfig.getApplicationurl()
    username = ReadConfig.getUsername()
    password = ReadConfig.getPassword()
    Sdis = ReadConfig.getDisaster()
    SdisS = ReadConfig.getDisasterSite()
    HH_url = ReadConfig.getApplicationHH_url()
    logger = LogGen.loggen()
    ResAddstr1 = ReadConfig.getResAddstr1()
    ResAddstr2 = ReadConfig.getResAddstr2()
    ResAddCity = ReadConfig.getResAddCity()
    ResAddZip = ReadConfig.getResAddZip()
    path = "C:\\Users\\mkalamshabaz\\PycharmProjects\\DSNAP\\TestData\\DSNAP.xlsx"
    SSN = random.randint(100000000, 888888899)
    GenderValue = ReadConfig.getGender()
    DocIDvalue = ReadConfig.getDocId()
    VRQ1 = ReadConfig.getVRQ1()
    VRQ2 = ReadConfig.getVRQ2()
    DIDR = ReadConfig.getDIDR()
    Exp = ReadConfig.getExp()
    Sign = ReadConfig.getSign()

    def test_N_DSNAPC(self, setup):
        self.logger.info(
            "**************** Test New DSNAP Case Creation ****************")
        self.driver = setup
        self.driver.maximize_window()
        self.driver.get(self.url)
        time.sleep(3)
        self.lp = LoginPage(self.driver)
        self.lp.EnterUsername(self.username)
        time.sleep(1)
        self.lp.EnterPassword(self.password)
        time.sleep(1)
        self.lp.ClickLogin()
        time.sleep(5)
        self.logger.info("***** Login has been successfully done. *****")
        self.lp.SelectDis(self.Sdis)
        time.sleep(2)
        self.lp.SelectDisSite(self.SdisS)
        time.sleep(2)
        self.lp.ClickGoto()
        time.sleep(2)
        self.lp.ClickAccept()
        time.sleep(3)
        self.logger.info(
            "***** Selected disaster and disaster site successfully. *****")
        self.driver.get(self.HH_url)
        time.sleep(8)
        self.logger.info("***** Creation of HH *****")
        self.CHH = CreateHHPO(self.driver)  # Creation of HH
        self.CHH.Click_New()
        time.sleep(5)
        self.CHH.Click_IsHomless()
        time.sleep(1)
        self.CHH.Click_IsHomless_N()
        time.sleep(1)
        self.CHH.Enter_ResAdd_Str1(self.ResAddstr1)
        time.sleep(1)
        self.CHH.Enter_ResAdd_Str2(self.ResAddstr2)
        time.sleep(1)
        self.CHH.Enter_ResAdd_City(self.ResAddCity)
        time.sleep(1)
        self.CHH.Enter_ResAdd_ZipC(self.ResAddZip)
        time.sleep(1)
        actions = ActionChains(setup)
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_POO()
        time.sleep(1)
        self.CHH.Click_POO_Acadia()
        time.sleep(1)
        self.CHH.Click_MailAdd_Same()
        time.sleep(1)
        self.CHH.Click_MailAdd_Same_Y()
        self.CHH.Click_MailAdd_Str2()
        time.sleep(1)
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_Rec_SNAP()
        time.sleep(1)
        self.CHH.Click_Rec_SNAP_N()
        time.sleep(1)
        self.CHH.Click_Mem_DCFS()
        time.sleep(1)
        self.CHH.Click_Mem_DCFS_N()
        self.CHH.Click_SNAPState()
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_AuthRep()
        time.sleep(1)
        self.CHH.Click_AuthRep_N()
        time.sleep(1)
        self.CHH.Click_Save()
        time.sleep(8)
        self.logger.info("***** HH has been created successfully *****")
        self.logger.info("***** Creation of HOH *****")
        self.CHOH = CreateHOH(self.driver)
        self.CHOH.ClickNewHHMem()
        time.sleep(6.5)

        self.rows = XLUtils.getRowCount(self.path, 'HOH details')
        for r in range(2, self.rows + 1):
            self.FN = XLUtils.readData(self.path, 'HOH details', r, 1)
            self.LN = XLUtils.readData(self.path, 'HOH details', r, 2)
            self.DOB = XLUtils.readData(self.path, 'HOH details', r, 3)

        self.CHOH.EnterFN(self.FN)
        time.sleep(1.5)
        self.CHOH.EnterLN(self.LN)
        time.sleep(1)
        self.CHOH.EnterDOB(self.DOB)
        time.sleep(1)
        self.CHOH.SelectGender(self.GenderValue)
        time.sleep(1)
        self.CHOH.EnterSSN(self.SSN)
        time.sleep(1)
        self.CHOH.Click_Save()
        time.sleep(5)
        self.logger.info("***** HOH has been added successfully *****")
        self.logger.info("***** Performing MPI Search *****")
        self.MPIS = MPISearch(self.driver)
        self.MPIS.ClickHOH()
        time.sleep(4.5)
        self.MPIS.ClickLS()
        time.sleep(5)
        self.MPIS.ClickLS_Cancl()
        time.sleep(3.5)
        self.MPIS.ClickMPIS()
        time.sleep(5)
        self.MPIS.ClickMPIS_Cancl()
        time.sleep(3.5)
        self.logger.info("***** MPI search has been done successfully *****")
        self.MPIS.ClickHOHBck()
        time.sleep(4)
        self.logger.info("***** Adding Interviewee *****")
        self.AI = Interviewee(self.driver)
        self.AI.Click_MenuOptn()
        time.sleep(2)
        self.AI.Click_New_Inter()
        time.sleep(4)
        self.AI.Click_SearchMem()
        time.sleep(2.5)
        self.AI.Click_Mem()
        time.sleep(1.5)
        self.AI.Select_DocID(self.DocIDvalue)
        time.sleep(1.5)
        #self.driver.execute_script("document.body.style.zoom='80%'")
        #time.sleep(2)
        elm = self.driver.find_element_by_tag_name('html')
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.TAB, Keys.ENTER)
        #actions.key_down(Keys.LEFT_SHIFT).send_keys(Keys.TAB).key_up(Keys.LEFT_SHIFT).perform()
        #actions.key_down(Keys.LEFT_SHIFT).send_keys(Keys.TAB).key_up(Keys.LEFT_SHIFT).perform()
        #time.sleep(1)
        #actions.send_keys(Keys.ENTER).perform()
        time.sleep(4)
        self.logger.info("***** Interviewee has been added successfully *****")
        self.logger.info(
            "***** New DSNAP case creation has been started *****")
        self.NDSNPC = N_DSNAPCase(self.driver)
        self.NDSNPC.Click_MenuOptn()
        time.sleep(2)
        self.NDSNPC.Click_New_DSNAPC()
        time.sleep(4)
        self.NDSNPC.Click_DisName(self.Sdis)
        time.sleep(2.5)
        self.NDSNPC.Sel_DisName()
        time.sleep(1.5)
        self.NDSNPC.Click_IntSel()
        time.sleep(2)
        self.NDSNPC.Click_OptnIntSel()
        time.sleep(2)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.TAB, Keys.TAB, Keys.TAB,
                      Keys.ENTER)
        time.sleep(6.5)
        self.logger.info(
            "***** New DSNAP case has been created successfully *****")
        self.logger.info("***** Certification of DSNAP Case *****")
        self.logger.info(
            "***** Inserting Voter Registration Information *****")
        self.DC_Cert = DC_CertPO(self.driver)
        self.DC_Cert.Click_VR()
        time.sleep(4.5)
        #actions.send_keys(Keys.PAGE_DOWN).perform()
        #time.sleep(2)
        self.DC_Cert.Sel_VRQ1(self.VRQ1)
        time.sleep(1)
        self.DC_Cert.Sel_VRQ2(self.VRQ2)
        time.sleep(2.5)
        self.DC_Cert.Click_PunderVRQ2()
        time.sleep(1.5)
        actions.send_keys(Keys.TAB, Keys.ENTER).perform()
        time.sleep(4)
        self.logger.info(
            "***** Voter Registration Information has been entered successfully *****"
        )
        self.logger.info("***** Inserting Disaster Impact Details *****")
        self.DC_Cert.Click_DID()
        time.sleep(3.5)
        self.DC_Cert.Sel_DIDQ1(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ2(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ3(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ4(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ5(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Sel_DIDQ6(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Ent_DIDQ7(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Ent_DIDQ8(self.DIDR)
        time.sleep(1)
        self.DC_Cert.Ent_DIDQ9(self.Exp)
        time.sleep(1)
        actions.send_keys(Keys.TAB, Keys.ENTER).perform()
        time.sleep(4)
        self.logger.info(
            "***** Disaster Impact Details has been entered successfully *****"
        )
        self.logger.info(
            "***** Inserting Rights and Responsibilities Details *****")
        self.DC_Cert.Click_RR()
        time.sleep(4)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.SPACE)
        time.sleep(2)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.SPACE)
        time.sleep(2)
        self.DC_Cert.Click_RRQ1(self.Sign)
        time.sleep(1)
        self.DC_Cert.Click_RRQ2(self.Sign)
        time.sleep(1)
        self.DC_Cert.Click_RRQ2_Sign(self.Sign)
        time.sleep(1.5)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.SPACE)
        time.sleep(2.5)
        elm.send_keys(Keys.TAB, Keys.TAB, Keys.TAB, Keys.ENTER)
        time.sleep(5)
        self.logger.info(
            "***** Rights and Responsibilities Details has been entered successfully *****"
        )
        self.logger.info("***** Performing Address Verification *****")
        self.DC_Cert.Click_MenuOptn()
        time.sleep(2.5)
        self.DC_Cert.Click_AddVer_Optn()
        time.sleep(4)
        actions.send_keys(Keys.PAGE_DOWN).perform()
        time.sleep(2)
        self.DC_Cert.Click_Save_AddVer()
        time.sleep(3.5)
        self.DC_Cert.Click_MenuOptn()
        time.sleep(2.5)
        self.DC_Cert.Click_Certify()
        time.sleep(6)
        self.TextMess = self.MPIS.ToastMess()
        if self.TextMess == "The record has been Saved successfully.":
            assert True
            self.logger.info(
                "***** DSNAP Case has been certified successfully *****")
            self.driver.close()
        else:
            self.logger.info(
                "***** Interviewee has not been added successfully *****")
            self.driver.save_screenshot(
                "C:\\Users\\mkalamshabaz\\PycharmProjects\\DSNAP\\Screenshots\\AddInterview.png"
            )
            self.driver.close()
            assert False
コード例 #4
0
    def test_N_DSNAPC(self, setup):
        self.logger.info(
            "**************** Test DSNAP Case Certification ****************")
        self.driver = setup
        self.driver.maximize_window()
        self.driver.get(self.url)
        time.sleep(3)
        self.lp = LoginPage(self.driver)
        self.lp.EnterUsername(self.username)
        time.sleep(1)
        self.lp.EnterPassword(self.password)
        time.sleep(1)
        self.lp.ClickLogin()
        time.sleep(5)
        self.logger.info("***** Login has been successfully done. *****")
        self.lp.SelectDis(self.Sdis)
        time.sleep(2)
        self.lp.SelectDisSite(self.SdisS)
        time.sleep(2)
        self.lp.ClickGoto()
        time.sleep(2)
        self.lp.ClickAccept()
        time.sleep(3)
        self.logger.info(
            "***** Selected disaster and disaster site successfully. *****")
        self.driver.get(self.HH_url)
        time.sleep(8)
        self.logger.info("***** Creation of HH *****")
        self.CHH = CreateHHPO(self.driver)  # Creation of HH
        self.CHH.Click_New()
        time.sleep(5)
        self.CHH.Click_IsHomless()
        time.sleep(1)
        self.CHH.Click_IsHomless_N()
        time.sleep(1)
        self.CHH.Enter_ResAdd_Str1(self.ResAddstr1)
        time.sleep(1)
        self.CHH.Enter_ResAdd_Str2(self.ResAddstr2)
        time.sleep(1)
        self.CHH.Enter_ResAdd_City(self.ResAddCity)
        time.sleep(1)
        self.CHH.Enter_ResAdd_ZipC(self.ResAddZip)
        time.sleep(1)
        actions = ActionChains(setup)
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_POO()
        time.sleep(1)
        self.CHH.Click_POO_Acadia()
        time.sleep(1)
        self.CHH.Click_MailAdd_Same()
        time.sleep(1)
        self.CHH.Click_MailAdd_Same_Y()
        self.CHH.Click_MailAdd_Str2()
        time.sleep(1)
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_Rec_SNAP()
        time.sleep(1)
        self.CHH.Click_Rec_SNAP_N()
        time.sleep(1)
        self.CHH.Click_Mem_DCFS()
        time.sleep(1)
        self.CHH.Click_Mem_DCFS_N()
        self.CHH.Click_SNAPState()
        for _ in range(1):
            actions.send_keys(Keys.PAGE_DOWN).perform()
            time.sleep(2)
        self.CHH.Click_AuthRep()
        time.sleep(1)
        self.CHH.Click_AuthRep_N()
        time.sleep(1)
        self.CHH.Click_Save()
        time.sleep(8)
        self.logger.info("***** HH has been created successfully *****")
        self.logger.info("***** Creation of HOH *****")
        self.CHOH = CreateHOH(self.driver)
        self.CHOH.ClickNewHHMem()
        time.sleep(5.5)

        self.rows = XLUtils.getRowCount(self.path, 'HOH details')
        for r in range(2, self.rows + 1):
            self.FN = XLUtils.readData(self.path, 'HOH details', r, 1)
            self.LN = XLUtils.readData(self.path, 'HOH details', r, 2)
            self.DOB = XLUtils.readData(self.path, 'HOH details', r, 3)

        self.CHOH.EnterFN(self.FN)
        time.sleep(1.5)
        self.CHOH.EnterLN(self.LN)
        time.sleep(1)
        self.CHOH.EnterDOB(self.DOB)
        time.sleep(1)
        self.CHOH.SelectGender(self.GenderValue)
        time.sleep(1)
        self.CHOH.EnterSSN(self.SSN)
        time.sleep(1)
        self.CHOH.Click_Save()
        time.sleep(5)
        self.logger.info("***** HOH has been added successfully *****")
        self.logger.info("***** Performing MPI Search *****")
        self.MPIS = MPISearch(self.driver)
        self.MPIS.ClickHOH()
        time.sleep(4.5)
        self.MPIS.ClickLS()
        time.sleep(5)
        self.MPIS.ClickLS_Cancl()
        time.sleep(3.5)
        self.MPIS.ClickMPIS()
        time.sleep(5)
        self.MPIS.ClickMPIS_Cancl()
        time.sleep(3.5)
        self.logger.info("***** MPI search has been done successfully *****")
        self.MPIS.ClickHOHBck()
        time.sleep(4)
        self.logger.info("***** Adding Interviewee *****")
        self.AI = Interviewee(self.driver)
        self.AI.Click_MenuOptn()
        time.sleep(2)
        self.AI.Click_New_Inter()
        time.sleep(4)
        self.AI.Click_SearchMem()
        time.sleep(2.5)
        self.AI.Click_Mem()
        time.sleep(1.5)
        self.AI.Select_DocID(self.DocIDvalue)
        time.sleep(1.5)
        #self.driver.execute_script("document.body.style.zoom='80%'")
        #time.sleep(2)
        actions.send_keys(Keys.TAB, Keys.TAB).perform()
        actions.key_down(Keys.LEFT_SHIFT).send_keys(Keys.TAB).key_up(
            Keys.LEFT_SHIFT).perform()
        actions.key_down(Keys.LEFT_SHIFT).send_keys(Keys.TAB).key_up(
            Keys.LEFT_SHIFT).perform()
        time.sleep(1)
        actions.send_keys(Keys.ENTER).perform()
        time.sleep(4)
        self.logger.info("***** Interviewee has been added successfully *****")
        self.logger.info(
            "***** New DSNAP case creation has been started *****")
        self.NDSNPC = N_DSNAPCase(self.driver)
        self.NDSNPC.Click_MenuOptn()
        time.sleep(2)
        self.NDSNPC.Click_New_DSNAPC()
        time.sleep(4)
        self.NDSNPC.Click_DisName(self.Sdis)
        time.sleep(2.5)
        self.NDSNPC.Sel_DisName()
        time.sleep(1.5)
        self.NDSNPC.Click_IntSel()
        time.sleep(2)
        self.NDSNPC.Click_OptnIntSel()
        time.sleep(2)
        #self.driver.execute_script("document.body.style.zoom='80%'")
        time.sleep(2)
        actions.send_keys(Keys.TAB, Keys.TAB).perform()
        actions.key_down(Keys.LEFT_SHIFT).send_keys(Keys.TAB).key_up(
            Keys.LEFT_SHIFT).perform()
        actions.key_down(Keys.LEFT_SHIFT).send_keys(Keys.TAB).key_up(
            Keys.LEFT_SHIFT).perform()
        time.sleep(1)
        actions.send_keys(Keys.ENTER).perform()
        time.sleep(5.5)
        if self.driver.title.startswith("CAS"):
            assert True
            self.logger.info(
                "***** New DSNAP case has been created successfully *****")
            self.driver.close()
        else:
            self.logger.info("***** New DSNAP case creation has failed *****")
            self.driver.save_screenshot(
                "C:\\Users\\mkalamshabaz\\PycharmProjects\\DSNAP\\Screenshots\\N_DSNAPC.png"
            )
            self.driver.close()
            assert False