From 662d6fe42677291e985caeeca6d6796a6b910a06 Mon Sep 17 00:00:00 2001 From: Mauro Costa <83025710+Mauro1706@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:07:49 -0300 Subject: [PATCH] fix: tratativa de asset de status de bloco quando possui varios processos (#621) Co-authored-by: Mauro Costa --- .../tests/TramiteBlocoExternoLimiteTest.php | 37 +++++++++++------- .../tests/TramiteBlocoExternoLimiteTest.php | 39 +++++++++++-------- .../tests/TramiteBlocoExternoLimiteTest.php | 37 +++++++++++------- 3 files changed, 68 insertions(+), 45 deletions(-) diff --git a/tests_sei4/funcional/tests/TramiteBlocoExternoLimiteTest.php b/tests_sei4/funcional/tests/TramiteBlocoExternoLimiteTest.php index 0ec9ac35a..1bfc775d3 100644 --- a/tests_sei4/funcional/tests/TramiteBlocoExternoLimiteTest.php +++ b/tests_sei4/funcional/tests/TramiteBlocoExternoLimiteTest.php @@ -170,21 +170,30 @@ public function test_verificar_envio_processo() */ public function test_verificar_envio_tramite_em_bloco() { - $this->acessarSistema( - self::$remetente['URL'], - self::$remetente['SIGLA_UNIDADE'], - self::$remetente['LOGIN'], - self::$remetente['SENHA'] - ); - $this->paginaCadastrarProcessoEmBloco->navegarListagemBlocoDeTramite(); + $this->acessarSistema( + self::$remetente['URL'], + self::$remetente['SIGLA_UNIDADE'], + self::$remetente['LOGIN'], + self::$remetente['SENHA'] + ); + $this->paginaCadastrarProcessoEmBloco->navegarListagemBlocoDeTramite(); + $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + + if (self::$tramitar == true) { + $this->waitUntil(function ($testCase) { + sleep(5); + $testCase->refresh(); + $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + $this->assertNotEquals('Aguardando Processamento', $novoStatus); + return true; + }, PEN_WAIT_TIMEOUT); + $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + $this->assertEquals(utf8_encode("Concluído"), $novoStatus); + } else { + $this->assertEquals("Aberto", $novoStatus); + } - if (self::$tramitar == true) { - $this->assertEquals(utf8_encode("Concluído"), $novoStatus); - } else { - $this->assertEquals(utf8_encode("Aberto"), $novoStatus); - } - - $this->sairSistema(); + $this->sairSistema(); } } \ No newline at end of file diff --git a/tests_sei41/funcional/tests/TramiteBlocoExternoLimiteTest.php b/tests_sei41/funcional/tests/TramiteBlocoExternoLimiteTest.php index a6db7ee1b..073ea7474 100644 --- a/tests_sei41/funcional/tests/TramiteBlocoExternoLimiteTest.php +++ b/tests_sei41/funcional/tests/TramiteBlocoExternoLimiteTest.php @@ -170,25 +170,30 @@ public function test_verificar_envio_processo() */ public function test_verificar_envio_tramite_em_bloco() { + $this->acessarSistema( + self::$remetente['URL'], + self::$remetente['SIGLA_UNIDADE'], + self::$remetente['LOGIN'], + self::$remetente['SENHA'] + ); + $this->paginaCadastrarProcessoEmBloco->navegarListagemBlocoDeTramite(); + $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + + if (self::$tramitar == true) { + $this->waitUntil(function ($testCase) { + sleep(5); + $testCase->refresh(); + $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + $this->assertNotEquals('Aguardando Processamento', $novoStatus); + return true; + }, PEN_WAIT_TIMEOUT); - self::$remetente = $this->definirContextoTeste(CONTEXTO_ORGAO_A); - self::$destinatario = $this->definirContextoTeste(CONTEXTO_ORGAO_B); - - $this->acessarSistema( - self::$remetente['URL'], - self::$remetente['SIGLA_UNIDADE'], - self::$remetente['LOGIN'], - self::$remetente['SENHA'] - ); - $this->paginaCadastrarProcessoEmBloco->navegarListagemBlocoDeTramite(); $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + $this->assertEquals(utf8_encode("Concluído"), $novoStatus); + } else { + $this->assertEquals("Aberto", $novoStatus); + } - if (self::$tramitar == true) { - $this->assertEquals(utf8_encode("Concluído"), $novoStatus); - } else { - $this->assertEquals(utf8_encode("Aberto"), $novoStatus); - } - - $this->sairSistema(); + $this->sairSistema(); } } \ No newline at end of file diff --git a/tests_super/funcional/tests/TramiteBlocoExternoLimiteTest.php b/tests_super/funcional/tests/TramiteBlocoExternoLimiteTest.php index cdbad3d48..a91affa45 100644 --- a/tests_super/funcional/tests/TramiteBlocoExternoLimiteTest.php +++ b/tests_super/funcional/tests/TramiteBlocoExternoLimiteTest.php @@ -176,21 +176,30 @@ public function test_verificar_envio_processo() */ public function test_verificar_envio_tramite_em_bloco() { - $this->acessarSistema( - self::$remetente['URL'], - self::$remetente['SIGLA_UNIDADE'], - self::$remetente['LOGIN'], - self::$remetente['SENHA'] - ); - $this->paginaCadastrarProcessoEmBloco->navegarListagemBlocoDeTramite(); + $this->acessarSistema( + self::$remetente['URL'], + self::$remetente['SIGLA_UNIDADE'], + self::$remetente['LOGIN'], + self::$remetente['SENHA'] + ); + $this->paginaCadastrarProcessoEmBloco->navegarListagemBlocoDeTramite(); + $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + + if (self::$tramitar == true) { + $this->waitUntil(function ($testCase) { + sleep(5); + $testCase->refresh(); + $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + $this->assertNotEquals('Aguardando Processamento', $novoStatus); + return true; + }, PEN_WAIT_TIMEOUT); + $novoStatus = $this->paginaCadastrarProcessoEmBloco->retornarTextoColunaDaTabelaDeBlocos(); + $this->assertEquals(utf8_encode("Concluído"), $novoStatus); + } else { + $this->assertEquals("Aberto", $novoStatus); + } - if (self::$tramitar == true) { - $this->assertEquals(utf8_encode("Concluído"), $novoStatus); - } else { - $this->assertEquals(utf8_encode("Aberto"), $novoStatus); - } - - $this->sairSistema(); + $this->sairSistema(); } } \ No newline at end of file