forked from pengovbr/mod-sei-pen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adicionado metodo na classe PaginaProcesso; adicionado teste pr…
…a validar botoes do tramite em bloco (super)
- Loading branch information
Paul Richard Pereira Martins dos Anjos
committed
Sep 30, 2024
1 parent
8efca61
commit 82151ec
Showing
3 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
tests_super/funcional/tests/TramiteProcessoValidacaoBotaoIncluirTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?php | ||
|
||
/** | ||
* | ||
* Execution Groups | ||
* @group execute_parallel_group1 | ||
*/ | ||
class TramiteProcessoValidacaoBotaoIncluirTest extends FixtureCenarioBaseTestCase | ||
{ | ||
public static $remetente; | ||
public static $destinatario; | ||
public static $processoTeste; | ||
public static $documentoTeste; | ||
public static $protocoloTeste; | ||
|
||
/** | ||
* | ||
* @Depends TramiteProcessoGrandeTest::tearDownAfterClass | ||
* | ||
* @return void | ||
*/ | ||
public static function setUpBeforeClass() :void { | ||
|
||
// Altera status de qualquer Bloco aberto | ||
$bancoOrgaoA = new DatabaseUtils(CONTEXTO_ORGAO_A); | ||
$bancoOrgaoA->execute("update md_pen_bloco set sta_estado=? where sta_estado=?;", array('C', 'A')); | ||
|
||
// Limpa os mapeamentos de unidade | ||
$bancoOrgaoA->execute("delete from md_pen_unidade;", array()); | ||
} | ||
|
||
public static function tearDownAfterClass() :void { | ||
|
||
// Recadastra os mapeamentos da unidade | ||
putenv("DATABASE_HOST=org1-database"); | ||
$penMapUnidadesFixture = new \PenMapUnidadesFixture(); | ||
$penMapUnidadesFixture->carregar([ | ||
'Id' => CONTEXTO_ORGAO_A_ID_ESTRUTURA, | ||
'Sigla' => CONTEXTO_ORGAO_A_SIGLA_ESTRUTURA, | ||
'Nome' => CONTEXTO_ORGAO_A_NOME_UNIDADE, | ||
]); | ||
|
||
$bancoOrgaoA = new DatabaseUtils(CONTEXTO_ORGAO_A); | ||
$bancoOrgaoA->execute("insert into md_pen_unidade(id_unidade, id_unidade_rh) values (?, ?)", array('110000002', CONTEXTO_ORGAO_A_ID_ESTRUTURA_SECUNDARIA)); | ||
} | ||
|
||
/** | ||
* Teste de trâmite externo de processo com restrição de acesso | ||
* | ||
* @group envio | ||
* @large | ||
* | ||
* | ||
* @return void | ||
*/ | ||
public function test_tramitar_processo_restrito() | ||
{ | ||
// Configuração do dados para teste do cenário | ||
self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_A); | ||
self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); | ||
self::$documentoTeste = $this->gerarDadosDocumentoInternoTeste(self::$remetente); | ||
|
||
// Cadastrar novo processo de teste | ||
$objProtocoloDTO = $this->cadastrarProcessoFixture(self::$processoTeste); | ||
self::$protocoloTeste = $objProtocoloDTO->getStrProtocoloFormatado(); | ||
|
||
// Incluir e assinar documento no processo | ||
$this->cadastrarDocumentoInternoFixture(self::$documentoTeste, $objProtocoloDTO->getDblIdProtocolo()); | ||
|
||
// Acessar sistema do this->REMETENTE do processo | ||
$this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); | ||
|
||
// Abrir processo | ||
$this->abrirProcesso(self::$protocoloTeste); | ||
|
||
$this->assertNotTrue($this->paginaProcesso->validarBotaoExiste(utf8_encode("Incluir Processo no Bloco de Trâmite"))); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
tests_super/funcional/tests/TramiteProcessoValidacaoBotoesAposIncluirTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
/** | ||
* | ||
* Execution Groups | ||
* @group execute_parallel_group1 | ||
*/ | ||
class TramiteProcessoValidacaoBotoesAposIncluirTest extends FixtureCenarioBaseTestCase | ||
{ | ||
public static $remetente; | ||
public static $destinatario; | ||
public static $processoTeste; | ||
public static $documentoTeste; | ||
public static $protocoloTeste; | ||
|
||
/** | ||
* Teste de validar existencia do botão de remover processo do bloco | ||
* | ||
* @group envio | ||
* @large | ||
* | ||
* @return void | ||
*/ | ||
public function test_validar_existencia_botao_remover_do_bloco() | ||
{ | ||
// Configuração do dados para teste do cenário | ||
self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_A); | ||
self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente); | ||
self::$documentoTeste = $this->gerarDadosDocumentoInternoTeste(self::$remetente); | ||
|
||
// Cadastrar novo processo de teste | ||
$objProtocoloDTO = $this->cadastrarProcessoFixture(self::$processoTeste); | ||
self::$protocoloTeste = $objProtocoloDTO->getStrProtocoloFormatado(); | ||
|
||
// Incluir e assinar documento no processo | ||
$this->cadastrarDocumentoInternoFixture(self::$documentoTeste, $objProtocoloDTO->getDblIdProtocolo()); | ||
|
||
$objBlocoDeTramiteFixture = new \BlocoDeTramiteFixture(); | ||
$objBlocoDeTramiteDTO = $objBlocoDeTramiteFixture->carregar(); | ||
|
||
$objBlocoDeTramiteProtocoloFixture = new \BlocoDeTramiteProtocoloFixture(); | ||
$objBlocoDeTramiteProtocoloFixtureDTO = $objBlocoDeTramiteProtocoloFixture->carregar([ | ||
'IdProtocolo' => $objProtocoloDTO->getDblIdProtocolo(), | ||
'IdBloco' => $objBlocoDeTramiteDTO->getNumId() | ||
]); | ||
|
||
// Acessar sistema do this->REMETENTE do processo | ||
$this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']); | ||
|
||
// Abrir processo | ||
$this->abrirProcesso(self::$protocoloTeste); | ||
|
||
$this->assertNotTrue($this->paginaProcesso->validarBotaoExiste("Envio Externo de Processo")); | ||
$this->assertNotTrue($this->paginaProcesso->validarBotaoExiste(utf8_encode("Incluir Processo no Bloco de Trâmite"))); | ||
$this->assertTrue($this->paginaProcesso->validarBotaoExiste(utf8_encode("Remover Processo do Bloco de Trâmite"))); | ||
} | ||
} |