Skip to content

Commit

Permalink
feat: criado teste que valida o status dos andamentos do processo no …
Browse files Browse the repository at this point in the history
…bloco (super)
  • Loading branch information
Paul Richard Pereira Martins dos Anjos committed Oct 2, 2024
1 parent aabe66e commit 1284cd2
Showing 1 changed file with 107 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?php

use Tests\Funcional\Sei\Fixtures\{ProtocoloFixture,ProcedimentoFixture,AtividadeFixture,ContatoFixture,ParticipanteFixture,RelProtocoloAssuntoFixture,AtributoAndamentoFixture,DocumentoFixture,AssinaturaFixture,AnexoFixture,AnexoProcessoFixture};

/**
*
* Execution Groups
* @group execute_parallel_group1
*/
class TramiteBlocoDeTramiteSituacaoProcessoTest extends FixtureCenarioBaseTestCase
{
public static $remetente;
public static $processoTeste;

/**
* Teste pra validar mensagem de documento não assinado ao ser inserido em bloco
*
* @group envio
* @large
*
* @return void
*/
public function test_validar_situacao_do_processo_no_bloco()
{
self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_A);
self::$processoTeste = $this->gerarDadosProcessoTeste(self::$remetente);

// Cadastrar novo processo de teste
$objProtocoloDTO = $this->cadastrarProcessoFixture(self::$processoTeste);

$objBlocoDeTramiteFixture = new \BlocoDeTramiteFixture();
$objBlocoDeTramiteDTO = $objBlocoDeTramiteFixture->carregar();

$objBlocoDeTramiteProtocoloFixture = new \BlocoDeTramiteProtocoloFixture();
$objBlocoDeTramiteProtocoloFixtureDTO = $objBlocoDeTramiteProtocoloFixture->carregar([
'IdProtocolo' => $objProtocoloDTO->getDblIdProtocolo(),
'IdBloco' => $objBlocoDeTramiteDTO->getNumId()
]);

$bancoOrgaoA = new DatabaseUtils(CONTEXTO_ORGAO_A);
$bancoOrgaoA->execute("update md_pen_bloco_processo set id_andamento=? where id_protocolo=?;", array(1, $objProtocoloDTO->getDblIdProtocolo()));

$this->acessarSistema(self::$remetente['URL'], self::$remetente['SIGLA_UNIDADE'], self::$remetente['LOGIN'], self::$remetente['SENHA']);

$this->paginaCadastrarProcessoEmBloco->navegarListagemBlocoDeTramite();
$this->paginaCadastrarProcessoEmBloco->bntVisualizarProcessos();

$this->waitUntil(function ($testCase) {
sleep(2);
$testCase->refresh();
$situacaoTr = $testCase->elements($testCase->using('xpath')->value('//table[@id="tblBlocos"]/tbody/tr[1]/td[7]//img[@title="Aguardando Processamento"]'));
$this->assertEquals(1, count($situacaoTr));
return true;
}, PEN_WAIT_TIMEOUT);

$bancoOrgaoA->execute("update md_pen_bloco_processo set id_andamento=? where id_protocolo=?;", array(2, $objProtocoloDTO->getDblIdProtocolo()));

$this->waitUntil(function ($testCase) {
sleep(2);
$testCase->refresh();
$situacaoTr = $testCase->elements($testCase->using('xpath')->value('//table[@id="tblBlocos"]/tbody/tr[1]/td[7]//img[@title="Aguardando Processamento"]'));
$this->assertEquals(1, count($situacaoTr));
return true;
}, PEN_WAIT_TIMEOUT);

$bancoOrgaoA->execute("update md_pen_bloco_processo set id_andamento=? where id_protocolo=?;", array(3, $objProtocoloDTO->getDblIdProtocolo()));

$this->waitUntil(function ($testCase) {
sleep(2);
$testCase->refresh();
$situacaoTr = $testCase->elements($testCase->using('xpath')->value('//table[@id="tblBlocos"]/tbody/tr[1]/td[7]//img[@title="Aguardando Processamento"]'));
$this->assertEquals(1, count($situacaoTr));
return true;
}, PEN_WAIT_TIMEOUT);

$bancoOrgaoA->execute("update md_pen_bloco_processo set id_andamento=? where id_protocolo=?;", array(4, $objProtocoloDTO->getDblIdProtocolo()));

$this->waitUntil(function ($testCase) {
sleep(2);
$testCase->refresh();
$situacaoTr = $testCase->elements($testCase->using('xpath')->value('//table[@id="tblBlocos"]/tbody/tr[1]/td[7]//img[@title="Aguardando Processamento"]'));
$this->assertEquals(1, count($situacaoTr));
return true;
}, PEN_WAIT_TIMEOUT);

$bancoOrgaoA->execute("update md_pen_bloco_processo set id_andamento=? where id_protocolo=?;", array(5, $objProtocoloDTO->getDblIdProtocolo()));

$this->waitUntil(function ($testCase) {
sleep(2);
$testCase->refresh();
$situacaoTr = $testCase->elements($testCase->using('xpath')->value('//table[@id="tblBlocos"]/tbody/tr[1]/td[7]//img[@title="Aguardando Processamento"]'));
$this->assertEquals(1, count($situacaoTr));
return true;
}, PEN_WAIT_TIMEOUT);

$bancoOrgaoA->execute("update md_pen_bloco_processo set id_andamento=? where id_protocolo=?;", array(8, $objProtocoloDTO->getDblIdProtocolo()));

$this->waitUntil(function ($testCase) {
sleep(2);
$testCase->refresh();
$situacaoTr = $testCase->elements($testCase->using('xpath')->value('//table[@id="tblBlocos"]/tbody/tr[1]/td[7]//img[@title="Aguardando Processamento"]'));
$this->assertEquals(1, count($situacaoTr));
return true;
}, PEN_WAIT_TIMEOUT);
}

}

0 comments on commit 1284cd2

Please sign in to comment.