Example #1
0
class TRKXFUN(unittest.TestCase):
    @classmethod
    def setUpClass(self):

        self.oHelper = Webapp(autostart=False)
        self.oHelper.SetTIRConfig(config_name="User", value="telemarketing")
        self.oHelper.SetTIRConfig(config_name="Password", value="1")

    def test_TRKXFUN_CT001(self):
        self.oHelper.Start()
        self.oHelper.Setup("SIGATMK", DateSystem, "T1", "D MG 01", "13")
        self.oHelper.Program("TMKA271")
        self.oHelper.AddParameter("MV_FATPROP", "D MG 01", "O", "O", "O")
        self.oHelper.SetParameters()
        self.oHelper.SearchBrowse(f"D MG 01 000020", "Filial+atendimento")
        self.oHelper.SetButton("Visualizar")
        self.oHelper.SetButton("Outras Ações", "Tracker da Entidade")
        self.oHelper.SetButton("Rastrear")
        self.oHelper.ClickTree("Atendimento Telemarketing  - 000020")
        self.oHelper.SetButton("Abandonar")
        self.oHelper.SetButton("Confirmar")
        self.oHelper.SetButton("X")
        self.oHelper.RestoreParameters()
        self.oHelper.AssertTrue()

    @classmethod
    def tearDownClass(self):
        self.oHelper.TearDown()
class TMKA380(unittest.TestCase):
    @classmethod
    def setUpClass(self):

        self.oHelper = Webapp(autostart=False)
        self.oHelper.SetTIRConfig(config_name="User", value="televendas")
        self.oHelper.SetTIRConfig(config_name="Password", value="1")

    def test_TMKA380_CT005(self):

        # Inicia o novo Webapp para logar com o User no Módulo
        self.oHelper.Start()
        self.oHelper.Setup("SIGATMK", "01/04/2020", "T1", "D MG 01  ", "13")
        self.oHelper.Program("TMKA380")
        # Posiciona o Atendimento: 000024
        self.oHelper.ClickGridCell("Nome", row=2)
        self.oHelper.SetButton("Ok")
        self.oHelper.SetButton("Confirmar")
        self.oHelper.SetButton("Fechar")
        self.oHelper.SetButton("Sim")
        self.oHelper.SetValue("UA_OPER", "1 - Faturamento")
        self.oHelper.SetButton("Salvar")
        self.oHelper.SetButton("Ok")
        self.oHelper.SetButton("Sim")
        self.oHelper.SetButton("Cancela")
        self.oHelper.SetButton("Cancelar")
        self.oHelper.SetButton("Sim")

        self.oHelper.AssertTrue()

    def test_TMKA380_CT006(self):

        # Posiciona o Atendimento: 000025
        self.oHelper.ClickGridCell("Nome", row=1)
        self.oHelper.SetButton("Ok")
        self.oHelper.SetButton("Confirmar")
        self.oHelper.SetButton("Fechar")
        self.oHelper.SetButton("Sim")
        self.oHelper.SetValue("UA_OBS", "Teste")
        self.oHelper.SetButton("Salvar")
        self.oHelper.SetButton("Ok")
        self.oHelper.ClickGridCell("Tipo", row=4)
        self.oHelper.SetButton("Ok")
        self.oHelper.SetButton("Cancela")
        self.oHelper.SetButton("Cancelar")
        self.oHelper.SetButton("Sim")
        self.oHelper.SetButton("Cancelar")

        self.oHelper.AssertTrue()

    @classmethod
    def tearDownClass(self):
        '''self.oHelper.TearDown()
Example #3
0
class TMKA271(unittest.TestCase):
    @classmethod
    def setUpClass(self):

        self.oHelper = Webapp(autostart=False)
        self.oHelper.SetTIRConfig(config_name="User", value="telecobranca")
        self.oHelper.SetTIRConfig(config_name="Password", value="1")

        self.oHelper2 = Webapp(autostart=False)
        self.oHelper2.SetTIRConfig(config_name="User", value="televendas")
        self.oHelper2.SetTIRConfig(config_name="Password", value="1")

        self.oHelper3 = Webapp(autostart=False)
        self.oHelper3.SetTIRConfig(config_name="User", value="telemarketing")
        self.oHelper3.SetTIRConfig(config_name="Password", value="1")

    def test_TMKA271_CT007(self):

        # Inicia o novo Webapp para logar com o User no Módulo
        self.oHelper.Start()
        self.oHelper.Setup("SIGATMK", "07/06/2019", "T1", "D MG 01  ", "13")
        self.oHelper.Program("TMKA271")

        self.oHelper.WaitShow("Telecobranca")
        self.oHelper.SetButton("Incluir")
        self.oHelper.SetBranch("D MG 01")
        self.oHelper.ClickFolder("Telecobrança")

        Atendimento = self.oHelper.GetValue("Atendimento")

        self.oHelper.SetValue("ACF_CLIENT", "TMC007")
        self.oHelper.SetValue("ACF_CODCON", "TMC007")

        self.oHelper.SetValue("ACF_STATUS", "2 - Cobranca")

        self.oHelper.SetFocus("Titulo", grid_cell=True)
        self.oHelper.SetKey("F3")
        self.oHelper.ClickBox("Prefixo", "TMK")

        self.oHelper.LoadGrid()

        self.oHelper.SetButton("Salvar")

        TimeSystem = datetime.today() + timedelta(hours=2)
        HrPend = TimeSystem.strftime("%H:%M")

        self.oHelper.SetValue("ACF_HRPEND", HrPend)

        self.oHelper.SetButton("Salvar")
        self.oHelper.SetButton("Ok")
        time.sleep(10)
        self.oHelper.SetButton("Cancelar")
        self.oHelper.SetButton("Sim")

        self.oHelper.SearchBrowse(f"D MG 01 {Atendimento}",
                                  "Filial+atendimento")
        self.oHelper.SetButton("Visualizar")

        self.oHelper.WaitShow("Atendimento")

        self.oHelper.CheckResult("ACF_CODIGO", Atendimento)
        self.oHelper.CheckResult("ACF_CLIENT", "TMC007")

        self.oHelper.CheckResult("ACF_LOJA", "01")

        #self.oHelper.CheckResult("ACG_TITULO", "TMKC007", grid=True, line=1)  #abrir task loadgrid

        #self.oHelper.LoadGrid()

        self.oHelper.SetButton("Cancelar")

        self.oHelper.AssertTrue()

    def test_TMKA271_CT008(self):

        Atendimento = "000009"  #=ok base congelada 28/06

        self.oHelper.SearchBrowse(f"D MG 01 {Atendimento}",
                                  "Filial+atendimento")

        self.oHelper.SetButton("Alterar")
        self.oHelper.ClickFolder("Telecobrança")

        self.oHelper.SetValue("ACF_STATUS", "1 - Atendimento")

        TimeSystem = datetime.today() + timedelta(hours=2)
        HrPend = TimeSystem.strftime("%H:%M")

        self.oHelper.SetValue("ACF_HRPEND", HrPend)

        self.oHelper.SetButton("Salvar")
        self.oHelper.SetButton("Ok")

        self.oHelper.SetButton("Cancelar")
        self.oHelper.SetButton("Sim")

        self.oHelper.SearchBrowse(f"D MG 01 {Atendimento}",
                                  "Filial+atendimento")
        self.oHelper.SetButton("Visualizar")

        self.oHelper.WaitShow("Atendimento")

        self.oHelper.CheckResult("ACF_CODIGO", Atendimento)
        self.oHelper.CheckResult("ACF_STATUS", "1 - Atendimento")

        self.oHelper.SetButton("Confirmar")

        self.oHelper.AssertTrue()

        self.oHelper.TearDown()

    def test_TMKA271_CT009(self):

        self.oHelper2.Start()
        self.oHelper2.Setup("SIGATMK", "07/06/2019", "T1", "D MG 01  ", "13")
        self.oHelper2.Program("TMKA271")
        self.oHelper2.WaitShow("Televendas")

        self.oHelper2.SetButton("Incluir")
        self.oHelper2.SetBranch("D MG 01")
        self.oHelper2.ClickFolder("TeleVendas")

        Atendimento = self.oHelper2.GetValue("Atendimento")

        self.oHelper2.SetValue("UA_CLIENTE", "TMC007")
        self.oHelper2.SetValue("UA_LOJA", "01")
        self.oHelper2.SetValue("UA_CODCONT", "TMC007")
        self.oHelper2.SetValue("UA_TMK", "2 - Ativo")
        self.oHelper2.SetValue("UA_OPER", "2 - Orcamento")

        #self.oHelper2.SetFocus("Produto", grid_cell = True)
        #self.oHelper2.SetKey("F3")
        #self.oHelper2.SearchBrowse(f"TMK000000000000000000000000001", "Código")
        #self.oHelper2.SetButton("Ok")
        self.oHelper2.SetValue("UB_PRODUTO",
                               "TMK000000000000000000000000001",
                               grid=True)
        self.oHelper2.SetValue("UB_QUANT", "1,00", grid=True)
        self.oHelper2.SetValue("UB_VRUNIT", "125,50", grid=True)

        #self.oHelper2.SetKey("DOWN", grid=True)

        ##self.oHelper2.SetFocus("Produto", grid_cell = True)
        ##self.oHelper2.SetKey("F3")
        ##self.oHelper2.SearchBrowse(f"TMK000000000000000000000000002", "Código")
        ##self.oHelper2.SetButton("Ok")
        #self.oHelper2.SetValue("UB_PRODUTO", "TMK000000000000000000000000002", grid=True)
        #self.oHelper2.SetValue("UB_QUANT", "1.00", grid=True)
        #self.oHelper2.SetValue("UB_VRUNIT", "1870.00", grid=True)

        self.oHelper2.LoadGrid()

        self.oHelper2.SetButton("Salvar")
        time.sleep(10)
        self.oHelper2.SetButton("Cancelar")
        time.sleep(10)
        self.oHelper2.SetButton("Cancelar")
        self.oHelper2.SetButton("Sim")

        self.oHelper2.SearchBrowse(f"D MG 01 {Atendimento}",
                                   "Filial+atendimento")
        self.oHelper2.SetButton("Visualizar")

        self.oHelper2.WaitShow("Atendimento")

        self.oHelper2.CheckResult("UA_NUM", Atendimento)
        self.oHelper2.CheckResult("UA_CLIENTE", "TMC007")
        self.oHelper2.CheckResult("UA_LOJA", "01")

        self.oHelper2.CheckResult("UB_PRODUTO",
                                  "TMK000000000000000000000000001",
                                  grid=True)  #, line=1)
        #self.oHelper2.CheckResult("UB_QUANT", "1.00", grid=True, line=1)
        #self.oHelper2.CheckResult("UB_VRUNIT", "125,50", grid=True, line=1)

        #self.oHelper2.CheckResult("UB_PRODUTO", "TMK000000000000000000000000002", grid=True, line=2)
        #self.oHelper2.CheckResult("UB_QUANT", "1.00", grid=True, line=2)
        #self.oHelper2.CheckResult("UB_VRUNIT", "1870,00", grid=True, line=2)

        self.oHelper2.LoadGrid()

        self.oHelper2.SetButton("Confirmar")

        self.oHelper2.AssertTrue()

    def test_TMKA271_CT010(self):

        Atendimento = "000012"

        self.oHelper2.SearchBrowse(f"D MG 01 {Atendimento}",
                                   "Filial+atendimento")

        self.oHelper2.SetButton("Alterar")

        self.oHelper2.ClickFolder("TeleVendas")

        self.oHelper2.SetValue("UB_VALDESC", "725,00", grid=True, row=2)
        self.oHelper2.LoadGrid()

        self.oHelper2.SetValue("UA_OPER", "1 - Faturamento")

        self.oHelper2.SetButton("Salvar")

        #self.oHelper2.WaitShow("Forma de Pagamento")

        self.oHelper2.SetButton("Ok")

        self.oHelper2.SetButton("Sim")

        self.oHelper2.WaitShow("Emissão do Pedido de Vendas - Televendas")
        self.oHelper2.SetButton("Cancelar")
        self.oHelper2.SetButton("Cancelar")

        self.oHelper2.SetButton("Sim")

        self.oHelper2.SearchBrowse(f"D MG 01 {Atendimento}",
                                   "Filial+atendimento")
        self.oHelper2.SetButton("Visualizar")

        self.oHelper2.WaitShow("Atendimento")

        self.oHelper2.CheckResult("UA_NUM", Atendimento)
        self.oHelper2.CheckResult("UA_OPER", "1 - Faturamento")

        self.oHelper2.CheckResult("UB_VRUNIT", "1.145,00", grid=True, line=2)
        self.oHelper2.CheckResult("UB_VALDESC", "725,00", grid=True, line=2)
        self.oHelper2.LoadGrid()

        self.oHelper2.SetButton("Cancelar")

        self.oHelper2.AssertTrue()

        self.oHelper2.TearDown()

    def test_TMKA271_CT011(self):

        self.oHelper3.Start()
        self.oHelper3.Setup("SIGATMK", "07/06/2019", "T1", "D MG 01  ", "13")
        self.oHelper3.Program("TMKA271")
        self.oHelper3.WaitShow("Telemarketing")

        self.oHelper3.SetButton("Incluir")
        self.oHelper3.SetBranch("D MG 01")
        self.oHelper3.ClickFolder("TeleMarketing")

        Atendimento = self.oHelper3.GetValue("Atendimento")

        self.oHelper3.SetValue("UC_CODCONT", "TMC007")
        self.oHelper3.SetButton("Ok")

        self.oHelper3.SetValue("UC_OPERACA", "1 - Receptivo")
        self.oHelper3.SetValue("UC_STATUS", "1 - Planejada")

        self.oHelper3.SetFocus("Assunto", grid_cell=True)
        self.oHelper3.SetKey("F3", grid=True)
        self.oHelper3.SearchBrowse(f"000001", "Código")
        self.oHelper3.SetButton("Ok")
        #self.oHelper3.SetValue("UD_ASSUNTO","000001",grid=True)
        self.oHelper3.SetValue("UD_PRODUTO",
                               "TMK000000000000000000000000001",
                               grid=True)

        self.oHelper3.SetFocus("Ocorrencia", grid_cell=True)
        self.oHelper3.SetKey("F3", grid=True)
        self.oHelper3.SetButton("Ok")

        self.oHelper3.LoadGrid()

        self.oHelper3.SetButton("Salvar")
        self.oHelper3.SetButton("Cancelar")
        self.oHelper3.SetButton("Sim")

        self.oHelper3.SearchBrowse(f'D MG 01 {Atendimento}',
                                   'Filial+atendimento')
        self.oHelper3.SetButton("Visualizar")

        self.oHelper3.WaitShow("Atendimento")

        self.oHelper3.CheckResult("UC_CODIGO", Atendimento)
        self.oHelper3.CheckResult("UC_CODCONT", "TMC007")

        self.oHelper3.CheckResult("UC_OPERACA", "1 - Receptivo")
        self.oHelper3.CheckResult("UC_STATUS", "1 - Planejada")

        self.oHelper3.CheckResult("UD_ASSUNTO", "000001", grid=True, line=1)
        self.oHelper3.CheckResult("UD_PRODUTO",
                                  "TMK000000000000000000000000001",
                                  grid=True,
                                  line=1)
        self.oHelper3.CheckResult("UD_OCORREN", "000003", grid=True, line=1)

        self.oHelper3.LoadGrid()

        self.oHelper3.SetButton("Confirmar")

        self.oHelper3.AssertTrue()

    def test_TMKA271_CT012(self):

        Atendimento = "000015"

        self.oHelper3.SearchBrowse(f"D MG 01 {Atendimento}",
                                   "Filial+atendimento")

        self.oHelper3.SetButton("Alterar")
        self.oHelper3.ClickFolder("TeleMarketing")

        self.oHelper3.SetValue("UC_STATUS", "2 - Pendente")

        self.oHelper3.SetButton("Salvar")
        self.oHelper3.SetButton("Cancelar")
        self.oHelper3.SetButton("Sim")

        self.oHelper3.SearchBrowse(f'D MG 01 {Atendimento}',
                                   'Filial+atendimento')
        self.oHelper3.SetButton("Visualizar")

        self.oHelper3.WaitShow("Atendimento")

        self.oHelper3.CheckResult("UC_CODIGO", Atendimento)
        self.oHelper3.CheckResult("UC_STATUS", "2 - Pendente")
        self.oHelper3.SetButton("Cancelar")

        self.oHelper3.AssertTrue()
        self.oHelper3.TearDown()

    def test_TMKA271_CT013(self):

        self.oHelper2.Start()

        self.oHelper2.Setup("SIGATMK", "23/04/2020", "T1", "D MG 01  ", "13")
        self.oHelper2.Program("TMKA271")
        self.oHelper2.WaitShow("Televendas")

        self.oHelper2.AddParameter("MV_PVRECAL", "D MG 01", ".F.", ".F.",
                                   ".F.")
        self.oHelper2.SetParameters()

        self.oHelper2.SetButton("Incluir")
        self.oHelper2.SetBranch("D MG 01")

        self.oHelper2.SetValue("UA_CLIENTE", "TMK001")
        self.oHelper2.SetValue("UA_LOJA", "01")
        self.oHelper2.SetValue("UA_TMK", "2 - Ativo")

        self.oHelper2.SetValue("UB_PRODUTO",
                               "TMK000000000000000000000000000",
                               grid=True)
        self.oHelper2.SetValue("UB_ACRE", "30,00", grid=True)

        self.oHelper2.LoadGrid()

        self.oHelper2.SetValue("UA_CONDPG", "002")

        self.oHelper2.CheckResult("UB_VRUNIT", "65,00", grid=True, line=1)
        self.oHelper2.CheckResult("UB_ACRE", "30,00", grid=True, line=1)
        self.oHelper2.CheckResult("UB_VALACRE", "15,00", grid=True, line=1)

        self.oHelper2.LoadGrid()

        self.oHelper2.SetButton("Cancelar")
        self.oHelper2.SetButton("Sim")
        self.oHelper2.SetButton("X")

        self.oHelper2.AssertTrue()

        self.oHelper2.TearDown()

    def test_TMKA271_CT043(self):

        self.oHelper2.Start()

        self.oHelper2.Setup("SIGATMK", "26/05/2020", "T1", "D MG 01  ", "13")
        self.oHelper2.Program("TMKA271")
        self.oHelper2.WaitShow("Televendas")

        self.oHelper2.SetButton("Incluir")
        self.oHelper2.SetBranch("D MG 01")

        self.oHelper2.SetValue("UA_CLIENTE", "TMK001")
        self.oHelper2.SetValue("UA_LOJA", "01")
        self.oHelper2.SetValue("UA_TMK", "2 - Ativo")

        self.oHelper2.SetValue("UB_PRODUTO",
                               "TMK000000000000000000000000000",
                               grid=True)
        self.oHelper2.SetValue("UB_CF", "1101", grid=True)
        self.oHelper2.LoadGrid()

        self.oHelper2.CheckHelp(text_help="CFOINVALID", button="Fechar")
        self.oHelper2.SetKey("ESC")
        self.oHelper2.SetButton("Cancelar")
        self.oHelper2.SetButton("Sim")
        self.oHelper2.SetButton("X")

        self.oHelper2.AssertTrue()

        self.oHelper2.TearDown()

    def test_TMKA271_CT044(self):

        self.oHelper2.Start()
        self.oHelper2.Setup("SIGATMK", "24/06/2020", "T1", "D MG 01  ", "13")
        self.oHelper2.Program("TMKA271")
        self.oHelper2.WaitShow("Televendas")

        self.oHelper2.SetButton("Incluir")
        self.oHelper2.SetBranch("D MG 01")
        self.oHelper2.ClickFolder("TeleVendas")

        Atendimento = self.oHelper2.GetValue("Atendimento")

        self.oHelper2.SetValue("UA_CLIENTE", "TMC007")
        self.oHelper2.SetValue("UA_LOJA", "01")
        self.oHelper2.SetValue("UA_CODCONT", "TMC007")

        self.oHelper2.SetValue("UA_TABELA", "TMK")
        self.oHelper2.SetValue("UA_TMK", "2 - Ativo")
        self.oHelper2.SetValue("UA_OPER", "2 - Orcamento")

        self.oHelper2.SetValue("UB_PRODUTO",
                               "TMK000000000000000000000000012",
                               grid=True)
        self.oHelper2.SetValue("UB_QUANT", "10,00", grid=True)
        self.oHelper2.SetValue("UB_VALDESC", "100,00", grid=True)

        self.oHelper2.LoadGrid()

        self.oHelper2.SetButton("Salvar")
        self.oHelper2.SetButton("Cancelar")
        self.oHelper2.SetButton("Cancelar")
        self.oHelper2.SetButton("Sim")

        self.oHelper2.SearchBrowse(f"D MG 01 {Atendimento}",
                                   "Filial+atendimento")
        self.oHelper2.SetButton("Visualizar")

        self.oHelper2.WaitShow("Atendimento")

        self.oHelper2.CheckResult("UA_NUM", Atendimento)
        self.oHelper2.CheckResult("UA_CLIENTE", "TMC007")
        self.oHelper2.CheckResult("UA_LOJA", "01")

        self.oHelper2.CheckResult("UB_PRODUTO",
                                  "TMK000000000000000000000000012",
                                  grid=True)
        self.oHelper2.CheckResult("UB_QUANT", "10.00", grid=True)
        self.oHelper2.CheckResult("UB_VRUNIT", "90,00", grid=True)
        self.oHelper2.CheckResult("UB_VALDESC", "100,00", grid=True)

        self.oHelper2.LoadGrid()

        self.oHelper2.SetButton("Confirmar")

        self.oHelper2.AssertTrue()

        self.oHelper2.TearDown()

    @classmethod
    def tearDownClass(self):
        '''self.oHelper.TearDown()
class PLSA001A(unittest.TestCase):
    #-------------------------------------------
    # Inicialiação setUpClass para TIR - PLSA001A
    #-------------------------------------------
    @classmethod
    def setUpClass(self):
        # inst.oHelper = ApwInternal("config.json")
        # inst.oHelper.Setup()
        self.oHelper = Webapp(autostart=False)
        self.oHelper.SetTIRConfig(config_name="User", value="admin")
        self.oHelper.SetTIRConfig(config_name="Password", value="1234")
        self.oHelper.Start()
        self.oHelper.Setup("SIGAPLS", DateSystem, "T1", "M SP 01 ", "33")
        self.oHelper.Program('PLSA001A')
        self.oHelper.AddParameter("MV_PLCALPG", "", "2", "2", "2")
        self.oHelper.SetParameters()

    #-------------------------------------------
    # Inicio dos casos de testes TIR - PLSA001A
    #-------------------------------------------


# 	"""-------------------------------------------------------------------
# 	/*/{Protheus.doc} TEST_PLSA001A_PL001
# 	TIR - Casos de testes da rotina Reembolso
# 	Alteracao dos status do protocolo.

# 	@author r.soares
# 	@since 22/06/2020
# 	@version 12
# 	# -------------------------------------------------------------------"""

    def test_PLSA001A_PL001(self):
        chaveTit = "M SP    00012343000001013"

        self.oHelper.SearchBrowse(f'{chaveTit}', key=5, index=True)
        self.oHelper.SetButton('Alterar')
        self.oHelper.SetValue('BOW_STATUS', '1', check_value=False)
        self.oHelper.SetButton('Salvar')

        self.oHelper.SearchBrowse(f'{chaveTit}', key=5, index=True)
        self.oHelper.SetButton('Alterar')
        self.oHelper.SetValue('BOW_STATUS', '2', check_value=False)
        self.oHelper.SetButton('Salvar')

        self.oHelper.SearchBrowse(f'{chaveTit}', key=5, index=True)
        self.oHelper.SetButton('Alterar')
        self.oHelper.SetValue('BOW_STATUS', '3', check_value=False)
        self.oHelper.SetButton('Salvar')

        time.sleep(5)
        self.oHelper.SetButton('Cancelar')

        self.oHelper.AssertTrue()

    # """-------------------------------------------------------------------
    # /*/{Protheus.doc} TEST_PLSA001A_PL002
    # TIR - Casos de testes da rotina Reembolso
    # EXCLUINDO REEMBOLSO

    # @author r.soares
    # @since 27/08/2020
    # @version 12
    # # -------------------------------------------------------------------"""
    def test_PLSA001A_PL002(self):
        chaveTit = "M SP    00012343000001013"
        self.oHelper.SearchBrowse(f'{chaveTit}', key=5, index=True)
        self.oHelper.SetButton('Outras Ações', sub_item='Excluir')
        self.oHelper.SetButton('Confirmar')

        self.oHelper.AssertTrue()

    #-------------------------------------------
    # Fim dos casos de testes TIR - PLSA001A
    #-------------------------------------------

    #-------------------------------------------
    # Encerramento class para TIR - PLSA001A
    #-------------------------------------------
    @classmethod
    def tearDownClass(inst):
        inst.oHelper.TearDown()
class TMKA260(unittest.TestCase):
    @classmethod
    def setUpClass(self):

        self.oHelperA = Webapp(autostart=False)
        self.oHelperA.SetTIRConfig(config_name="User", value="teleatendimento")
        self.oHelperA.SetTIRConfig(config_name="Password", value="1")

        #self.oHelperC = Webapp(autostart=False)
        #self.oHelperC.SetTIRConfig(config_name="User", value="telecobranca")
        #self.oHelperC.SetTIRConfig(config_name="Password", value="1")

        #self.oHelperV = Webapp(autostart=False)
        #self.oHelperV.SetTIRConfig(config_name="User", value="televendas")
        #self.oHelperV.SetTIRConfig(config_name="Password", value="1")

        #self.oHelperM = Webapp(autostart=False)
        #self.oHelperM.SetTIRConfig(config_name="User", value="telemarketing")
        #self.oHelperM.SetTIRConfig(config_name="Password", value="1")

    def test_TMKA260_CT015(self):
        '''
		#GTSER-T52717 - CT015 - Prospects (Consulta Perfil)
		'''

        prospect = "FAT001"
        loja = "01"

        # Inicia o novo Webapp para logar com o User no Módulo
        self.oHelperA.Start()
        self.oHelperA.Setup("SIGATMK", "17/07/2020", "T1", "D MG 01  ", "13")
        self.oHelperA.Program("TMKA260")

        self.oHelperA.SearchBrowse(f"D MG    {prospect}{loja}",
                                   "Filial+codigo + loja")

        self.oHelperA.SetButton("Visualizar")

        self.oHelperA.WaitShow("Prospects - VISUALIZAR")
        self.oHelperA.SetButton("Outras Ações", "Perfil")

        self.oHelperA.WaitShow("Consulta dos ultimos")
        self.oHelperA.ClickLabel("A partir de")
        self.oHelperA.SetValue("dCorte", "01/01/2018", name_attr=True)

        self.oHelperA.SetButton("Financ.")
        self.oHelperA.SetValue("Da Emissão ?", "01/01/2018")
        self.oHelperA.SetValue("Até a Emissão ?", "31/12/2018")
        self.oHelperA.SetValue("Do Vencimento ?", "01/01/2018")
        self.oHelperA.SetValue("Até o Vencimento ?", "31/12/2018")
        self.oHelperA.SetValue("Considera Provisor. ?", "Sim")
        #self.oHelperA.SetValue("Do Prefixo ?","   ", check_value=False)
        self.oHelperA.SetValue("Até Prefixo ?", "ZZZ")
        self.oHelperA.SetValue("Considera Faturados ?", "Sim")
        self.oHelperA.SetValue("Considera Liquidados ?", "Sim")
        self.oHelperA.SetValue("Pedidos com Itens Bloqueados ?", "Nao")
        self.oHelperA.SetValue("Tit. Gerados por Liquidação ?", "Sim")
        self.oHelperA.SetValue("Considera Saldo ?", "Normal")
        self.oHelperA.SetValue("Considera Lojas ?", "Sim")
        self.oHelperA.SetValue("TES gera duplicata ?", "Todas")
        self.oHelperA.SetValue("Considera RA ?", "Nao")
        self.oHelperA.SetValue("Exibe dias a vencer ?", "Nao")
        self.oHelperA.SetValue("Seleciona Filiais ?", "Nao")
        self.oHelperA.SetButton("OK")

        self.oHelperA.SetButton("Ok")

        self.oHelperA.ClickTree("Perfil do Prospect > Empresa > Oportunidades")

        self.oHelperA.AssertTrue()

    @classmethod
    def tearDownClass(self):

        self.oHelperA.TearDown()
class PLSA090OD(unittest.TestCase):
	#-------------------------------------------
	# Inicialiação setUpClass para TIR - PLSA090OD 
	#-------------------------------------------
	@classmethod
	def setUpClass(self):
		# inst.oHelper = ApwInternal("config.json")		
		# inst.oHelper.Setup()
		self.oHelper = Webapp()
		self.oHelper.SetTIRConfig(config_name="User", value="admin")
		self.oHelper.SetTIRConfig(config_name="Password", value="1234")
		self.oHelper.Start()
		self.oHelper.Setup("SIGAPLS", DateSystem, "T1", "M SP 01 ", "33")
		self.oHelper.Program('PLSA094D')
		self.oHelper.AddParameter("MV_PLCALPG", "", "2", "2", "2")
		self.oHelper.SetParameters()

	#-------------------------------------------
	# Inicio dos casos de testes TIR - PLSA090OD 
	#-------------------------------------------

# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL001
	# TIR - Casos de testes da rotina Odontologica 
	# Incluindo guia

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# # # -------------------------------------------------------------------
	def test_PLSA090OD_PL001(self):
		
		self.oHelper.WaitShow("Liberação Odontológica") 
		self.oHelper.SetButton('Incluir')
		self.oHelper.SetBranch("M SP 01")
		time.sleep(3)
		self.oHelper.SetValue('B01_USUARI', '00010020000001014')
		# self.oHelper.SetButton('Ok')
		# self.oHelper.SetButton('Gerar Protoc.')
		# self.oHelper.SetButton('Confirmar')
		self.oHelper.SetButton('Outras Ações',sub_item='Limpa')
		self.oHelper.SetButton('Sim')
		self.oHelper.SetValue('B01_USUARI', '00010020000001014')
		self.oHelper.SetValue('B01_CODRDA', '000004')
		self.oHelper.SetButton('Outras Ações',sub_item='Financ')
		self.oHelper.SetButton('Fechar')
		self.oHelper.SetButton('Outras Ações',sub_item='Cliente')
		self.oHelper.SetButton('Confirmar')
		self.oHelper.SetButton('Outras Ações',sub_item='Cobranca')
		self.oHelper.SetValue('Ano Base ?', '2020')
		self.oHelper.SetValue('Mes Base ?', '06')
		self.oHelper.SetButton('Ok')
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetValue('B01_CID', 'F12')
		self.oHelper.SetValue('B01_REGSOL', '1234')
		self.oHelper.ClickGridCell("Cd. Proc.")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetValue("BE2_CODPAD", "03", name_attr=True)
		self.oHelper.SetValue("BE2_CODPRO", "0001", name_attr=True)
		self.oHelper.SetValue("BE2_DENREG", "11", name_attr=True)
		self.oHelper.SetValue("BE2_FADENT", "D", name_attr=True)
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		time.sleep(10)
		self.oHelper.SetButton('Ok')

		time.sleep(5)
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL002
	# TIR - Casos de testes da rotina Odontologica 
	# Incluindo interacao na guia

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# # -------------------------------------------------------------------
	def test_PLSA090OD_PL002(self):

		chaveTit = "M SP    00010020000001"


		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)

		self.oHelper.SetButton('Outras Ações',sub_item='Excluir')
		self.oHelper.SetButton('Confirmar')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL003
	# TIR - Casos de testes da rotina Odontologica 
	# Excluindo uma guia PLSA090OD

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# # -------------------------------------------------------------------
	def test_PLSA090OD_PL003(self):

		chaveTit = "M SP    00010020000001"

		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)

		self.oHelper.SetButton('Outras Ações',sub_item='Interação')
		self.oHelper.SetBranch('M SP 01')
		self.oHelper.ClickGridCell("Cod. Tab. Pd")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetValue('Motivo Padrão', '001')
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Fechar')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL004
	# TIR - Casos de testes da rotina Odontologica 
	# Visualizando uma guia PLSA090OD

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------
	def test_PLSA090OD_PL004(self):
			
		chaveTit = "M SP    00010020000001"

		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)

		self.oHelper.SetButton('Visualizar')
		self.oHelper.CheckResult('B01_USUARI', '00010020000001014')
		self.oHelper.SetButton('Confirmar')
		
		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL005
	# TIR - Casos de testes da rotina Odontologica 
	# Imprimindo guia da rotina PLSA090OD

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------
	def test_PLSA090OD_PL005(self):
		
		chaveTit = "M SP    00010020000001"

		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)
		
		self.oHelper.SetButton('Outras Ações',sub_item='Imp.Guia')
		self.oHelper.SetButton('Ok')
		time.sleep(3)
		self.oHelper.SetButton('Ok')
		time.sleep(3)
		self.oHelper.SetButton('Ok')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL006
	# TIR - Casos de testes da rotina Odontologica 
	# Imprimindo varias guias da rotina PLSA090OD

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------
	def test_PLSA090OD_PL006(self):


		chaveTit = "M SP    00010020000001"

		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)
		
		self.oHelper.SetButton('Outras Ações',sub_item='Imp.Varias Guias')
		self.oHelper.SetButton('Ok')
		time.sleep(3)
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL007
	# TIR - Casos de testes da rotina Odontologica 
	# Adicionando valor no campo de conhecimento

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------
	def test_PLSA090OD_PL007(self):

		chaveTit = "M SP    00010020000001"
		
		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)
		self.oHelper.SetButton('Outras Ações',sub_item='Conhecimento, Guia')
		time.sleep(3)
		self.oHelper.ClickGridCell("Objeto")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetKey("F3", grid=True)
		self.oHelper.SetButton('Ok')
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Outras Ações',sub_item='Conhecimento, Item')
		time.sleep(3)
		self.oHelper.SetButton('Pesquisar')
		self.oHelper.SetButton('Ok')
		self.oHelper.SetButton('Conhecimento')
		self.oHelper.ClickGridCell("Objeto")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetKey("F3", grid=True)
		self.oHelper.SetButton('Ok')
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Sair')
		
		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL008
	# TIR - Casos de testes da rotina Odontologica 
	# Copia

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------
	def test_PLSA090OD_PL008(self):

		chaveTit = "M SP    00010020000001"

		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)
		self.oHelper.SetButton('Outras Ações',sub_item='Copiar')
		self.oHelper.SetBranch("M SP 01")
		self.oHelper.SetValue('B01_USUARI', '00010020000001014')
		self.oHelper.SetValue('B01_CID', 'F12')
		self.oHelper.SetValue('B01_REGSOL', '1234')
		self.oHelper.ClickGridCell("Cd. Proc.")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetValue("BE2_QTDPRO", "1,0000", name_attr=True)
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		time.sleep(10)
		self.oHelper.SetButton('Ok')
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL009
	# TIR - Casos de testes da rotina Odontologica 
	# Cancelando guia do plsa090od

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------
	def test_PLSA090OD_PL009(self):

		chaveTit = "M SP    00010020000001"

		self.oHelper.WaitShow("Liberação Odontológica") 
		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)
		
		self.oHelper.SetButton('Outras Ações',sub_item='Cancelar Guia')
		time.sleep(3)
		self.oHelper.SetKey("F3")
		self.oHelper.SetButton('OK')
		self.oHelper.SetButton('Confirma')
		self.oHelper.SetButton('Sim')
		self.oHelper.SetButton('Fechar')
		
		self.oHelper.AssertTrue()
		
# # -------------------------------------------------------------------
# 	# /*/{Protheus.doc} TEST_PLSA090OD_PL010
# 	# TIR - Casos de testes da rotina Odontologica 
# 	# Incluindo guia com pagamento na fatura sem a guia comprada

# 	# @author r.soares
# 	# @since 27/05/2020
# 	# @version 12
# 	# # # -------------------------------------------------------------------
	def test_PLSA090OD_PL010(self):
		

		self.oHelper.SetButton('Incluir')
		self.oHelper.SetBranch("M SP 01")
		time.sleep(3)
		self.oHelper.SetValue('B01_USUARI', '00010020000001014')
		self.oHelper.SetValue('B01_CID', 'F12')
		self.oHelper.SetValue('B01_SIGLA', 'CRM')
		self.oHelper.SetValue('B01_ESTSOL', 'SP')
		self.oHelper.SetValue('B01_REGSOL', '1234')
		self.oHelper.SetValue('B01_QUACOB', '2')
		self.oHelper.SetKey('Enter')
		self.oHelper.ClickGridCell("Cd. Proc.")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetValue("BE2_CODPAD", "03", name_attr=True)
		self.oHelper.SetValue("BE2_CODPRO", "81000030", name_attr=True)
		self.oHelper.SetValue("BE2_GUIACO", "0", name_attr=True)
		self.oHelper.SetValue("BE2_QUACOB", "2", name_attr=True)
		self.oHelper.SetValue("BE2_DENREG", "11", name_attr=True)
		self.oHelper.SetValue("BE2_FADENT", "D", name_attr=True)
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		time.sleep(10)
		self.oHelper.SetButton('Ok')
		
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL011
	# TIR - Casos de testes da rotina Odontologica 
	# Incluindo guia com pagamento na fatura com a guia comprada

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# # # -------------------------------------------------------------------
	def test_PLSA090OD_PL011(self):

		self.oHelper.SetButton('Incluir')
		self.oHelper.SetBranch("M SP 01")
		time.sleep(3)
		self.oHelper.SetValue('B01_USUARI', '00010020000001014')
		self.oHelper.SetValue('B01_CID', 'F12')
		self.oHelper.SetValue('B01_SIGLA', 'CRM')
		self.oHelper.SetValue('B01_ESTSOL', 'SP')
		self.oHelper.SetValue('B01_REGSOL', '1234')
		self.oHelper.SetValue('B01_QUACOB', '2')
		self.oHelper.SetKey('Enter')
		self.oHelper.ClickGridCell("Cd. Proc.")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetValue("BE2_CODPAD", "03", name_attr=True)
		self.oHelper.SetValue("BE2_CODPRO", "82000026", name_attr=True)
		self.oHelper.SetValue("BE2_GUIACO", "1", name_attr=True)
		self.oHelper.SetValue("BE2_QUACOB", "2", name_attr=True)
		self.oHelper.SetValue("BE2_DENREG", "11", name_attr=True)
		self.oHelper.SetValue("BE2_FADENT", "D", name_attr=True)
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Outras Ações',sub_item='Comprar')
		self.oHelper.SetButton('Fechar', check_error= False)
		self.oHelper.SetButton('Outras Ações',sub_item='Co-Part.')
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		time.sleep(10)
		self.oHelper.SetButton('Ok')
		
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
		
		# -------------------------------------------------------------------
		# /*/{Protheus.doc} TEST_PLSA090OD_PL012
		# TIR - Casos de testes da rotina Odontologica 
		# Incluindo guia com pagamento no ato sem a guia estar comprada

		# @author r.soares
		# @since 27/05/2020
		# @version 12
		# # # -------------------------------------------------------------------
	def test_PLSA090OD_PL012(self):

		self.oHelper.SetButton('Incluir')
		self.oHelper.SetBranch("M SP 01")
		time.sleep(3)
		self.oHelper.SetValue('B01_USUARI', '00010020000001014')
		self.oHelper.SetValue('B01_CID', 'F12')
		self.oHelper.SetValue('B01_SIGLA', 'CRM')
		self.oHelper.SetValue('B01_ESTSOL', 'SP')
		self.oHelper.SetValue('B01_REGSOL', '1234')
		self.oHelper.SetValue('B01_QUACOB', '1')
		self.oHelper.SetKey('Enter')
		self.oHelper.ClickGridCell("Cd. Proc.")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetValue("BE2_CODPAD", "03", name_attr=True)
		self.oHelper.SetValue("BE2_CODPRO", "82000026", name_attr=True)
		self.oHelper.SetValue("BE2_GUIACO", "0", name_attr=True)
		self.oHelper.SetValue("BE2_QUACOB", "2", name_attr=True)
		self.oHelper.SetValue("BE2_DENREG", "11", name_attr=True)
		self.oHelper.SetValue("BE2_FADENT", "D", name_attr=True)
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		time.sleep(10)
		self.oHelper.SetButton('Ok')
		
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL013
	# TIR - Casos de testes da rotina Odontologica 
	# Incluindo guia com pagamento no ato com a guia comprada

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------
	def test_PLSA090OD_PL013(self):

		self.oHelper.SetButton('Incluir')
		self.oHelper.SetBranch("M SP 01")
		time.sleep(3)
		self.oHelper.SetValue('B01_USUARI', '00010020000001014')
		self.oHelper.SetValue('B01_CODRDA', '000001')
		self.oHelper.SetValue('B01_CID', 'F12')
		self.oHelper.SetValue('B01_SIGLA', 'CRM')
		self.oHelper.SetValue('B01_ESTSOL', 'SP')
		self.oHelper.SetValue('B01_REGSOL', '1234')
		self.oHelper.SetValue('B01_QUACOB', '1')
		self.oHelper.SetKey('Enter')
		self.oHelper.ClickGridCell("Cd. Proc.")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetValue("BE2_CODPAD", "03", name_attr=True)
		self.oHelper.SetValue("BE2_CODPRO", "0001", name_attr=True)
		self.oHelper.SetValue("BE2_GUIACO", "1", name_attr=True)
		self.oHelper.SetValue("BE2_QUACOB", "1", name_attr=True)
		self.oHelper.SetValue("BE2_DENREG", "11", name_attr=True)
		self.oHelper.SetValue("BE2_FADENT", "D", name_attr=True)
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		time.sleep(10)
		self.oHelper.SetButton('Ok')
		time.sleep(2)
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL014
	# TIR - Casos de testes da rotina Odontologica 
	# Inclusao da rotina de autorizacao Odontologica com refer�ncia na libera��o odonto

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------

	def test_PLSA090OD_PL014(self):

		self.oHelper.Start()
		self.oHelper.Setup("SIGAPLS", DateSystem, "T1", "M SP 01 ", "33")
		self.oHelper.Program('PLSA094C')
		self.oHelper.WaitShow("Autorização Odontológica") 
		self.oHelper.SetButton('Incluir')
		self.oHelper.SetBranch("M SP 01")
		time.sleep(3)
		self.oHelper.SetValue('B01_NUMLIB', '000120200900000006', grid=False, grid_number=1, ignore_case=True,row=None, name_attr=False, check_value=False)	
		self.oHelper.SetValue('B01_CODRDA', '000001')
		self.oHelper.SetValue('B01_CID', 'F12')
		self.oHelper.SetValue('B01_REGSOL', '1234')
		self.oHelper.ClickGridCell("Cd. Proc.")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetValue("BE2_CODPAD", "03", name_attr=True)
		self.oHelper.SetValue("BE2_CODPRO", "82000026", name_attr=True)
		self.oHelper.SetValue("BE2_DENREG", "11", name_attr=True)
		self.oHelper.SetValue("BE2_FADENT", "D", name_attr=True)
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		time.sleep(10)
		self.oHelper.SetButton('Ok')

		time.sleep(5)
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
		
	# -------------------------------------------------------------------
	# /*/{Protheus.doc} TEST_PLSA090OD_PL015
	# TIR - Casos de testes da rotina Odontologica 
	# Copia da rotina de autorizacao Odontologica

	# @author r.soares
	# @since 27/05/2020
	# @version 12
	# -------------------------------------------------------------------

	def test_PLSA090OD_PL015(self):

		# self.oHelper.WaitShow("Autorização Odontológica") 

		chaveTit = "M SP    00010020000001"
		self.oHelper.SearchBrowse(f'{chaveTit}', key=2, index=True)
		
		self.oHelper.SetButton('Outras Ações',sub_item='Copiar')
		self.oHelper.SetBranch("M SP 01")
		self.oHelper.SetValue('B01_USUARI', '00010020000001014')
		self.oHelper.SetValue('B01_CODRDA', '000001')
		self.oHelper.SetValue('B01_CID', 'F12')
		self.oHelper.SetValue('B01_REGSOL', '1234')
		self.oHelper.ClickGridCell("Cd. Proc.")
		self.oHelper.SetKey("ENTER", grid=True)
		self.oHelper.SetButton('Salvar')
		self.oHelper.SetButton('Salvar')
		time.sleep(10)
		self.oHelper.SetButton('Ok')
		self.oHelper.SetButton('Cancelar')

		self.oHelper.AssertTrue()
	
	#-------------------------------------------
	# Fim dos casos de testes TIR - PLSA090OD 
	#-------------------------------------------

	#-------------------------------------------
	# Encerramento class para TIR - PLSA090OD 
	#-------------------------------------------
	@classmethod
	def tearDownClass(inst):
		inst.oHelper.TearDown()
class PLSA260(unittest.TestCase):
    #-------------------------------------------
    # Inicialiação setUpClass para TIR - PLSA260
    #-------------------------------------------
    @classmethod
    def setUpClass(self):
        # inst.oHelper = ApwInternal("config.json")
        # inst.oHelper.Setup()
        self.oHelper = Webapp()
        self.oHelper.SetTIRConfig(config_name="User", value="admin")
        self.oHelper.SetTIRConfig(config_name="Password", value="1234")
        self.oHelper.Start()
        self.oHelper.Setup("SIGAPLS", DateSystem, "T1", "M SP 01 ", "33")
        self.oHelper.Program('PLSA174')

    #-------------------------------------------
    # Inicio dos casos de testes TIR - PLSA260
    #-------------------------------------------

# -------------------------------------------------------------------
# /*/{Protheus.doc} TEST_PLSA260_PL001
# TIR - Casos de testes da rotina Grupo Familiar
# Incluindo Beneficiário

# @author v.alves
# @since 27/05/2020
# @version 12
# # # -------------------------------------------------------------------

    def test_PLSA260_PL001(self):

        #Dados para teste
        cpf = '71289920818'
        cdPlan = '0007'
        vers = '001'

        self.oHelper.SetValue('Tipo ?', 'Pessoa Juridica')
        self.oHelper.SetButton('Ok')
        self.oHelper.SetButton('Selecionar')
        self.oHelper.SetBranch("M SP 01")
        self.oHelper.SetButton('Incluir')
        self.oHelper.SetBranch("M SP 01")
        self.oHelper.ClickFolder('Dados do Plano')
        self.oHelper.SetValue('BA3_CODPLA', cdPlan)
        self.oHelper.SetValue('BA3_VERSAO', vers)
        self.oHelper.ClickFolder('Cobranca')
        self.oHelper.SetValue('BA3_COBNIV', '1 - Sim')
        self.oHelper.SetValue('BA3_VENCTO', '15')
        self.oHelper.SetKey('F5')
        self.oHelper.SetValue('BA1_CPFUSR', cpf)
        self.oHelper.SetValue('BA1_DATINC', DateSystem)
        self.oHelper.SetValue('BA1_DATCAR', DateSystem)
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Fechar')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Cancelar')
        self.oHelper.SetButton('Sim')
        self.oHelper.SetButton('X')
        self.oHelper.SetButton('X')
        self.oHelper.AssertTrue()

    # -------------------------------------------------------------------
    # /*/{Protheus.doc} TEST_PLSA260_PL002
    # TIR - Casos de testes da rotina Grupo Familiar
    # Incluindo Beneficiário no tipo de pessoa Física

    # @author r.soares
    # @since 12/11/2020
    # @version 12
    # # # -------------------------------------------------------------------
    def test_PLSA260_PL002(self):

        cpf = '71289920818'
        cdPlan = '0007'
        vers = '001'
        vcto = '15'
        codCli = '000001'
        nature = '001'
        chave = "M SP    00010022"

        self.oHelper.Program('PLSA174')

        #Dados para teste
        self.oHelper.SetValue('Tipo ?', 'Pessoa Fisica')
        self.oHelper.SetButton('Ok')

        self.oHelper.SearchBrowse(f'{chave}', key=1, index=True)
        self.oHelper.SetButton('Selecionar')
        self.oHelper.SetBranch("M SP 01")
        self.oHelper.SetButton('Incluir')
        self.oHelper.SetBranch("M SP 01")
        self.oHelper.ClickFolder('Dados do Plano')
        self.oHelper.SetValue('BA3_CODPLA', cdPlan)
        self.oHelper.SetValue('BA3_VERSAO', vers)
        self.oHelper.ClickFolder('Cobranca')
        self.oHelper.SetValue('BA3_VENCTO', vcto)
        self.oHelper.SetValue('BA3_CODCLI', codCli)
        self.oHelper.SetValue('BA3_NATURE', nature)
        self.oHelper.SetKey('F5')
        self.oHelper.SetValue('BA1_CPFUSR', cpf)
        self.oHelper.SetValue('BA1_DATINC', DateSystem)
        self.oHelper.SetValue('BA1_DATCAR', DateSystem)
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Fechar')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Cancelar')
        self.oHelper.SetButton('Sim')
        self.oHelper.AssertTrue()

    #//-------------------------------------------------------------------
# {Protheus.doc} test_PLSA260_PL003

# Teste 03 - Bloqueio de Família

# @author r.soares
# @since 12/11/2020
# @version 12
# @see
#//-------------------------------------------------------------------

    def test_PLSA260_PL003(self):

        # Dados para o teste
        chave = "M SP    71289920818"
        chaveDep = 'M SP    07483982012'

        # Busca do Dependente

        self.oHelper.SearchBrowse(f'{chaveDep}', key=4, index=True)
        self.oHelper.SetButton('Visualizar')
        self.oHelper.CheckResult('BA3_CODEMP', '0022')
        self.oHelper.SetButton('Confirmar')

        #Bloqueando o Dependente
        self.oHelper.SetButton('Outras Ações', sub_item='(Des)Bloqu. Benef.')
        self.oHelper.SetValue('BCA_DATA', DateSystem)
        self.oHelper.F3(field='BCA_MOTBLO')
        self.oHelper.SetButton('Ok')
        self.oHelper.SetButton('Salvar')

        #Desbloqueando o Dependente
        self.oHelper.SetButton('Outras Ações', sub_item='(Des)Bloqu. Benef.')
        self.oHelper.SetValue('BCA_DATA', DateSystem)
        self.oHelper.F3(field='BCA_MOTBLO')
        self.oHelper.SetButton('Ok')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Sim')
        self.oHelper.SetButton('Ok')

        # Busca do titular

        self.oHelper.SearchBrowse(f'{chave}', key=4, index=True)
        self.oHelper.SetButton('Visualizar')
        self.oHelper.CheckResult('BA3_CODEMP', '0022')
        self.oHelper.SetButton('Confirmar')

        self.oHelper.SetButton('Outras Ações', sub_item='Valor Cobranca')
        self.oHelper.SetValue('Ano Base ?', '2020')
        self.oHelper.SetValue('Mes Base ?', '11')
        self.oHelper.SetButton('Ok')
        self.oHelper.SetButton('Confirmar')

        #Bloqueando a Família
        self.oHelper.SetButton('Outras Ações', sub_item='(Des)Bloqu. Fam')
        self.oHelper.SetButton('Sim')
        self.oHelper.SetValue('BC3_DATA', DateSystem)
        self.oHelper.F3(field='BC3_MOTBLO')
        self.oHelper.SetButton('Ok')
        self.oHelper.SetButton('Salvar')

        #Desbloqueando a família
        self.oHelper.SetButton('Outras Ações', sub_item='(Des)Bloqu. Fam')
        self.oHelper.SetValue('BC3_DATA', DateSystem)
        self.oHelper.F3(field='BC3_MOTBLO')
        self.oHelper.SetButton('Ok')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Sim')

        self.oHelper.AssertTrue()

    #//-------------------------------------------------------------------

# {Protheus.doc} test_PLSA260_PL004

# Teste 04 - Incluindo os demais dados dos folders do grupo familiar

# @author r.soares
# @since 12/11/2020
# @version 12
# @see
#//-------------------------------------------------------------------

    def test_PLSA260_PL004(self):

        # Dados para o teste
        chave = "M SP    71289920818"

        self.oHelper.SearchBrowse(f'{chave}', key=4, index=True)
        self.oHelper.SetButton('Alterar')
        self.oHelper.ClickFolder('Comercial')
        self.oHelper.F3(field='BA3_EQUIPE')
        self.oHelper.SetButton('OK')
        self.oHelper.ClickFolder('Opcional')
        self.oHelper.ClickGridCell("Versao")
        self.oHelper.SetKey("ENTER", grid=True)
        self.oHelper.F3(field='BF1_CODPRO')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetValue('BF1_DATBAS', DateSystem)
        self.oHelper.SetButton('Salvar')
        self.oHelper.ClickGridCell("Forma Cobr.", grid_number=2)
        self.oHelper.SetKey("ENTER", grid=True)
        self.oHelper.F3(field='BK0_CODFOR')
        self.oHelper.SetButton('OK')
        self.oHelper.SetButton('Salvar')
        self.oHelper.ClickFolder('Gratuidade')
        self.oHelper.ClickGridCell("Cod Gratuid.")
        self.oHelper.SetKey("ENTER", grid=True)
        self.oHelper.F3(field='BH5_CODGRA')
        self.oHelper.SetButton('Ok')
        self.oHelper.SetValue('BH5_ANOINI', str(Ano))
        self.oHelper.SetValue('BH5_MESINI', str(Mes))
        self.oHelper.SetValue('BH5_ANOFIM', str(Ano))
        self.oHelper.SetValue('BH5_MESFIM', str(Mes))
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Salvar')
        self.oHelper.SetButton('Fechar')
        self.oHelper.SetButton('Salvar')

        self.oHelper.AssertTrue()

    #-------------------------------------------
    # Fim dos casos de testes TIR - PLSA260
    #-------------------------------------------

    #-------------------------------------------
    # Encerramento class para TIR - PLSA260
    #-------------------------------------------
    @classmethod
    def tearDownClass(inst):
        inst.oHelper.TearDown()