-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adicinado teste para validacao de bloqueio de exclusao de mapea…
…mento de hipoteses legais
- Loading branch information
1 parent
a95176b
commit 4cb16b9
Showing
3 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
tests_super/funcional/src/paginas/PaginaHipoteseLegalExclusaoBloqueada.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,49 @@ | ||
<?php | ||
|
||
class PaginaHipoteseLegalExclusaoBloqueada extends PaginaTeste | ||
{ | ||
public function __construct($test) | ||
{ | ||
parent::__construct($test); | ||
} | ||
|
||
public function navegarMapeamentoHipoteseLegal() | ||
{ | ||
$this->test->byId("txtInfraPesquisarMenu")->value(utf8_encode('Mapeamento de Hipoteses Legais')); | ||
$this->test->byXPath("//a[@href='#submenu92']")->click(); | ||
$this->test->byXPath("//a[@link='pen_map_hipotese_legal_envio_cadastrar']")->click(); | ||
} | ||
|
||
public function selecionarHipoteseSEI($value) | ||
{ | ||
$this->test->byXPath("//select[@name='id_hipotese_legal']")->click(); | ||
$this->test->byXPath("//option[@value='" . $value . "']")->click(); | ||
} | ||
|
||
public function selecionarHipotesePEN($value) | ||
{ | ||
$this->test->byXPath("//select[@name='id_barramento']")->click(); | ||
$this->test->byXPath("//option[@value='" . $value . "']")->click(); | ||
} | ||
|
||
public function salvarMapeamento() | ||
{ | ||
$this->test->byXPath("//button[@id='btnSalvar']")->click(); | ||
} | ||
|
||
public function excluirMapemaentoDeHipoteseLegalParaEnvio() | ||
{ | ||
$this->test->byXPath("//label[@class='infraCheckboxLabel']")->click(); | ||
$this->test->byXPath("//button[@value='Excluir']")->click(); | ||
$this->test->acceptAlert(); | ||
sleep(5); | ||
return $this->test->byId("divInfraMsg0")->text(); | ||
} | ||
|
||
public function navegarMapeamentoHipoteseLegalRecebimento() | ||
{ | ||
$this->test->byId("txtInfraPesquisarMenu")->value(utf8_encode('Mapeamento de Hipoteses Legais')); | ||
$this->test->byXPath("//a[@href='#submenu95']")->click(); | ||
$this->test->byXPath("//a[@link='pen_map_hipotese_legal_recebimento_cadastrar']")->click(); | ||
} | ||
} |
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
63 changes: 63 additions & 0 deletions
63
tests_super/funcional/tests/PaginaHipoteseLegalExclusaoBloqueadaTest.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,63 @@ | ||
<?php | ||
|
||
class PaginaHipoteseLegalExclusaoBloqueadaTest extends CenarioBaseTestCase | ||
{ | ||
protected static $remetente; | ||
protected static $destinatario; | ||
|
||
function setUp(): void | ||
{ | ||
parent::setUp(); | ||
} | ||
|
||
public function test_pagina_hipotese_legal_envio_exclusao_bloqueada() | ||
{ | ||
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->paginaHipoteseLegalExclusaoBloqueada->navegarMapeamentoHipoteseLegal(); | ||
$this->paginaHipoteseLegalExclusaoBloqueada->selecionarHipotesePEN(29); | ||
$this->paginaHipoteseLegalExclusaoBloqueada->selecionarHipoteseSEI(23); | ||
$this->paginaHipoteseLegalExclusaoBloqueada->salvarMapeamento(); | ||
$value = $this->paginaHipoteseLegalExclusaoBloqueada->excluirMapemaentoDeHipoteseLegalParaEnvio(); | ||
|
||
$value = trim(explode("X", $value)[1]); | ||
|
||
$this->assertStringContainsString( | ||
utf8_encode("Não é permitido excluir ou desativar essa hipotese legal"), | ||
$value | ||
); | ||
} | ||
|
||
public function test_pagina_hipotese_legal_recebimento_exclusao_bloqueada() | ||
{ | ||
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->paginaHipoteseLegalExclusaoBloqueada->navegarMapeamentoHipoteseLegalRecebimento(); | ||
$this->paginaHipoteseLegalExclusaoBloqueada->selecionarHipotesePEN(4); | ||
$this->paginaHipoteseLegalExclusaoBloqueada->selecionarHipoteseSEI(3); | ||
$this->paginaHipoteseLegalExclusaoBloqueada->salvarMapeamento(); | ||
$value = $this->paginaHipoteseLegalExclusaoBloqueada->excluirMapemaentoDeHipoteseLegalParaEnvio(); | ||
|
||
$value = trim(explode("X", $value)[1]); | ||
|
||
$this->assertStringContainsString( | ||
utf8_encode("Não é permitido excluir ou desativar essa hipotese legal"), | ||
$value | ||
); | ||
} | ||
} | ||
?> |