-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add AuthenticatedHomePage * Create MenuPage * Create CheckingAccountMenu * Create CheckingAccountStatementsPage * Add TextPage and SoupPage * Rename tests * Add CheckingAccountFullStatement
- Loading branch information
1 parent
b841902
commit 97318c4
Showing
10 changed files
with
372 additions
and
46 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
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
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
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,42 @@ | ||
<script> | ||
function consultarLancamentosPorPeriodo(parametrosPeriodo, | ||
opcaoSelecionadaPeriodo) { | ||
var parametros = {}; | ||
var url; | ||
|
||
$('#extrato-grid-lancamentos, #extrato-grid-lancamentos-futuros-entrada, #extrato-grid-lancamentos-futuros-saida').empty(); | ||
$('#extrato-btn-ver-mais-lancamentos').empty(); | ||
|
||
if (filtro.periodoConsulta !== parametrosPeriodo) { | ||
|
||
if (opcaoSelecionadaPeriodo === "mesCompleto") { | ||
parametros = { | ||
"mesCompleto" : parametrosPeriodo | ||
}; | ||
filtro.mesCompleto = parametrosPeriodo; | ||
filtro.periodoConsulta = null; | ||
url = "RANDOM_STRING=;"; | ||
|
||
} else { | ||
|
||
filtro.mesCompleto = null; | ||
filtro.periodoConsulta = parametrosPeriodo; | ||
|
||
// $('#extrato-grid-lancamentos-futuros').empty(); | ||
$('#extrato-btn-ver-mais-lancamentos-futuros').empty(); | ||
|
||
$('#extrato-grid-outros-lancamentos').empty(); | ||
|
||
parametros = { | ||
"periodoConsulta" : parametrosPeriodo | ||
}; | ||
url = "PYITAU_OP_filter_statements=;"; | ||
|
||
armazenaValoresFiltro("periodoVisualizacao", filtroLancamentos.filtroSelecionado().periodoConsulta); | ||
} | ||
adobeFiltroPeriodoExtrato(filtro, true); | ||
} | ||
checkCookieSalvarFiltros() && setCookies("filtro_periodo_" + iDPF, filtroLancamentos.filtroSelecionado().periodoConsulta); | ||
filtraExtrato(parametros, url); | ||
} | ||
</script> |
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,92 @@ | ||
var boxHome = [ | ||
|
||
|
||
{ | ||
urlBox : "PYITAU_OP_ContaCorrente", | ||
seletorContainer : "#boxContaCorrente", | ||
isAberto : ( verificarSituacaoBoxAberto("boxContaCorrente") && 'false' == 'false' ) || ( verificaSituacaoBoxApp() && 'false' == 'true'), | ||
timeout: 90000, | ||
onComplete: function(){ | ||
_orquestradorLightBox.atualizar('contacorrente'); | ||
} | ||
}, | ||
|
||
|
||
|
||
{ | ||
urlBox : "PYITAU_OP_Pagamentos", | ||
seletorContainer : "#boxPagamentos", | ||
data: { | ||
linkLeitorCelular: false | ||
} | ||
}, | ||
{ | ||
urlBox : "PYITAU_OP_Transferencias", | ||
seletorContainer : "#boxTransferencias" | ||
}, | ||
{ | ||
urlBox : "PYITAU_OP_Pix", | ||
seletorContainer : "#boxPix" | ||
}, | ||
{ | ||
urlBox : "PYITAU_OP_OpenBanking", | ||
seletorContainer : "#boxOpenBanking" | ||
}, | ||
{ | ||
urlBox : "PYITAU_OP_Credito", | ||
seletorContainer : "#boxCredito" | ||
}, | ||
|
||
{ | ||
urlBox : "PYITAU_OP_Central", | ||
seletorContainer : "#boxCentral", | ||
showLoader : false, | ||
tratarError: false, | ||
onComplete: function(){ | ||
_orquestradorLightBox.atualizar('centraltarefas'); | ||
} | ||
|
||
}, | ||
{ | ||
urlBox : "PYITAU_OP_MeuBanner", | ||
seletorContainer : "#boxMeuBanner", | ||
showLoader : false, | ||
tratarError: false | ||
}, | ||
{ | ||
urlBox : "PYITAU_OP_Cartoes", | ||
seletorContainer : "#boxCartoes", | ||
isAberto : false, | ||
tratarError: false | ||
}, | ||
/* | ||
{ | ||
urlBox : "PYITAU_OP_Recarga", | ||
seletorContainer : "#boxRecarga" | ||
},*/ | ||
|
||
{ | ||
urlBox : "PYITAU_OP_Documentos", | ||
|
||
seletorContainer : "#boxDocumentos", | ||
onComplete: function(){ | ||
carregaDataLayerHome(); | ||
_orquestradorLightBox.atualizar('documentos'); | ||
} | ||
}, | ||
|
||
|
||
|
||
{ | ||
urlBox : "PYITAU_OP_HomeCarrinhoPF", | ||
seletorContainer : "#boxHomeCarrinhoPF", | ||
tratarError: false, | ||
data: { | ||
isHome: true, | ||
localExibicao : 'HOME_PF' | ||
} | ||
}, | ||
|
||
|
||
{ } | ||
]; |
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,40 @@ | ||
import pytest | ||
from bs4 import BeautifulSoup | ||
|
||
from pyitau.pages import AuthenticatedHomePage | ||
|
||
|
||
@pytest.fixture | ||
def response(): | ||
return """ | ||
<div class="logo left"> | ||
<a | ||
data-op="PYITAU_OP" | ||
href="" | ||
id="HomeLogo" | ||
onclick="GA.pushHeader('logoItau');" | ||
title="Home" | ||
> | ||
<img | ||
alt="Logo Itaú" | ||
height="50" | ||
src="https://estatico.itau.com.br/.../logo-itau.png" | ||
width="50" | ||
/> | ||
</a> | ||
</div> | ||
""" | ||
|
||
|
||
@pytest.fixture | ||
def page(response): | ||
return AuthenticatedHomePage(response) | ||
|
||
|
||
def test_init(response): | ||
page = AuthenticatedHomePage(response) | ||
assert page._soup == BeautifulSoup(response, features='html.parser') | ||
|
||
|
||
def test_op(page): | ||
assert page.op == 'PYITAU_OP' |
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,19 @@ | ||
import pytest | ||
|
||
from pyitau.pages import CheckingAccountFullStatement | ||
|
||
|
||
@pytest.fixture | ||
def response(): | ||
with open('./tests/responses/checking_account_full_statement.html') as file: | ||
body = file.read() | ||
return body | ||
|
||
|
||
@pytest.fixture | ||
def page(response): | ||
return CheckingAccountFullStatement(response) | ||
|
||
|
||
def test_op(page): | ||
assert page.filter_statements_op == 'PYITAU_OP_filter_statements=;' |
Oops, something went wrong.