Skip to content

Commit

Permalink
Implementé los testa para recharge, transfer, change_password y chang…
Browse files Browse the repository at this point in the history
…e_email_password.
  • Loading branch information
lesclaz committed May 26, 2022
1 parent 7b2eba9 commit 549dce1
Show file tree
Hide file tree
Showing 12 changed files with 1,890 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PyLibSuitETECSA/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def recharge(self, recharge_code: str) -> bool:
def transfer(
self, mount_to_transfer: str,
account_to_transfer: str
) -> None:
) -> bool:
"""
Transfiere saldo a otra cuenta nauta.
:param mount_to_transfer: Monto a transferir.
Expand Down
1 change: 1 addition & 0 deletions PyLibSuitETECSA/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class UserPortal:
Action.LOGIN: f"{BASE_URL}user/login/es-es",
Action.LOAD_USER_INFO: f"{BASE_URL}useraaa/user_info",
Action.RECHARGE: f"{BASE_URL}useraaa/recharge_account",
Action.TRANSFER: f"{BASE_URL}useraaa/transfer_balance",
Action.CHANGE_PASSWORD: f"{BASE_URL}useraaa/change_password",
Action.CHANGE_EMAIL_PASSWORD: f"{BASE_URL}email/change_password",
Action.GET_CONNECTIONS: {
Expand Down
193 changes: 193 additions & 0 deletions test/assets/change_password_action.html

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions test/assets/change_password_action_fail.html

Large diffs are not rendered by default.

193 changes: 193 additions & 0 deletions test/assets/change_password_action_success.html

Large diffs are not rendered by default.

176 changes: 176 additions & 0 deletions test/assets/recharge_action.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0">
<!-- CSS -->

<link rel="shortcut icon" type="images/x-icon" href="https://www.portal.nauta.cu/media/img/nauta.gif">
<title>nauta. Recargar cuenta</title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="copyright" content="">
<script type="text/javascript">
var url_base = 'https://www.portal.nauta.cu/';
</script>
<link type="text/css" href="recharge_action_files/icon.css" rel="stylesheet" media=""><link type="text/css" href="recharge_action_files/materialize.css" rel="stylesheet" media="screen,projection"><link type="text/css" href="recharge_action_files/toastr.css" rel="stylesheet" media="screen,projection"><link type="text/css" href="recharge_action_files/mailtip.css" rel="stylesheet" media="screen,projection"><link type="text/css" href="recharge_action_files/style.css" rel="stylesheet" media="screen,projection"></head>
<body>
<header>
<div class="navbar-fixed">
<nav class="orange" role="navigation">
<div class="nav-wrapper">
<div class="left paralelogramo hide-on-med-and-down"><img class="etecsa-logo responsive-img" src="recharge_action_files/etecsa-logo-blanco50x50.png">
</div>
<a id="logo-container" href="#" class="brand-logo"><img class="nauta-logo" src="recharge_action_files/logo-nauta-45.png">
</a>
<span class="hide-on-med-and-down title-blue title-portal">Portal de usuario</span>

<ul class="right hide-on-med-and-down">
<li>
<a class="tooltipped" data-position="bottom" data-delay="50" href="https://www.portal.nauta.cu/nauta/change_lang/en-en" data-tooltip="English" data-tooltip-id="15706865-989a-4e49-f786-329398a29941"><i class="mdi-action-language small"></i></a> </li>
<li>
<a class="tooltipped contact_info" data-position="bottom" data-delay="50" data-tooltip="Información de contacto" href="https://www.portal.nauta.cu/nauta/contact_info" data-tooltip-id="2c87897f-b1d2-55f6-4e05-8331f68f13b9">
<i class="mdi-communication-quick-contacts-dialer"></i>
</a>
</li>
<li>
<a class="help tooltipped" data-position="bottom" data-delay="50" href="https://www.portal.nauta.cu/help/general" data-tooltip="Ayuda" data-tooltip-id="ede97d15-f005-2680-6601-86d0d8009944">
<i class="mdi-action-help"></i>
</a>
</li>
<li>
<a href="https://www.portal.nauta.cu/user/logout" class="tooltipped" data-position="bottom" data-delay="50" data-tooltip="Salir" data-tooltip-id="43496ac1-d776-e8f6-a3e1-7ea42f74534e"><i class="mdi-content-clear"></i></a>
</li>
</ul>
<ul id="nav-mobile" class="side-nav" style="left: -250px;">
<li class="center-align etecsa-grey"><img src="recharge_action_files/logo-etecsa_2.png" class="responsive-img etecsa-logo-2"></li>
<li class="no-padding "><a class="collapsible-header etecsa-blue-text" href="https://www.portal.nauta.cu/useraaa/user_info"><i class="mdi-action-account-circle"></i><span>Mi cuenta</span></a></li><li class="no-padding active"><a class="collapsible-header etecsa-blue-text" href="https://www.portal.nauta.cu/useraaa/recharge_account"><i class="mdi-maps-local-atm"></i><span>Recargar cuenta</span></a></li><li class="no-padding ">
<ul class="collapsible collapsible-accordion etecsa-blue-text">
<li>
<a class="collapsible-header etecsa-blue-text" href="#">Cambiar contraseña<i class="mdi-action-lock-open"></i></a>
<div class="collapsible-body" style="">
<ul><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/change_password">Cuenta de acceso</a></li><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/email/change_password">Cuenta de correo</a></li></ul></div></li></ul></li><li class="no-padding ">
<ul class="collapsible collapsible-accordion etecsa-blue-text">
<li>
<a class="collapsible-header etecsa-blue-text" href="#">Detalle de operaciones<i class="mdi-action-view-list"></i></a>
<div class="collapsible-body" style="">
<ul><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/service_detail">Conexiones</a></li><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/recharge_detail">Recargas</a></li><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/transfer_detail">Transferencias</a></li></ul></div></li></ul></li><li class="no-padding ">
<ul class="collapsible collapsible-accordion etecsa-blue-text">
<li>
<a class="collapsible-header etecsa-blue-text" href="#">Transferir saldo<i class="mdi-action-input"></i></a>
<div class="collapsible-body" style="">
<ul><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/transfer_balance">A otra cuenta nauta</a></li></ul></div></li></ul></li> <li class="separator etecsa-blue-text"></li>
<li class="no-padding etecsa-blue-text"><a class="collapsible-header" href="https://www.portal.nauta.cu/nauta/change_lang/en-en"><i class="mdi-action-language small"></i><span>English</span></a></li>
<li class="no-padding"><a class="contact_info collapsible-header etecsa-blue-text" href="https://www.portal.nauta.cu/nauta/contact_info"><i class="mdi-communication-quick-contacts-dialer small"></i><span>Información de contacto</span></a>
</li>
<li class="no-padding"><a class="help collapsible-header etecsa-blue-text" href="https://www.portal.nauta.cu/help/general"><i class="mdi-action-help small"></i><span>Ayuda</span></a></li>
<li class="no-padding"><a class="collapsible-header etecsa-blue-text" href="https://www.portal.nauta.cu/user/logout"><i class="mdi-content-clear small"></i><span>Salir</span></a></li>
</ul>
<a href="#" data-activates="nav-mobile" class="button-collapse"><i class="mdi-navigation-menu"></i></a>
</div>
</nav>
<nav class="white hide-on-med-and-down" id="icon-nav">
<div class="nav-wrapper">
<ul class="right hide-on-med-and-down">
<li class=""><a href="https://www.portal.nauta.cu/useraaa/user_info" class="etecsa-blue-text"><i class="mdi-action-account-circle"></i><span>Mi cuenta</span></a></li><li class="active"><a href="https://www.portal.nauta.cu/useraaa/recharge_account" class="etecsa-blue-text"><i class="mdi-maps-local-atm"></i><span>Recargar cuenta</span></a></li><li class="">
<a class="etecsa-blue-text dropdown-button" data-beloworigin="true" href="#" data-activates="dropdown_useraaa_change_password_group"><i class="mdi-action-lock-open"></i><span>Cambiar contraseña<i class="mdi-navigation-arrow-drop-down right"></i></span></a><ul id="dropdown_useraaa_change_password_group" class="dropdown-content etecsa-blue-text"><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/change_password">Cuenta de acceso</a></li><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/email/change_password">Cuenta de correo</a></li></ul>
</li><li class="">
<a class="etecsa-blue-text dropdown-button" data-beloworigin="true" href="#" data-activates="dropdown_useraaa_detail"><i class="mdi-action-view-list"></i><span>Detalle de operaciones<i class="mdi-navigation-arrow-drop-down right"></i></span></a><ul id="dropdown_useraaa_detail" class="dropdown-content etecsa-blue-text"><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/service_detail">Conexiones</a></li><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/recharge_detail">Recargas</a></li><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/transfer_detail">Transferencias</a></li></ul>
</li><li class="">
<a class="etecsa-blue-text dropdown-button" data-beloworigin="true" href="#" data-activates="dropdown_useraaa_transfer"><i class="mdi-action-input"></i><span>Transferir saldo<i class="mdi-navigation-arrow-drop-down right"></i></span></a><ul id="dropdown_useraaa_transfer" class="dropdown-content etecsa-blue-text"><li class="etecsa-blue-text "><a href="https://www.portal.nauta.cu/useraaa/transfer_balance">A otra cuenta nauta</a></li></ul>
</li> </ul>
</div>
</nav>
</div>

</header>
<div id="content" class="container"><div class="row">
<div class="col s12">
<h3>Recargar cuenta</h3>
<p class="sub-title">Permite recargar su cuenta de acceso mediante los cupones de recarga</p>
</div>
</div>
<div class="row">
<div class="card-panel">
<div class="row">
<div class="col s12">
<h5>Saldo actual</h5>
<p>$32,59 CUP</p>
<blockquote>Raspe la cubierta del código de recarga que aparece en el reverso del cupón</blockquote>
</div>
<form name="recharge_acount" id="recharge_acount" method="post" class="col s12">
<input type="hidden" name="csrf" value="security628cd034d2f3e"> <div class="row margin">
<div class="input-field col s12 m6">
<i class="mdi-action-view-column prefix"></i>
<input type="text" id="recharge_code" name="recharge_code" maxlength="16" length="16" class="active" placeholder="0000000000000000" autocomplete="off">
<label class="center-align active" for="recharge_code">Teclee el código de recarga </label>
<span class="character-counter" style="float: right; font-size: 12px; height: 1px;"></span></div>
</div>
<div class="row">
<div class="input-field col s12">
<button name="btn_submit" type="submit" class="submit_btn btn waves-effect waves-light blue darken-4">
Aceptar </button>
</div>
</div>
</form>
</div>
</div>
</div>
</div> <div id="contact_info_box"></div>
<footer class="page-footer white grey-text text-darken-4">
<hr>
<div class="container">
<div class="row center">
<div class="col s12">
<p>© 2011 Empresa de Telecomunicaciones de Cuba S. A. (ETECSA). Todos los derechos reservados</p>
<p><a class="etecsa-blue-text" href="http://www.etecsa.cu/">www.etecsa.cu</a></p>
</div>
</div>
</div>
<div class="hidden" id="ajax-messages" data-ajax-connection-error="Existe un error de conexión de red. Puede ser que usted se haya desconectado de la red o el servicio se haya caido."></div>
</footer><script type="text/javascript" src="recharge_action_files/jquery-2.js"></script><script type="text/javascript" src="recharge_action_files/materialize.js"></script><script type="text/javascript" src="recharge_action_files/jquery_003.js"></script><script type="text/javascript" src="recharge_action_files/toastr.js"></script><script type="text/javascript" src="recharge_action_files/jquery.js"></script><script type="text/javascript" src="recharge_action_files/init.js"></script><script type="text/javascript" src="recharge_action_files/msgpool.js"></script><script type="text/javascript" src="recharge_action_files/recharge_account.js"></script><script type="text/javascript" src="recharge_action_files/jquery_002.js"></script> <script type="text/javascript">
window.toastr.options = {
timeOut: 10000
}
$(function(){
$('.contact_info, .help').on("click",function(e){
console.log($(this).attr('href'));
e.preventDefault();
$("#contact_info_box").load($(this).attr('href'));

});


$('.show_password').on("click",function(){
var target=$(this).attr('rel');
if ($(this).prop('checked')){
$('#'+target).attr('type','text');
} else {
$('#'+target).attr('type','password');
}
});

$('.submit_btn').on('click',function(){
$.blockUI({
message:'<div class="preloader-wrapper active"><div class="spinner-layer spinner-red-only"> <div class="circle-clipper left"> <div class="circle"></div> </div><div class="gap-patch"> <div class="circle"></div> </div><div class="circle-clipper right"> <div class="circle"></div> </div> </div> </div><div></div><div>Cargando...</div>',
css: {
border: 'none',
padding: '15px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .5,
color: '#fff'
} });
});

var options = ['nauta.com.cu','nauta.co.cu'];
$("input.user-domain").mailtip({
mails: options,
offsetTop: 2
});

});
</script>


<div class="material-tooltip" id="15706865-989a-4e49-f786-329398a29941"><span>English</span><div class="backdrop" style="top: 0px; left: 0px;"></div></div><div class="material-tooltip" id="2c87897f-b1d2-55f6-4e05-8331f68f13b9"><span>Información de contacto</span><div class="backdrop" style="top: 0px; left: 0px;"></div></div><div class="material-tooltip" id="ede97d15-f005-2680-6601-86d0d8009944"><span>Ayuda</span><div class="backdrop" style="top: 0px; left: 0px;"></div></div><div class="material-tooltip" id="43496ac1-d776-e8f6-a3e1-7ea42f74534e"><span>Salir</span><div class="backdrop" style="top: 0px; left: 0px;"></div></div><div class="hiddendiv common"></div><div class="drag-target" style="left: 0px; touch-action: pan-y;"></div></body></html>
Loading

0 comments on commit 549dce1

Please sign in to comment.