Commit ad7c7b00 authored by Daniel Abarca's avatar Daniel Abarca

Primera entrega

parents
# Default ignored files
/shelf/
/workspace.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="asposecells" />
</list>
</option>
</inspection_tool>
<inspection_tool class="RobotKeywordNotFound" enabled="false" level="ERROR" enabled_by_default="false" />
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (RobotAutomatizacionServicios)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/RobotAutomatizacionServicios.iml" filepath="$PROJECT_DIR$/.idea/RobotAutomatizacionServicios.iml" />
</modules>
</component>
</project>
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR INDIVIDUOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=individual.identification=='${item}[4]*'
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/party/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/party
# log to console ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Gestor Agentes - Individuos PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR ORGANIZACIONES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=organization.name=='${item}[1]*';(type==O)
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/party/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/party
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Gestor Agentes - Organización PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR ROLES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=name=='${item}[1]*'
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/role/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/role
log to console ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Roles PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR CALENDARIOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=id=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/calendar/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/calendar
&{body_excepciones}= create dictionary caleId=${ID} sortDirection=asc columnName=description
${valores_excepciones}= Obtener data - calendario excepciones ${header} ${body_excepciones} ${session} /service/config-service/calendar-exception/find-by-calendar-id ${ID}
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Calendario PRIMARIA ${flag_reporte} ${reporte} ${valores_excepciones}
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR CATALOGOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
&{body2}= create dictionary currentPage=0 itemsPerPage=50
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/catalog/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/catalog
${valores_catalogos}= Obtener data - catalogos ${header} ${body} ${ID} ${session} /service/config-service/characteristic-value/list-value-group-pagination
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Catalogos PRIMARIA ${flag_reporte} ${reporte} ${valores_catalogos}
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR CICLOS LIQUIDACION
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=name=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/billing-cycle/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/billing-cycle
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Ciclos de Liquidacion PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR CLASES UBIGEO
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/class-ubigeo/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/class-ubigeo
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Clase Ubigeo PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR CONCEPTOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/concept/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/concept
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Conceptos PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR EQUIVALENCIAS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/equivalence-entity/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/equivalence-entity
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Equivalencias PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR IMPUESTOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=code=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/tax/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/tax
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Impuestos PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR INTERVALOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/interval/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/interval
&{body_condiciones}= crear json
${valores_condiciones}= obtener data - condicion intervalos ${header} ${ID} ${session} /service/config-service/interval-condition/page/${ID}?searchString= ${body_condiciones}
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores_condiciones}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Intervalo PRIMARIA ${flag_reporte} ${reporte} ${valores_condiciones}
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR MONEDAS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=code=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/currency/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/currency
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Moneda PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR PARAMETROS DE NEGOCIO
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=key=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/business-parameter/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/business-parameter
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Parametros de Negocio PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR PARAMETROS DE SISTEMA
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/input/system-field/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/input/system-field
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Parámetros de sistema PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR TAREAS PROGRAMADAS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/settings/scheduler-task/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/settings/scheduler-task
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Tareas Programadas PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR TIPO DE CAMBIOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body_moneda}= create dictionary filterExpression=name=='${item}[1]*'
&{body_moneda_target}= create dictionary filterExpression=name=='${item}[2]*'
${ID_moneda}= Obtener_ID ${header} ${body_moneda} ${session} /service/config-service/currency/page
${ID_moneda_target}= Obtener_ID ${header} ${body_moneda_target} ${session} /service/config-service/currency/page
&{body}= create dictionary filterExpression=currency.id=='${ID_moneda}';targetCurrency.id=='${ID_moneda_target}'
# LOG TO CONSOLE ${body}
${valores}= obtener data - tipo cambio ${header} ${body} ${session} /service/config-service/currency-exchange/page ${item}
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Tipo de Cambio PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR TIPOS CATALOGOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
${NUM_SUBSECCIONES}= GET LENGTH ${data_excel}[6]
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=id=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/catalog-type/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/catalog-type
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Tipos de catálogo PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR TIPOS DE AJUSTES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/adjustment-type/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/adjustment-type
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Tipos de Ajuste PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR UBIGEOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/ubigeo/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/ubigeo
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Ubigeo PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR VALORES POSIBLES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=concept=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/possible-value/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/possible-value
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Valores posibles PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR CONEXIONES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[2]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/database-connection-inventory/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/database-connection-inventory
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Conexiones PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR CREDENCIALES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/credential/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/credential
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Credenciales PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Resource ../../Funciones/FuncionesRobot/FuncionesVarias.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR INSUMOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[2]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener ID ${header} ${body} ${session} /service/config-service/input/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/input
# log to console TERMINO DE CONSEGUIR LOS VALORES : ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Insumos PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR REPOSITORIOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/repository/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/repository
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Repositorios PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Resource ../../Funciones/FuncionesRobot/FuncionesVarias.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR ACUERDOS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener ID - Agreement Version ${header} ${body} ${session} /service/config-service/agreement/page ${item}[2]
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/agreement-version
${ID_plan}= obtener id - plan acuerdo ${valores}
${valores_plan}= Obtener data ${header} ${ID_plan} ${session} /service/config-service/commission-plan-version/version
# log to console TERMINO DE CONSEGUIR LOS VALORES DEL PLAN: ${valores_plan}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Acuerdos PRIMARIA ${flag_reporte} ${reporte} ${valores_plan}
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR AJUSTES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=period=='${item}[2]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener ID - AJUSTES ${header} ${body} ${session} /service/config-service/adjustment/page ${item}
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/adjustment
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Ajustes PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR ESTRUCTURAS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[2]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener ID ${header} ${body} ${session} /service/config-service/commission-structure/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/commission-structure
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Estructura de Comisión PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR EXCEPCIONES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener ID - Current Version ${header} ${body} ${session} /service/config-service/exception/page ${item}[1] Excepciones
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/exception-version
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Excepciones PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR MATRICES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[2]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener ID ${header} ${body} ${session} /service/config-service/point-matrix/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/point-matrix
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Matriz de puntos PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR PENALIDADES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener ID - Current Version ${header} ${body} ${session} /service/config-service/sanction/page ${item}[1] Penalidades
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/sanction-version
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Penalidades PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR PLANES
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
log to console ESTE ES EL ITEM ACTUAL: ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[1]*'
# LOG TO CONSOLE ${body}
${ID}= Obtener_ID_PLANES ${header} ${body} ${session} /service/config-service/commission-plan/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/commission-plan/version
# log to console TERMINO DE CONSEGUIR LOS VALORES ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Plan de comision PRIMARIA ${flag_reporte} ${reporte}
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR FILTROS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
# log to console ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=identifier=='${item}[1]*'
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/filter/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/filter
# log to console ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Filtros PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../../Funciones/FuncionesRobot/FuncionesValidacion.robot
Variables ../../Variables/variables.py
*** Variables ***
*** Keywords ***
VALIDAR VISTAS
[Arguments] ${data_excel} ${flag_reporte} ${reporte}
# log to console ${data_excel}
${datos}= get from list ${data_excel} 4
${campos}= get from list ${data_excel} 3
${llave_campos}= get from list ${data_excel} 5
FOR ${item} IN @{datos}
# log to console ${item}[1]
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
&{body}= create dictionary filterExpression=description=='${item}[2]*'
${ID}= Obtener_ID ${header} ${body} ${session} /service/config-service/view/page
${valores}= Obtener data ${header} ${ID} ${session} /service/config-service/view
# log to console ${valores}
validar configuracion ${item} ${valores} ${campos} ${llave_campos} ${data_excel} Vistas PRIMARIA ${flag_reporte} ${reporte} -
END
\ No newline at end of file
from reportlab.platypus import SimpleDocTemplate, Table, Paragraph, Spacer, TableStyle, Image
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.lib.pagesizes import A4, landscape
import datetime
import json
def cambiar_formato_archivo(ruta):
ruta_nueva = ruta.replace(".json", ".pdf")
return ruta_nueva
def GenerarReporte(reporte):
ruta = cambiar_formato_archivo(reporte)
doc = SimpleDocTemplate(
ruta,
rightMargin=72, leftMargin=72,
topMargin=72, bottomMargin=18,
pagesize=A4
)
doc.pagesize = landscape(A4)
styles = getSampleStyleSheet()
conjunto_lineas = []
spacer = Spacer(1, 0.25 * inch)
titulo = 'PRUEBA DE VALIDACION DE ENTIDADES DEL MENU DE CONFIGURACION'
para = Paragraph(titulo, styles["Heading1"])
conjunto_lineas.append(para)
fecha = 'FECHA: ' + str(datetime.date.today())
para = Paragraph(fecha, styles["Normal"])
conjunto_lineas.append(para)
conjunto_lineas.append(spacer)
with open(reporte, 'r+') as json_file:
diccionario = json.load(json_file)
contador1 = 1
for i in diccionario:
opcion = diccionario[i]
subtitulo = str(contador1) + '. ' + i
para = Paragraph(subtitulo, styles["Heading2"])
conjunto_lineas.append(para)
contador2 = 1
for elementos in opcion:
subtitulo2 = str(contador1) + '.' + str(contador2) + ' ' + i + ' - ID: ' + str(elementos['ID'])
para = Paragraph(subtitulo2, styles["Heading3"])
conjunto_lineas.append(para)
# SI EXISTE ENTIDAD CORRECTAMENTE CONFIGURADA
if((str(elementos['Valores en excel']) == "[]") and (str(elementos['Valores en interfaz']) == "[]")):
data = [
['Resultado'],
[str(elementos['Resultado'])],
]
# SI EXISTE ENTIDAD PERO NO CORRECTAMENTE CONFIGURADA O SI NO EXISTE ENTIDAD
else:
data = [
['Resultado', 'Valores en excel', 'Valores en interfaz'],
[str(elementos['Resultado']), str(elementos['Valores en excel']),
str(elementos['Valores en interfaz'])],
]
tblstyle = TableStyle([
('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black),
('BOX', (0, 0), (-1, -1), 0.25, colors.black),
('ALIGN', (0, -1), (-1, -1), 'CENTER'),
])
textoNuevoFormato = getSampleStyleSheet()
textoNuevoFormato = textoNuevoFormato["BodyText"]
textoNuevoFormato.wordWrap = 'CJK'
data2 = [[Paragraph(cell, textoNuevoFormato) for cell in row] for row in data]
tbl = Table(data2)
tbl.setStyle(tblstyle)
conjunto_lineas.append(tbl)
if 'Subseccion' in elementos:
subentidades = elementos['Subseccion']
letra = 'A'
for subentidad in subentidades:
tipos_subentidad = list(subentidad.keys())
for num in range(0, len(tipos_subentidad)):
tipo_subentidad = tipos_subentidad[num]
subtitulo3 = letra + '. ' + str(tipo_subentidad)
para = Paragraph(subtitulo3, styles["Heading4"])
conjunto_lineas.append(para)
data = [
['Resultado', 'Valores en excel', 'Valores en interfaz'],
]
tblstyle = TableStyle([
('INNERGRID', (0, 0), (-1, -1), 0.25, colors.black),
('BOX', (0, 0), (-1, -1), 0.25, colors.black),
('ALIGN', (0, -1), (-1, -1), 'CENTER'),
])
filas_subentidad = subentidad[tipo_subentidad]
for fila in filas_subentidad:
print(fila['Valores en excel'])
# EXISTE SUBENTIDAD CORRECTAMENTE CONFIGURADA
if ((str(fila['Valores en excel']) == "[] ") and (
str(fila['Valores en interfaz']) == "[] ")):
registro = [
[str(fila['Resultado']), ' - ',
' - '],
]
else:
registro = [str(fila['Resultado']), str(fila['Valores en excel']),
str(fila['Valores en interfaz'])]
data.append(registro)
textoNuevoFormato = getSampleStyleSheet()
textoNuevoFormato = textoNuevoFormato["BodyText"]
textoNuevoFormato.wordWrap = 'CJK'
data2 = [[Paragraph(cell, textoNuevoFormato) for cell in row] for row in data]
tbl = Table(data2)
tbl.setStyle(tblstyle)
conjunto_lineas.append(tbl)
letra = chr(ord(letra) + 1)
contador2 = contador2 + 1
contador1 = contador1 + 1
doc.build(conjunto_lineas)
if __name__ == '__main__':
ruta_reporte = input('Ingrese ruta del reporte: ')
GenerarReporte(ruta_reporte)
\ No newline at end of file
import json
import os
import random
from datetime import datetime
# import FuncionesPDF
def crear_reporte(ruta_reporte):
if(ruta_reporte == ''):
try:
os.mkdir('CarpetaReportes')
ruta_reporte = 'CarpetaReportes'
except OSError:
pass
num = random.randint(0, 20)
now = datetime.now()
months = ("Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic")
dia = str(now.day)
mes = months[now.month - 1]
año = str(now.year)
hora = str(now.hour)
minuto = str(now.minute)
segundo = str(now.second)
fecha = dia+mes+año+'-'+hora+'-'+minuto+'-'+segundo
reporte = ruta_reporte + '\\Reporte'+str(num)+'-'+fecha+'.json'
return reporte
def llenarReporte_Subentidad(reporte, opcion, id, cadena, valores_excel, valores_interfaz, subseccion):
with open(reporte, 'r+') as json_file:
diccionario = json.load(json_file)
elementos = diccionario[opcion]
for elemento in elementos:
if elemento['ID'] == id :
if 'Subseccion' in elemento:
subentidades = elemento['Subseccion']
# print(subentidades)
for subentidad in subentidades:
if subseccion in subentidad:
data = {
'Valores en excel': valores_excel,
'Valores en interfaz': valores_interfaz,
'Resultado': cadena
}
with open(reporte, 'r+') as file:
subentidad[subseccion].append(data)
file.seek(0)
json.dump(diccionario, file, indent=4)
else:
data = []
valores = {
'Valores en excel': valores_excel,
'Valores en interfaz': valores_interfaz,
'Resultado': cadena
}
data.append(valores)
with open(reporte, 'r+') as file:
subentidad[subseccion] = data
file.seek(0)
json.dump(diccionario, file, indent=4)
else:
data = []
valores_subseccion = {
'Valores en excel': valores_excel,
'Valores en interfaz': valores_interfaz,
'Resultado': cadena
}
data.append(valores_subseccion)
data2 = []
valores = {
subseccion: data
}
data2.append(valores)
with open(reporte, 'r+') as file:
elemento['Subseccion'] = data2
file.seek(0)
json.dump(diccionario, file, indent=4)
def llenarReporte(reporte, opcion, cadena, valores_excel, valores_interfaz, id, estado_reporte):
if estado_reporte != 'Terminado':
existe = os.path.exists(reporte)
if existe == True:
with open(reporte, 'r+') as json_file:
lista_opciones = json.load(json_file)
if opcion in lista_opciones:
data = {
'ID': id,
'Valores en excel': valores_excel,
'Valores en interfaz': valores_interfaz,
'Resultado': cadena
}
with open(reporte, 'r+') as file:
file_data = json.load(file)
file_data[opcion].append(data)
file.seek(0)
json.dump(file_data, file, indent=4)
else:
data = []
valores = {
'ID': id,
'Valores en excel': valores_excel,
'Valores en interfaz': valores_interfaz,
'Resultado': cadena
}
data.append(valores)
with open(reporte, 'r+') as file:
file_data = json.load(file)
file_data[opcion] = data
file.seek(0)
json.dump(file_data, file, indent=4)
else:
data = {}
data[opcion] = []
data[opcion].append(
{
'ID': id,
'Valores en excel': valores_excel,
'Valores en interfaz': valores_interfaz,
'Resultado': cadena
}
)
with open(reporte, 'w') as file:
json.dump(data, file, indent=4)
# else:
# FuncionesPDF.GenerarReporte(reporte)
import json
import ast
import datetime
def modificar_fecha_excepcion(fecha):
fechaN = fecha.split('T')
fechaN = fechaN[0]
return fechaN
print(modificar_fecha_excepcion('2023-10-29T00:00:00-05:00'))
def separar_string(cadena):
lista = cadena.split('/##/')
return lista
def modificar_tipo_excepcion(cadena):
if (cadena=="Salario Base"):
tipo = "B"
elif (cadena=="Meta"):
tipo = "M"
elif (cadena == "Sueldo Variable"):
tipo = "V"
return tipo
def modificar_origen_excepcion(cadena):
if (cadena=="Formacion" or cadena=="Formación"):
tipo = "FOR"
elif (cadena=="Suspension" or cadena=="Suspensión"):
tipo = "SUS"
elif (cadena == "Incapacidad"):
tipo = "INC"
elif (cadena == "Vacaciones"):
tipo = "VAC"
elif (cadena == "Termino de relaciones laborales"):
tipo = "TRL"
return tipo
def elemento_API_esta_en_Lista_elemento_EXCEL(lista, cadena):
lista2 = separar_string(cadena)
RESULTADO = False
contador = 0
for i in lista:
for j in lista2:
if(i == j):
contador += 1
if (contador==len(lista)):
RESULTADO = True
return RESULTADO
lista = ['Postpago','MIFI']
lista2 = ['MIF','Postpago']
cadena = 'Postpago/##/MIFI'
print(elemento_API_esta_en_Lista_elemento_EXCEL(lista2,cadena))
def crear_json():
dict = {
"currentPage":0,
"itemsPerPage":100,
"data":[]
}
return dict
# print(crear_json())
def modificar_comillas(cadena):
cadena = ast.literal_eval(cadena)
return cadena
def mostrar_tipo(c):
tipo = type(c)
return tipo
# c = "{'32': {'id': 54, 'version': 0, 'identifier': 'huawei', 'description': 'Huawei', 'value': 'Huawei', 'defaultValue': True}, '29': 'Id01', '30': 'Celular usado xxxx', '31': '15', 'id_catalog_item': '317'}"
# print(type(modificar_comillas(c)))
def quitar_corchetes(cadena):
cadena_nueva = cadena[1:]
cadena_nueva = cadena_nueva[:-1]
return cadena_nueva
def cambiar_dia(dia):
dia = str(dia)
if ((dia=="Lunes") or (dia=="lunes")):
n_dia = 1
elif ((dia=="Martes") or (dia=="martes")):
n_dia = 2
elif ((dia=="Miercoles") or (dia=="miercoles") or (dia=="Miércoles") or (dia=="miércoles")):
n_dia = 3
elif ((dia=="Jueves") or (dia=="jueves")):
n_dia = 4
elif ((dia=="Viernes") or (dia=="viernes")):
n_dia = 5
elif ((dia=="Sabado") or (dia=="sabado") or (dia=="Sábado") or (dia=="sábado")):
n_dia = 6
elif ((dia=="Domingo") or (dia=="domingo")):
n_dia = 7
else:
n_dia = 0
return n_dia
def change_hour_API(hora):
hora_nueva=hora.replace('Z','')
return hora_nueva
def change_hour(hora, P):
unidad_hora = hora.hour
if ((P == "PM") & (unidad_hora != 12)):
unidad_hora = unidad_hora + 12
if ((P == "AM") & (unidad_hora == 12)):
unidad_hora = 0
hora2 = hora.replace(hour=unidad_hora)
hora2 = hora2.strftime("%H:%M:%S")
return hora2
def change_format_date2(fecha):
fechaN = fecha.strftime('%Y-%m-%d')
return fechaN
def change_format_date(fecha):
fechaN = fecha.strftime('%d/%m/%Y')
return fechaN
def modificar_si_es_fecha(cadena):
if(isinstance(cadena, datetime.datetime)):
cadena = change_format_date(cadena)
return cadena
def modificar_valor_excel(valor, campo):
if (campo=="Frecuencia"):
if ((valor == "Unico") or (valor == "Único") or (valor == "unico") or (valor == "único")):
valor_nuevo = "U"
elif ((valor == "Rango") or (valor == "rango") or (valor == "Entre rango de fechas") or (valor == "entre rango de fechas")):
valor_nuevo = "R"
elif ((valor == "Anual") or (valor == "anual") or (valor == "Anual - Día específico") or (valor == "anual - dia especifico") or (valor == "Anual - Dia especifico") or (valor == "anual - día específico")):
valor_nuevo = "Y"
elif ((valor == "Semanal") or (valor == "semanal") or (valor == "Anual - Semana del mes") or (valor == "anual - semana del mes")):
valor_nuevo = "W"
else:
valor_nuevo = "-"
elif (campo=="Tipo"):
if ((valor == "Feriado") or (valor == "feriado")):
valor_nuevo = "H"
elif ((valor == "Excepción no laboral") or (valor == "Excepcion no laboral") or (valor == "excepción no laboral") or (valor == "excepcion no laboral")):
valor_nuevo = "N"
elif ((valor == "Excepción laboral") or (valor == "excepción laboral") or (valor == "Excepcion laboral") or (valor == "excepcion laboral")):
valor_nuevo = "W"
else:
valor_nuevo = "-"
else:
valor_nuevo = "-"
return valor_nuevo
def concatenar(cadena, cadena2):
nueva_cadena = str(cadena) + "&" + str(cadena2)
return nueva_cadena
def concatenar2(cadena, cadena2):
nueva_cadena = str(cadena) + str(cadena2)
return nueva_cadena
def traer_campos_subseccion_de_lista(datos, n):
n = int(n)
campos = datos[7]
campos_subseccion = campos[n]
return campos_subseccion
def traer_valores_subseccion_de_lista(datos, n, id):
n = int(n)
valores = datos[8]
lista_valores = []
valor = valores[n]
for j in valor:
valor_id = j[0]
if (valor_id == id):
lista_valores.append(j)
return lista_valores
def traer_ubicacion_campos_subseccion_de_lista(datos, n):
n = int(n)
ubica_campos = datos[9]
ubica_campos_subseccion = ubica_campos[n]
return ubica_campos_subseccion
def obtener_ubicacion_de_lista(ubicaciones, n):
n = int(n)
lista_ubicacion = ubicaciones[n]
return lista_ubicacion
def mostrar_json_en_consola(resultado, val_excel, val_interfaz):
json = {
'Resultado': resultado,
'Valores en excel': val_excel,
'Valores en interfaz': val_interfaz
}
return json
def sumar(n,m):
z = int(n) + int(m)
return z
def separarRutaJSON(cadena):
lista = cadena.split('[${i}].')
return lista
print(separarRutaJSON('intervalConditionBeanList[${i}].intervalRangeBeanList[${i}].startRange'))
# def find_escape_sequence(cadena,caracter):
#
# cadena = str(cadena)
# pos = []
#
# pos_ini = cadena.find(caracter)
#
# return pos
def remove_escape_sequences(string):
cadena = string.encode('utf-8').decode('unicode_escape')
# cadena_json = json.loads(cadena, strict=False)
cadena = cadena.replace('ó','o')
# return cadena_json
return cadena
def cambiarCaracterUTF8(cadena):
nueva_cadena = str(cadena)
# nueva_cadena = nueva_cadena.encode(encoding='UTF-8',errors="ignore")
# nueva_cadena = "''" + str(cadena) + "''"
# nueva_cadena = nueva_cadena.replace("\u0000", '')
# nueva_cadena = nueva_cadena.replace("\xc3\x81", 'A')
# nueva_cadena = nueva_cadena.replace("\xc3\x89", 'E')
# nueva_cadena = nueva_cadena.replace("\xc3\x8d", 'I')
# nueva_cadena = nueva_cadena.replace("\xc3\x91", 'N')
# nueva_cadena = nueva_cadena.replace("\xc3\x93", 'O')
# nueva_cadena = nueva_cadena.replace("\xc3\x9a", 'U')
# nueva_cadena = nueva_cadena.replace("\xc3\x9c", 'U')
# nueva_cadena = nueva_cadena.replace("\xc3\xa1", 'a')
# nueva_cadena = nueva_cadena.replace("\xc3\xa9", 'e')
# nueva_cadena = nueva_cadena.replace("\xc3\xad", 'i')
# nueva_cadena = nueva_cadena.replace("\xc3\xb1", 'n')
# nueva_cadena = nueva_cadena.replace("\xc3\xb3", 'o')
# nueva_cadena = nueva_cadena.replace("\xc3\xba", 'u')
# nueva_cadena = nueva_cadena.replace("\xc3\xbc", 'u')
return nueva_cadena
# print(cambiarCaracterUTF8("""{"id":81,"version":3,"type":"O","status":"A","creationDate":"2022-02-23T00:00:00-05:00","liquidation":"Y","email":"","phone":"","person":"","organizationBean":{"id":22,"version":1,"type":"O","name":"LIQ E5 Digital Inspire","identification":"901164937","channelType":"I","channelClass":"C","logo":"","organizationUnitType":"\u0000","organizationStructureBeanList":[{"id":220,"version":0,"from":"2022-02-23T00:00:00-05:00","party":78,"individual":55,"individualName":"LIQ E5 Manrique","role":23,"roleName":"Organizaci\xc3\xb3n Remoto - Agentes E-dealers"}],"responsible":55,"responsibleName":"LIQ E5 Manrique","representative":84,"representativeName":"LIQ LUIS ERNESTO MU\xc3\x91OZ BALLESTEROS / LIQ E1 WOM 13ENE","liquidationIndividual":false,"segmentationBeanList":[]},"partyBeanList":[]}"""))
# print(remove_escape_sequences("""{"id":81,"version":3,"type":"O","status":"A","creationDate":"2022-02-23T00:00:00-05:00","liquidation":"Y","email":"","phone":"","person":"","organizationBean":{"id":22,"version":1,"type":"O","name":"LIQ E5 Digital Inspire","identification":"901164937","channelType":"I","channelClass":"C","logo":"","organizationUnitType":"\u0000","organizationStructureBeanList":[{"id":220,"version":0,"from":"2022-02-23T00:00:00-05:00","party":78,"individual":55,"individualName":"LIQ E5 Manrique","role":23,"roleName":"Organizaci\xc3\xb3n Remoto - Agentes E-dealers"}],"responsible":55,"responsibleName":"LIQ E5 Manrique","representative":84,"representativeName":"LIQ LUIS ERNESTO MU\xc3\x91OZ BALLESTEROS / LIQ E1 WOM 13ENE","liquidationIndividual":false,"segmentationBeanList":[]},"partyBeanList":[]}"""))
import openpyxl
def fetch_number_of_columns(sheetname):
sh = wk[sheetname]
return sh.max_column
def fetch_number_of_rows(sheetname):
sh = wk[sheetname]
return sh.max_row
def fetch_cell_data(sheetname, row, col):
sh = wk[sheetname]
cell = sh.cell(int(row),int(col))
return cell.value
# FUNCIONES PARA LAS TABLAS PRIMARIAS - ENTIDADES
def buscar_Opcion(sheetname, opcion):
sh = wk[sheetname]
nrows = sh.max_row
ubicacion = ''
for i in range(nrows):
valor = fetch_cell_data(sheetname,i+1,1)
valor2 = fetch_cell_data(sheetname,i+1,2)
if(valor == 'Opción' and valor2 == opcion):
ubicacion = (i+1)
return ubicacion
def obtener_seccion(sheetname, ubicacion):
seccion = fetch_cell_data(sheetname,ubicacion+1,2)
return seccion
def search_location_range(sheetname, opcion, seccion):
sh = wk[sheetname]
nrows = sh.max_row
fila_inicio = 0
cant_filas = 0
for i in range(3, nrows+1):
valor_opcion = fetch_cell_data(sheetname,i,1)
valor_seccion = fetch_cell_data(sheetname,i,2)
if ((valor_opcion == opcion) & (((valor_seccion) == (seccion)))):
if (fila_inicio == 0):
fila_inicio = i
cant_filas += 1
location = [fila_inicio,fila_inicio+cant_filas-1]
return location
def traer_campos(sheetname,rango):
lista_campos = []
inicio = rango[0]
fin = rango[1]
for i in range(inicio, fin+1):
valor = fetch_cell_data(sheetname, i, 3)
lista_campos.append(valor)
return lista_campos
def determinar_campos_opcion(opcion,seccion, tipo):
if (tipo == 'seccion'):
rango = search_location_range('Indice',opcion,seccion)
campos = traer_campos('Indice',rango)
return campos
else:
l = []
for i in seccion:
rango = search_location_range('Indice', opcion, i)
campos = traer_campos('Indice', rango)
l.append(campos)
return l
def traer_ubicacion_campos(sheetname,rango):
lista_campos = []
inicio = rango[0]
fin = rango[1]
for i in range(inicio, fin + 1):
identificador = fetch_cell_data(sheetname, i, 8)
tipo = fetch_cell_data(sheetname, i, 9)
campo = [identificador,tipo]
lista_campos.append(campo)
return lista_campos
def determinar_ubicacion_campos(opcion,seccion):
rango = search_location_range('Indice',opcion,seccion)
campos = traer_ubicacion_campos('Indice',rango)
return campos
def obtener_tamaño_tabla(sheetname,ubicacion):
cant = 0
valor = '-'
while(valor != None):
valor = fetch_cell_data(sheetname,ubicacion + cant,1)
if (valor != None):
cant += 1
return cant
def obtener_ubicacion_celdas(sheetname, fila):
lista_ubicaciones = []
ncol = fetch_number_of_columns(sheetname)
for i in range(1, ncol+1):
valor = fetch_cell_data(sheetname,fila,i)
if (valor != None):
lista_ubicaciones.append(i)
return lista_ubicaciones
def obtener_valores_tabla(sheetname, fila, ubicacion):
valores = []
columnas = obtener_ubicacion_celdas(sheetname, ubicacion)
for i in columnas:
valor = fetch_cell_data(sheetname, fila, i)
if (valor == None):
valor = "-"
valores.append(valor)
return valores
def obtener_valores(ubicacion, sheetname):
lista_valores = []
tamaño_tabla = obtener_tamaño_tabla(sheetname, ubicacion + 3)
for j in range(ubicacion + 3, ubicacion + 3 + tamaño_tabla):
valores = obtener_valores_tabla(sheetname, j, ubicacion+2)
lista_valores.append(valores)
return lista_valores
def obtener_ubicacion_interfaz(sheetname,opcion):
nrows = fetch_number_of_rows(sheetname)
ncol = fetch_number_of_columns(sheetname)
l = []
for i in range(2,nrows+1):
op = fetch_cell_data(sheetname,i,1)
if(op == opcion):
for j in range(3,ncol+1,2):
valor = fetch_cell_data(sheetname,i,j)
l.append(valor)
return l
# FUNCIONES PARA TABLAS SECUNDARIAS - SUBENTIDADES
def buscar_tablas_Secundarias(sheetname):
sh = wk[sheetname]
location = []
nrows = sh.max_row
for i in range(nrows):
valor = fetch_cell_data(sheetname,i+1,2)
if (valor == 'Opción'):
location.append(i+1)
return location
def buscar_tabla_Secundaria(opcion,seccion, sheetname):
list_location = buscar_tablas_Secundarias(sheetname)
location = []
for i in list_location:
valor_opcion = fetch_cell_data(sheetname,i,4)
valor_seccion = fetch_cell_data(sheetname,i+1,4)
if ((valor_opcion == opcion) & (valor_seccion == seccion)):
location.append(i)
return location
def buscar_tabla_Secundaria2(opcion, tipo, sheetname):
list_location = buscar_tablas_Secundarias(sheetname)
location = []
for i in list_location:
valor_opcion = fetch_cell_data(sheetname,i,4)
valor_tipo = fetch_cell_data(sheetname,i+2,4)
if ((valor_opcion == opcion) & (valor_tipo == tipo)):
location.append(i)
return location
def obtener_lista_opciones_Sec(sheetname, ubicacion):
opciones = []
for i in ubicacion:
opcion = fetch_cell_data(sheetname,i,4)
opciones.append(opcion)
return opciones
def obtener_secciones_Secundarias(opcion, sheetname):
secciones = []
ubicaciones = buscar_tablas_Secundarias(sheetname)
for i in ubicaciones:
valor_opcion = fetch_cell_data(sheetname,i,4)
valor_seccion = fetch_cell_data(sheetname,i+1,4)
if(valor_opcion == opcion):
secciones.append(valor_seccion)
return secciones
def obtener_tamaño_tabla_Sec(ubicacion, sheetname):
cant = 0
valor = '-'
while(valor != None):
valor = fetch_cell_data(sheetname,ubicacion + cant,2)
if (valor != None):
cant += 1
return cant
def obtener_ubicacion_celdas_sec(sheetname, fila):
lista_ubicaciones = []
ncol = fetch_number_of_columns(sheetname)
for i in range(2, ncol+1):
valor = fetch_cell_data(sheetname,fila,i)
if ((valor != None) and (valor != " ")):
lista_ubicaciones.append(i)
return lista_ubicaciones
def obtener_valores_tabla_Sec(sheetname, fila, ubicacion):
valores = []
columnas = obtener_ubicacion_celdas_sec(sheetname, ubicacion)
for i in columnas:
valor = fetch_cell_data(sheetname, fila, i)
if (valor == None):
valor = "-"
valores.append(valor)
return valores
def obtener_valores_Sec(ubicacion, sheetname):
lista_valores = []
for i in ubicacion:
tamaño_tabla = obtener_tamaño_tabla_Sec(i + 3, sheetname)
for j in range(i + 3, i + 3 + tamaño_tabla):
valores = obtener_valores_tabla_Sec(sheetname, j, i+2)
lista_valores.append(valores)
return lista_valores
def obtener_valores_Sec_catalog(ubicacion, sheetname):
lista_valores = []
for i in ubicacion:
tamaño_tabla = obtener_tamaño_tabla_Sec(i + 4, sheetname)
for j in range(i + 4, i + 4 + tamaño_tabla):
valores = obtener_valores_tabla_Sec(sheetname, j, i+3)
lista_valores.append(valores)
return lista_valores
def determinar_valores_subseccion(opcion, subsecciones,valores, sheetname):
lista_valores = []
if (opcion == 'Catalogos'):
for i in valores:
ubicacion = buscar_tabla_Secundaria2(opcion, i[2], sheetname)
valores = obtener_valores_Sec_catalog(ubicacion, sheetname)
lista_valores.append(valores)
else:
for i in subsecciones:
ubicacion = buscar_tabla_Secundaria(opcion,i, sheetname)
valores = obtener_valores_Sec(ubicacion, sheetname)
lista_valores.append(valores)
return lista_valores
def determinar_campos_subseccion(tipo, sheetname):
nombres_campos = []
ubicacion = buscar_tabla_Secundaria2('Catalogos',tipo, sheetname)
for i in ubicacion:
tipo_opcion = fetch_cell_data(sheetname,i+2,4)
if (tipo_opcion == tipo):
ncol = fetch_number_of_columns(sheetname)
for j in range(3, ncol):
valor = fetch_cell_data(sheetname,i+3,j)
if (valor != None):
nombres_campos.append(valor)
lista_campos = []
for i in nombres_campos:
if i != " ":
lista_campos.append(i)
return lista_campos
def obtener_campos_subseccion_catalogo(valores, sheetname):
lista_campos = []
for i in valores:
lista = determinar_campos_subseccion(i[2], sheetname)
lista_campos.append(lista)
return lista_campos
def traer_ubicacion_campos_subseccion(sheetname,rango,nombres_campos):
lista_campos = []
inicio = rango[0]
fin = rango[1]
for j in nombres_campos:
for i in range(inicio, fin + 1):
valor_nombre_campo = fetch_cell_data(sheetname, i, 3)
if (valor_nombre_campo == j):
identificador = fetch_cell_data(sheetname, i, 8)
tipo = fetch_cell_data(sheetname, i, 9)
campo = [identificador,tipo]
lista_campos.append(campo)
return lista_campos
def determinar_ubicacion_campos_catalog(opcion,seccion,nombres_campos):
rango = search_location_range('Indice',opcion,seccion)
campos = traer_ubicacion_campos_subseccion('Indice',rango,nombres_campos)
return campos
def obtener_ubicacion_campos_subseccion(opcion, subsecciones, campos):
lista = []
tam = len(subsecciones)
for i in range(0, tam):
if (opcion == 'Catálogos'):
ubicaciones = determinar_ubicacion_campos_catalog(opcion,subsecciones[i],campos[i])
lista.append(ubicaciones)
else:
ubicaciones = determinar_ubicacion_campos(opcion, subsecciones[i])
lista.append(ubicaciones)
return lista
# FUNCION PRINCIPAL
# SERA LA UNICA LLAMADA DE MANERA DIRECTA POR EL ROBOT
def llamar_datos_excel(opcion, ruta_excel,sheetname):
global wk
wk = openpyxl.load_workbook(ruta_excel)
datos = []
# OBTENER INFORMACION SOBRE LA TABLA PRIMARIA
ubicacion = buscar_Opcion(sheetname,opcion)
seccion = obtener_seccion(sheetname,ubicacion)
ubicacion_interfaz = obtener_ubicacion_interfaz('Ubicacion',opcion)
campos = determinar_campos_opcion(opcion, seccion, 'seccion')
valores = obtener_valores(ubicacion, sheetname)
ubicacion_campos_interfaz = determinar_ubicacion_campos(opcion, seccion)
# OBTENER INFORMACION SOBRE LAS TABLAS SECUNDARIAS
subsecciones = obtener_secciones_Secundarias(opcion, sheetname)
longitud = len(subsecciones)
if (longitud != 0):
if (opcion == 'Catalogos'):
campos_subsecciones = obtener_campos_subseccion_catalogo(valores, sheetname)
valores_subsecciones = determinar_valores_subseccion(opcion,subsecciones,valores, sheetname)
ubicacion_campos_subsecciones = obtener_ubicacion_campos_subseccion(opcion, subsecciones, campos_subsecciones)
else:
campos_subsecciones = determinar_campos_opcion(opcion, subsecciones, 'subseccion')
valores_subsecciones = determinar_valores_subseccion(opcion,subsecciones,'', sheetname)
ubicacion_campos_subsecciones = obtener_ubicacion_campos_subseccion(opcion, subsecciones, campos_subsecciones)
else:
campos_subsecciones = []
valores_subsecciones = []
ubicacion_campos_subsecciones = []
# AÑADIR RESULTADOS A DATOS
datos.append(seccion)
datos.append(ubicacion)
datos.append(ubicacion_interfaz)
datos.append(campos)
datos.append(valores)
datos.append(ubicacion_campos_interfaz)
datos.append(subsecciones)
datos.append(campos_subsecciones)
datos.append(valores_subsecciones)
datos.append(ubicacion_campos_subsecciones)
return datos
# datos = llamar_datos_excel('Catalogos',
# "D:\\DATOS 14 10 22\\Escritorio\\Proyectos y Trabajos personales\\Empresa BYTE\\ficheros ROBOT\\Configuracion_API.xlsx",
# 'Parametros')
#
# print('Seccion: ' + str(datos[0]) +
# '\nUbicacion en Excel: ' + str(datos[1]) +
# '\nUbicacion en interfaz: ' + str(datos[2]) +
# '\nCampos: ' + str(datos[3]) +
# '\nValores: ' + str(datos[4]) +
# '\nUbicacion de campos en interfaz: ' + str(datos[5]) +
# '\nSubsecciones: ' + str(datos[6]) +
# '\nCampos de subsecciones: ' + str(datos[7]) +
# '\nValores de subsecciones: ' + str(datos[8]) +
# '\nUbicacion de campos de subsecciones en interfaz: ' + str(datos[9])+
# '\n')
#
# a = buscar_tabla_Secundaria2('Catalogos','Catalogo de celulares','Parametros')
# print(a)
# b = obtener_valores_Sec_catalog(a,'Parametros')
# print(b)
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Library String
Library ../FuncionesPython/FuncionesVarias.py
*** Keywords ***
Obtener ID - AJUSTES
[Arguments] ${header} ${body} ${session} ${API} ${item}
${id_response}= post request ${session} ${API} headers=${header} data=${body}
${N_id_response}= get length ${id_response.content}
IF "${N_id_response}" != "0"
${id_response_string}= convert to string ${id_response.content}
# log to console CONTENIDO DEL RESPONSE EN STRING: ${id_response_string}
${id_response_string2}= cambiarCaracterUTF8 ${id_response_string}
# log to console CONTENIDO DEL RESPONSE EN STRING DESPUES DE FUNCION: ${id_response_string2}
${id_json}= convert string to json ${id_response_string2}
# log to console CONTENIDO DEL RESPONSE EN JSON: ${id_json}
@{value_data}= get value from json ${id_json} data
# log to console DATA DEL JSON: ${value_data}
${n_value_data}= get length ${value_data}
IF "${n_value_data}" != "0"
${list}= get from list ${value_data} 0
ELSE
@{list}= create list
END
${N_LIST}= get length ${list}
IF "${N_LIST}" != "0"
FOR ${item1} IN @{list}
@{value_agente}= get value from json ${item1} partyName
@{value_concept}= get value from json ${item1} concept
${agente}= get from list ${value_agente} 0
${concepto}= get from list ${value_concept} 0
IF "${agente}"=="${item}[1]" and "${concepto}"=="${item}[5]"
@{value_id}= get value from json ${item1} id
${id}= get from list ${value_id} 0
BREAK
ELSE
${id}= set variable -
END
END
ELSE
${id}= set variable -
END
ELSE
${id}= set variable -
END
# log to console ${id}
[return] ${id}
Obtener_ID_PLANES
[Arguments] ${header} ${body} ${session} ${API}
${id_response}= post request ${session} ${API} headers=${header} data=${body}
${N_id_response}= get length ${id_response.content}
IF "${N_id_response}" != "0"
${id_response_string}= convert to string ${id_response.content}
# log to console CONTENIDO DEL RESPONSE EN STRING: ${id_response_string}
${id_response_string2}= cambiarCaracterUTF8 ${id_response_string}
# log to console CONTENIDO DEL RESPONSE EN STRING DESPUES DE FUNCION: ${id_response_string2}
${id_json}= convert string to json ${id_response_string2}
# log to console CONTENIDO DEL RESPONSE EN JSON: ${id_json}
@{value_data}= get value from json ${id_json} data
# log to console DATA DEL JSON: ${value_data}
${list}= get from list ${value_data} 0
${list}= get from list ${list} 0
# log to console DATA DEL JSON (lista): ${list}
@{valueID}= get value from json ${list} id
${id}= get from list ${valueID} 0
@{valueVERSION}= get value from json ${list} version
${version}= get from list ${valueVERSION} 0
ELSE
${id}= set variable -
${version}= set variable -
END
${ID_VERSION}= concatenar ${id} ${version}
log to console ID DEL PLAN: ${ID_VERSION}
[return] ${ID_VERSION}
Obtener ID - Current Version
[Arguments] ${header} ${body} ${session} ${API} ${valor} ${opcion}
${id_response}= post request ${session} ${API} headers=${header} data=${body}
${N_id_response}= get length ${id_response.content}
IF "${N_id_response}" != "0"
${id_response_string}= convert to string ${id_response.content}
# log to console CONTENIDO DEL RESPONSE EN STRING: ${id_response_string}
${id_response_string2}= cambiarCaracterUTF8 ${id_response_string}
# log to console CONTENIDO DEL RESPONSE EN STRING DESPUES DE FUNCION: ${id_response_string2}
${id_json}= convert string to json ${id_response_string2}
# log to console CONTENIDO DEL RESPONSE EN JSON: ${id_json}
@{value_data}= get value from json ${id_json} data
# log to console DATA DEL JSON: ${value_data}
${n_value_data}= get length ${value_data}
IF "${n_value_data}" != "0"
${list}= get from list ${value_data} 0
ELSE
@{list}= create list
END
${N_LIST}= get length ${list}
IF "${N_LIST}" != "0"
FOR ${item} IN @{list}
@{value}= get value from json ${item} currentVersion.id
IF "${opcion}" == "Penalidades"
@{descripcion}= get value from json ${item} description
ELSE IF "${opcion}" == "Excepciones"
@{descripcion}= get value from json ${item} identifier
END
${desc}= get from list ${descripcion} 0
IF "${desc}" == "${valor}"
${id}= get from list ${value} 0
BREAK
ELSE
${id}= set variable -
END
END
ELSE
${id}= set variable -
END
ELSE
${id}= set variable -
END
# log to console ${id}
[return] ${id}
Obtener ID - Agreement Version
[Arguments] ${header} ${body} ${session} ${API} ${valor}
${id_response}= post request ${session} ${API} headers=${header} data=${body}
${N_id_response}= get length ${id_response.content}
IF "${N_id_response}" != "0"
${id_response_string}= convert to string ${id_response.content}
# log to console CONTENIDO DEL RESPONSE EN STRING: ${id_response_string}
${id_response_string2}= cambiarCaracterUTF8 ${id_response_string}
# log to console CONTENIDO DEL RESPONSE EN STRING DESPUES DE FUNCION: ${id_response_string2}
${id_json}= convert string to json ${id_response_string2}
# log to console CONTENIDO DEL RESPONSE EN JSON: ${id_json}
@{value_data}= get value from json ${id_json} data
# log to console DATA DEL JSON: ${value_data}
${n_value_data}= get length ${value_data}
IF "${n_value_data}" != "0"
${list}= get from list ${value_data} 0
ELSE
@{list}= create list
END
${N_LIST}= get length ${list}
IF "${N_LIST}" != "0"
FOR ${item} IN @{list}
@{value}= get value from json ${item} agreementVersion.id
@{descripcion}= get value from json ${item} agreementVersion.description
${desc}= get from list ${descripcion} 0
IF "${desc}" == "${valor}"
${id}= get from list ${value} 0
BREAK
ELSE
${id}= set variable -
END
END
ELSE
${id}= set variable -
END
ELSE
${id}= set variable -
END
# log to console ID: ${id}
[return] ${id}
Obtener_ID
[Arguments] ${header} ${body} ${session} ${API}
${id_response}= post request ${session} ${API} headers=${header} data=${body}
${N_id_response}= get length ${id_response.content}
IF "${N_id_response}" != "0"
${id_response_string}= convert to string ${id_response.content}
# log to console CONTENIDO DEL RESPONSE EN STRING: ${id_response_string}
${id_response_string2}= cambiarCaracterUTF8 ${id_response_string}
# log to console CONTENIDO DEL RESPONSE EN STRING DESPUES DE FUNCION: ${id_response_string2}
${id_json}= convert string to json ${id_response_string2}
# log to console CONTENIDO DEL RESPONSE EN JSON: ${id_json}
@{value_data}= get value from json ${id_json} data
# log to console DATA DEL JSON: ${value_data}
${n_value_data}= get length ${value_data}
IF "${n_value_data}" != "0"
${list}= get from list ${value_data} 0
ELSE
@{list}= create list
END
${N_LIST}= get length ${list}
IF "${N_LIST}" != "0"
FOR ${item} IN @{list}
@{value}= get value from json ${item} id
${id}= get from list ${value} 0
BREAK
END
ELSE
${id}= set variable -
END
ELSE
${id}= set variable -
END
# log to console ${id}
[return] ${id}
Obtener data - calendario excepciones
[Arguments] ${header} ${body} ${session} ${API} ${ID}
IF ("${ID}" == "-") or ("${ID}" == "-&-")
${valores}= set variable -
ELSE
${response}= post request ${session} ${API} headers=${header} data=${body}
${N_response}= get length ${response.content}
${tipo}= mostrar tipo ${response.content}
# log to console TAMAÑO: ${N_response} || TIPO: ${tipo}
IF "${N_response}" != "0"
${response_string}= convert to string ${response.content}
# log to console CONTENIDO DEL RESPONSE EN STRING: ${response_string}
${lista_value_data}= cambiarCaracterUTF8 ${response_string}
${lista_value_data}= quitar corchetes ${lista_value_data}
@{value_data}= split string ${lista_value_data} "delete":false},{"id"
# log to console DATA DEL JSON: ${value_data}
${n_value_data}= get length ${value_data}
# log to console ${n_value_data}
${N_LIST}= get length ${value_data}
IF "${N_LIST}" != "0"
@{valores}= create list
FOR ${i} IN RANGE 0 ${N_LIST}
${n}= sumar ${i} 1
IF ("${i}" != "0") and ("${n}" != "${N_LIST}")
${VALOR_DATA}= concatenar2 {"id" ${value_data}[${i}]
${VALOR_DATA}= concatenar2 ${VALOR_DATA} "delete":false}
ELSE IF "${i}" == "0"
${VALOR_DATA}= concatenar2 ${value_data}[${i}] "delete":false}
ELSE
${VALOR_DATA}= concatenar2 {"id" ${value_data}[${i}]
END
${valor_json}= convert string to json ${VALOR_DATA}
@{ID_CALENDARIO}= get value from json ${valor_json} calendar.id
${id_cal}= get from list ${ID_CALENDARIO} 0
IF "${id_cal}" == "${ID}"
# log to console ITEM: ${valor_json}
append to list ${valores} ${valor_json}
END
END
${n_valores}= get length ${valores}
IF "${valores}" == "0"
${valores}= set variable -
END
ELSE
${valores}= set variable -
END
ELSE
${valores}= set variable -
END
END
# log to console ${valores}
[return] ${valores}
Obtener data
[Arguments] ${header} ${ID} ${session} ${API}
IF ("${ID}" == "-") or ("${ID}" == "-&-")
${valor_json}= set variable -
ELSE
${valor}= get request ${session} ${API}/${ID} headers=${header}
${valor_string}= convert to string ${valor.content}
# log to console CONTENIDO DEL VALOR EN STRING: ${valor_string}
${valor_string2}= cambiarCaracterUTF8 ${valor_string}
# log to console CONTENIDO DEL VALOR EN STRING DESPUES DE FUNCION: ${valor_string2}
${valor_json}= convert string to json ${valor_string2}
# log to console CONTENIDO DEL VALOR EN JSON: ${valor_json}
END
[return] ${valor_json}
Obtener data - condicion intervalos
[Arguments] ${header} ${ID} ${session} ${API} ${body}
log to console ${API}
IF ("${ID}" == "-") or ("${ID}" == "-&-")
${valor_json1}= set variable -
ELSE
${valor}= post request ${session} ${API} headers=${header} data=${body}
${valor_string}= convert to string ${valor.content}
# log to console CONTENIDO DEL VALOR EN STRING: ${valor_string}
${valor_string2}= cambiarCaracterUTF8 ${valor_string}
# log to console CONTENIDO DEL VALOR EN STRING DESPUES DE FUNCION: ${valor_string2}
${valor_json}= convert string to json ${valor_string2}
# log to console CONTENIDO DEL VALOR EN JSON: ${valor_json}
@{value_data}= get value from json ${valor_json} data
${n_value_data}= get length ${value_data}
IF "${n_value_data}" != "0"
${valor_json1}= get from list ${value_data} 0
ELSE
@{valor_json1}= set variable -
END
END
[return] ${valor_json1}
Obtener data - tipo cambio
[Arguments] ${header} ${body} ${session} ${API} ${item}
${fecha_excel}= change format date2 ${item}[3]
${response}= post request ${session} ${API} headers=${header} data=${body}
${Nresponse}= get length ${response.content}
IF "${Nresponse}" != "0"
${id_response_string}= convert to string ${response.content}
# log to console CONTENIDO DEL RESPONSE EN STRING: ${id_response_string}
${id_response_string2}= cambiarCaracterUTF8 ${id_response_string}
# log to console CONTENIDO DEL RESPONSE EN STRING DESPUES DE FUNCION: ${id_response_string2}
${id_json}= convert string to json ${id_response_string2}
# log to console CONTENIDO DEL RESPONSE EN JSON: ${id_json}
@{value_data}= get value from json ${id_json} data
# log to console DATA DEL JSON: ${value_data}
${n_value_data}= get length ${value_data}
IF "${n_value_data}" != "0"
${list}= get from list ${value_data} 0
ELSE
@{list}= create list
END
${N_LIST}= get length ${list}
IF "${N_LIST}" != "0"
FOR ${item_json} IN @{list}
# log to console DATOS: ${item_json}
${fecha}= get value from json ${item_json} startDate
# log to console FECHA: ${fecha}
# log to console FECHA EXCEL: ${fecha_excel}
IF "${fecha}[0]" == "${fecha_excel}"
${valores}= set variable ${item_json}
BREAK
ELSE
${valores}= set variable -
END
END
ELSE
${valores}= set variable -
END
ELSE
${valores}= set variable -
END
# log to console ${valores}
[return] ${valores}
Obtener data - catalogos
[Arguments] ${header} ${body} ${ID} ${session} ${API}
IF ("${ID}" == "-")
${valor_json}= set variable -
ELSE
${valor}= post request ${session} ${API}/${ID} headers=${header} data=${body}
${valor_string}= convert to string ${valor.content}
# log to console CONTENIDO DEL VALOR EN STRING: ${valor_string}
${valor_string2}= cambiarCaracterUTF8 ${valor_string}
# log to console CONTENIDO DEL VALOR EN STRING DESPUES DE FUNCION: ${valor_string2}
# ${valor_string3}= convert to string ${valor_string2}
${valor_json}= convert string to json ${valor_string2}
# log to console CONTENIDO DEL VALOR EN JSON: ${valor_json}
@{value_data}= get value from json ${valor_json} data
# log to console ${value_data}
END
[return] ${value_data}
This source diff could not be displayed because it is too large. You can view the blob instead.
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Library ../FuncionesPython/FuncionesVarias.py
Variables ../../Variables/variables.py
*** Keywords ***
Imprimir en consola
[Arguments] ${resultado} ${val_excel} ${val_api}
${json}= mostrar json en consola ${resultado} ${val_excel} ${val_api}
log to console ${json}
Realizar reporte
[Arguments] ${resultado} ${val_excel} ${val_api} ${flag_reporte} ${reporte} ${valores} ${tipo_tabla} ${opcion} ${subseccion}
IF "${flag_reporte}" == "CONSOLA"
Imprimir en consola ${resultado} ${val_excel} ${val_api}
ELSE IF "${flag_reporte}" == "REPORTE"
IF '${tipo_tabla}' == 'PRIMARIA'
llenarreporte ${reporte} ${opcion} ${resultado} ${val_excel} ${val_api} ${valores}[0] En Proceso
ELSE
llenarReporte Subentidad ${reporte} ${opcion} ${valores}[0] ${resultado} ${val_excel} ${val_api} ${subseccion}
END
ELSE IF "${flag_reporte}" == "AMBOS"
Imprimir en consola ${resultado} ${val_excel} ${val_api}
IF '${tipo_tabla}' == 'PRIMARIA'
llenarreporte ${reporte} ${opcion} ${resultado} ${val_excel} ${val_api} ${valores}[0] En Proceso
ELSE
llenarReporte Subentidad ${reporte} ${opcion} ${valores}[0] ${resultado} ${val_excel} ${val_api} ${subseccion}
END
END
Esta vacio
[Arguments] ${cadena1} ${cadena2}
${resultado}= set variable -
IF """${cadena1}""" != """${cadena2}"""
${resultado}= set variable SI
ELSE
${resultado}= set variable NO
END
[return] ${resultado}
Obtener tipo de identificador
[Arguments] ${opcion} ${subseccion}
${TIPO}= set variable -
IF "${opcion}"=="Tipos de catálogo"
IF "${subseccion}"=="Atributo"
${TIPO}= set variable identifier
END
ELSE IF "${opcion}" == "Valores posibles"
IF "${subseccion}" == "Elemento"
${TIPO}= set variable identifier
END
ELSE IF "${opcion}" == "Conceptos"
IF "${subseccion}" == "Elemento"
${TIPO}= set variable sourceValue
END
ELSE IF "${opcion}" == "Equivalencias"
IF "${subseccion}" == "Elemento"
${TIPO}= set variable targetValue
END
ELSE IF "${opcion}" == "Clase Ubigeo"
IF "${subseccion}" == "Estructura"
${TIPO}= set variable order
END
ELSE IF "${opcion}" == "Impuestos"
IF "${subseccion}" == "Tasa"
${TIPO}= set variable rate
END
ELSE IF "${opcion}" == "Gestor Agentes - Organización"
IF "${subseccion}" == "Detalle"
${TIPO}= set variable individualName
ELSE IF "${subseccion}" == "Segmentos"
${TIPO}= set variable segmentationTagBean.tag
END
ELSE IF "${opcion}" == "Repositorios"
IF "${subseccion}" == "Conexion insumo"
${TIPO}= set variable name
END
ELSE IF "${opcion}" == "Plan de comision"
IF "${subseccion}" == "Estructuras de comision"
${TIPO}= set variable commissionStructureVersion.description
ELSE IF "${subseccion}" == "Estructuras de bonificacion"
${TIPO}= set variable bonusPlanVersion.description
END
ELSE IF "${opcion}" == "Catalogos"
IF "${subseccion}" == "Elemento"
${TIPO}= set variable tag
END
ELSE IF "${opcion}" == "Penalidades"
IF "${subseccion}" == "Origen de la penalidad"
${TIPO}= set variable itemClass
ELSE IF "${subseccion}" == "Item de Condición"
${TIPO}= set variable itemClass
ELSE IF "${subseccion}" == "Reglas de calculo de penalidad"
${TIPO}= set variable rule
ELSE IF "${subseccion}" == "Rango de condicion"
${TIPO}= set variable startRange
END
ELSE IF "${opcion}" == "Calendario"
IF "${subseccion}" == "Dia de Semana"
${TIPO}= set variable dayOfWeek
ELSE IF "${subseccion}" == "Excepciones"
${TIPO}= set variable description
END
ELSE IF "${opcion}" == "Intervalo"
IF "${subseccion}" == "Condicion"
${TIPO}= set variable nick
ELSE IF "${subseccion}" == "Rango"
${TIPO}= set variable startRange
END
ELSE IF "${opcion}" == "Matriz de puntos"
IF "${subseccion}" == "Elementos de la matriz"
${TIPO}= set variable description
ELSE IF "${subseccion}" == "Distribucion de puntos"
${TIPO}= set variable startRange
END
ELSE IF "${opcion}" == "Excepciones"
IF "${subseccion}" == "Origen de excepción"
${TIPO}= set variable itemClass
ELSE IF "${subseccion}" == "Item de evaluación"
${TIPO}= set variable itemClass
ELSE IF "${subseccion}" == "Tipo de excepciones"
${TIPO}= set variable type
ELSE IF "${subseccion}" == "Tipo de excepciones - Rango"
${TIPO}= set variable type
END
ELSE IF "${opcion}" == "Acuerdos"
IF "${subseccion}" == "Oferta comercial"
${TIPO}= set variable commissionStructureVersion.description
ELSE IF "${subseccion}" == "Roles comisionistas"
${TIPO}= set variable commissionStructureVersion.description
ELSE IF "${subseccion}" == "Asignacion de metas por criterios"
${TIPO}= set variable concept
END
ELSE IF "${opcion}" == "Insumos"
IF "${subseccion}" == "Detalle de fichero - estructura"
${TIPO}= set variable name
ELSE IF "${subseccion}" == "Detalle de fichero - campos"
${TIPO}= set variable name
ELSE IF "${subseccion}" == "Enlace"
${TIPO}= set variable sourceFileInputName
END
ELSE IF "${opcion}" == "Estructura de Comisión"
IF "${subseccion}" == "Oferta Comercial"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Criterio de verificación"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Rol al que aplica"
${TIPO}= set variable partyRoleName
ELSE IF "${subseccion}" == "Origen de la comisión"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Criterios de la meta"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Item de Condición"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Cumplimiento"
${TIPO}= set variable -
ELSE IF "${subseccion}" == "Condiciones para el cálculo de meta"
${TIPO}= set variable -
ELSE IF "${subseccion}" == "Rangos"
${TIPO}= set variable startRange
ELSE IF "${subseccion}" == "Selección de distribucion"
${TIPO}= set variable -
ELSE IF "${subseccion}" == "Comision periodica"
${TIPO}= set variable period
ELSE IF "${subseccion}" == "Comision periodica - Oferta comercial"
${TIPO}= set variable period
ELSE IF "${subseccion}" == "Comision periodica - Origen de comision"
${TIPO}= set variable period
ELSE IF "${subseccion}" == "Distribucion"
${TIPO}= set variable period
ELSE IF "${subseccion}" == "Distribucion - Pago Condicionado"
${TIPO}= set variable period
ELSE IF "${subseccion}" == "Distribucion - Clawback"
${TIPO}= set variable period
ELSE IF "${subseccion}" == "Distribucion - Condiciones Clawback"
${TIPO}= set variable period
ELSE IF "${subseccion}" == "Condiciones Alteran Distribución - E"
${TIPO}= set variable -
ELSE IF "${subseccion}" == "Condiciones Alteran Distribución"
${TIPO}= set variable startRange
END
END
[return] ${TIPO}
Modificar tipo de identificador - estructura
[Arguments] ${json_plan} ${nombre_estructura}
${id}= set variable -
@{data_plan}= get value from json ${json_plan} planVersion.planConceptList
@{lista_estructuras_plan}= get from list ${data_plan} 0
# log to console DATOS DEL PLAN: ${lista_estructuras_plan}
${n_data_plan}= get length ${lista_estructuras_plan}
# log to console CANTIDAD DE ESTRUCTURAS DENTRO DEL PLAN: ${n_data_plan}
FOR ${i} IN RANGE 0 ${n_data_plan}
@{tipo_estructura}= get value from json ${lista_estructuras_plan}[${i}] type
${tipo}= get from list ${tipo_estructura} 0
# log to console TIPO DE ESTRUCTURA: ${tipo}
IF "${tipo}"=="C"
@{nombre_estructura_API}= get value from json ${lista_estructuras_plan}[${i}] commissionStructureVersion.description
${nombre}= get from list ${nombre_estructura_API} 0
# log to console NOMBRE DE ESTRUCTURA: ${nombre}
IF "${nombre}" == "${nombre_estructura}"
@{id_estructura}= get value from json ${lista_estructuras_plan}[${i}] id
${id}= get from list ${id_estructura} 0
BREAK
END
ELSE
@{nombre_estructura_API}= get value from json ${data_plan}[${i}] bonusPlanVersion.description
${nombre}= get from list ${nombre_estructura_API} 0
# log to console NOMBRE DE ESTRUCTURA: ${nombre}
IF "${nombre}" == "${nombre_estructura}"
@{id_estructura}= get value from json ${data_plan}[${i}] id
${id}= get from list ${id_estructura} 0
BREAK
END
END
END
log to console ID DE ESTRUCTURA: ${id}
[return] ${id}
Obtener tipo de identificador2
[Arguments] ${opcion} ${subseccion}
${TIPO}= set variable -
IF "${opcion}"=="Excepciones"
IF "${subseccion}"=="Tipo de excepciones - Rango"
${TIPO}= set variable startRange
END
ELSE IF "${opcion}" == "Acuerdos"
IF "${subseccion}" == "Oferta comercial"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Roles comisionistas"
${TIPO}= set variable partyRoleName
ELSE IF "${subseccion}" == "Asignacion de metas por criterios"
${TIPO}= set variable criteria
END
ELSE IF "${opcion}" == "Insumos"
IF "${subseccion}" == "Detalle de fichero - campos"
${TIPO}= set variable fileField.identifier
END
ELSE IF "${opcion}" == "Estructura de Comisión"
IF "${subseccion}" == "Comision periodica - Oferta comercial"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Comision periodica - Origen de comision"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Distribucion - Pago Condicionado"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Distribucion - Clawback"
${TIPO}= set variable value
ELSE IF "${subseccion}" == "Condiciones Alteran Distribución"
${TIPO}= set variable conceptDistributionPeriod
ELSE IF "${subseccion}" == "Rangos"
${TIPO}= set variable quantity
END
END
[return] ${TIPO}
Obtener identificador subentidad
[Arguments] ${opcion} ${subseccion} ${valores_subseccion}
${identificador}= set variable -
IF "${opcion}"=="Tipos de catálogo"
IF "${subseccion}"=="Atributo"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Valores posibles"
IF "${subseccion}" == "Elemento"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Conceptos"
IF "${subseccion}" == "Elemento"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Equivalencias"
IF "${subseccion}" == "Elemento"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Clase Ubigeo"
IF "${subseccion}" == "Estructura"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Impuestos"
IF "${subseccion}" == "Tasa"
${identificador}= get from list ${valores_subseccion} 2
END
ELSE IF "${opcion}" == "Gestor Agentes - Organización"
IF "${subseccion}" == "Detalle"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Segmentos"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Repositorios"
IF "${subseccion}" == "Conexion insumo"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Plan de comision"
IF "${subseccion}" == "Estructuras de comision"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Estructuras de bonificacion"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Penalidades"
IF "${subseccion}" == "Origen de la penalidad"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Item de Condición"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Reglas de calculo de penalidad"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Rango de condicion"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Calendario"
IF "${subseccion}" == "Dia de Semana"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Excepciones"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Intervalo"
IF "${subseccion}" == "Condicion"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Rango"
${identificador}= get from list ${valores_subseccion} 2
END
ELSE IF "${opcion}" == "Matriz de puntos"
IF "${subseccion}" == "Elementos de la matriz"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Distribucion de puntos"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Excepciones"
IF "${subseccion}" == "Origen de excepción"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Item de evaluación"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Tipo de excepciones"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Tipo de excepciones - Rango"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Acuerdos"
IF "${subseccion}" == "Oferta comercial"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Roles comisionistas"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Asignacion de metas por criterios"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Acuerdos"
IF "${subseccion}" == "Oferta comercial"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Roles comisionistas"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Asignacion de metas por criterios"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Insumos"
IF "${subseccion}" == "Detalle de fichero - estructura"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Detalle de fichero - campos"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Enlace"
${identificador}= get from list ${valores_subseccion} 1
END
ELSE IF "${opcion}" == "Estructura de Comisión"
IF "${subseccion}" == "Oferta Comercial"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Criterio de verificación"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Rol al que aplica"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Origen de la comisión"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Criterios de la meta"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Item de Condición"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Cumplimiento"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Condiciones para el cálculo de meta"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Rangos"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Selección de distribucion"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Comision periodica"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Comision periodica - Oferta comercial"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Comision periodica - Origen de comision"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Distribucion"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Distribucion - Pago Condicionado"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Distribucion - Clawback"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Distribucion - Condiciones Clawback"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Condiciones Alteran Distribución - E"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Condiciones Alteran Distribución"
${identificador}= get from list ${valores_subseccion} 2
END
END
[return] ${identificador}
Obtener identificador2 subentidad
[Arguments] ${opcion} ${subseccion} ${valores_subseccion}
${identificador}= set variable -
IF "${opcion}"=="Excepciones"
IF "${subseccion}" == "Tipo de excepciones - Rango"
${identificador}= get from list ${valores_subseccion} 2
END
ELSE IF "${opcion}" == "Acuerdos"
IF "${subseccion}" == "Oferta comercial"
${identificador}= get from list ${valores_subseccion} 2
ELSE IF "${subseccion}" == "Roles comisionistas"
${identificador}= get from list ${valores_subseccion} 2
ELSE IF "${subseccion}" == "Asignacion de metas por criterios"
${identificador}= get from list ${valores_subseccion} 2
END
ELSE IF "${opcion}" == "Insumos"
IF "${subseccion}" == "Detalle de fichero - campos"
${identificador}= get from list ${valores_subseccion} 2
END
ELSE IF "${opcion}" == "Estructura de Comisión"
IF "${subseccion}" == "Comision periodica - Oferta comercial"
${identificador}= get from list ${valores_subseccion} 2
ELSE IF "${subseccion}" == "Comision periodica - Origen de comision"
${identificador}= get from list ${valores_subseccion} 2
ELSE IF "${subseccion}" == "Distribucion - Pago Condicionado"
${identificador}= get from list ${valores_subseccion} 2
ELSE IF "${subseccion}" == "Distribucion - Clawback"
${identificador}= get from list ${valores_subseccion} 2
ELSE IF "${subseccion}" == "Condiciones Alteran Distribución"
${identificador}= get from list ${valores_subseccion} 1
ELSE IF "${subseccion}" == "Rangos"
${identificador}= get from list ${valores_subseccion} 3
END
END
[return] ${identificador}
Obtener ID - CAMPOS CATALOGOS
[Arguments] ${datos_API} ${nombre_campo_json}
${lista_id}= get value from json ${datos_API} catalogType.characteristicSpecificationBeanList[*].${nombre_campo_json}
log to console ${lista_id}
[return] ${lista_id}
Obtener JSON - CAMPOS CATALOGOS
[Arguments] ${datos_catalogo} ${lista_id} ${lista_campos} ${valor_identificador} ${UBICACION}
${n_datos}= get length ${datos_catalogo}
${n_ID}= get length ${lista_id}
${n_CAMPOS}= get length ${lista_campos}
${identificador}= get from list ${lista_id} ${UBICACION}
# log to console N CATALOGO: ${n_datos}
# log to console IDENTIFICADOR: ${identificador}
${JSON_CAMPOS}= set variable -
FOR ${i} IN RANGE 0 ${n_datos}
# log to console DATOS CATALOGO: ${datos_catalogo}[${i}]
${list}= get from list ${datos_catalogo} ${i}
${string}= convert to string ${list}
# log to console DATOS CATALOGO STRING: ${string}
${json}= modificar comillas ${string}
# log to console DATOS CATALOGO STRING MODIFICADO: ${json}
${tipo}= mostrar tipo ${json}
# log to console ${tipo}
# ${json}= convert string to json ${string2}
# log to console DATOS CATALOGO JSON: ${json}
${ident}= convert to string ${identificador}
# log to console IDENTIFICADOR JSON: ${ident}
${ID}= get value from json ${json} '${ident}'
# log to console ID: ${ID}
IF "${ID}[0]" == "${valor_identificador}"
${JSON_CAMPOS}= set variable ${json}
BREAK
END
END
log to console JSON DEL CAMPO: ${JSON_CAMPOS}
[return] ${JSON_CAMPOS}
Obtener VALOR - CAMPOS CATALOGOS
[Arguments] ${datos_catalogo} ${lista_id} ${lista_campos} ${campo}
# log to console Campos: ${lista_campos}
# log to console Campo: ${campo}
# log to console JSON: ${datos_catalogo}
${n_datos}= get length ${datos_catalogo}
${n_ID}= get length ${lista_id}
${n_CAMPOS}= get length ${lista_campos}
FOR ${i} IN RANGE 0 ${n_CAMPOS}
# log to console ${lista_campos}[${i}]
IF "${campo}" == "${lista_campos}[${i}]"
${ubicacion}= set variable ${i}
BREAK
ELSE IF (("${campo}" == "Descripcion") and ("Descripción" == "${lista_campos}[${i}]")) or (("${campo}" == "Descripción") and ("Descripcion" == "${lista_campos}[${i}]"))
${ubicacion}= set variable ${i}
BREAK
ELSE
${ubicacion}= set variable -
END
END
# log to console UBICACION: ${ubicacion}
IF "${ubicacion}" != "-"
${ID_CAMPO}= get from list ${lista_id} ${ubicacion}
${VALOR}= get value from json ${datos_catalogo} '${ID_CAMPO}'
ELSE
${VALOR}= set variable -
END
# log to console ${VALOR}
[return] ${VALOR}
Obtener identificador - CATALOGOS
[Arguments] ${lista_campos_json} ${campos_excel}
${n_CAMPOS_EXCEL}= get length ${campos_excel}
${n_CAMPOS_JSON}= get length ${lista_campos_json}
IF "${campos_excel}[0]" == "Descripción"
${campo}= set variable Descripcion
ELSE
${campo}= get from list ${campos_excel} 0
END
# log to console ${campo}
${UBICACION_LISTA}= set variable -
FOR ${i} IN RANGE 0 ${n_CAMPOS_JSON}
IF "${campo}" == "${lista_campos_json}[${i}]"
${UBICACION_LISTA}= set variable ${i}
BREAK
END
END
[return] ${UBICACION_LISTA}
Obtener JSON - EXCEPCIONES
[Arguments] ${lista_json} ${valores_excel}
${JSON}= set variable -
IF "${lista_json}" != "-"
${n_lista_json}= get length ${lista_json}
FOR ${i} IN RANGE 0 ${n_lista_json}
${json_actual}= get from list ${lista_json} ${i}
@{descripcion}= get value from json ${json_actual} description
@{Tipo_excepcion}= get value from json ${json_actual} calendarExceptionType
@{Tipo_frecuencia}= get value from json ${json_actual} frequencyType
${desc}= get from list ${descripcion} 0
${excep}= get from list ${Tipo_excepcion} 0
${frec}= get from list ${Tipo_frecuencia} 0
${descripcion_excel}= get from list ${valores_excel} 1
${tipo_excel}= get from list ${valores_excel} 2
${tipo_excel}= modificar valor excel ${tipo_excel} Tipo
${frecuencia_excel}= get from list ${valores_excel} 3
${frecuencia_excel}= modificar valor excel ${frecuencia_excel} Frecuencia
IF ("${descripcion_excel}"=="${desc}") and ("${tipo_excel}"=="${excep}") and ("${frecuencia_excel}"=="${frec}")
${JSON}= set variable ${json_actual}
BREAK
END
END
END
[return] ${JSON}
Obtener data - rango intervalo
[Arguments] ${ID}
&{header}= create dictionary Content-Type=application/json Authorization=${TOKEN}
${API}= set variable /service/config-service/interval-condition/${ID}/ranges
IF ("${ID}" == "-") or ("${ID}" == "-&-")
${valor_json}= set variable -
ELSE
${valor}= get request ${session} ${API} headers=${header}
${valor_string}= convert to string ${valor.content}
# log to console CONTENIDO DEL VALOR EN STRING: ${valor_string}
${valor_string2}= cambiarCaracterUTF8 ${valor_string}
# log to console CONTENIDO DEL VALOR EN STRING DESPUES DE FUNCION: ${valor_string2}
${valor_json}= convert string to json ${valor_string2}
# log to console CONTENIDO DEL VALOR EN JSON: ${valor_json}
${n_valor_json}= get length ${valor_json}
END
[return] ${valor_json}
Obtener identificador - matriz dist puntos
[Arguments] ${JSON} ${elementos_excel}
@{Lista_elementos}= create list
@{JSON_combination_item}= get value from json ${JSON} pointMatrixCombinationItemList[*]
# log to console Combinacion: ${JSON_combination_item}
${n_JSON}= get length ${JSON_combination_item}
FOR ${i} IN RANGE 0 ${n_JSON}
${json_actual}= get from list ${JSON_combination_item} ${i}
@{valor_actual}= get value from json ${json_actual} description
${valor}= get from list ${valor_actual} 0
append to list ${Lista_elementos} ${valor}
END
${n_lista_combinacion}= get length ${Lista_elementos}
# log to console LISTA API: ${Lista_elementos}
# log to console LISTA EXCEL: ${elementos_excel}
${resultado}= elemento API esta en Lista elemento EXCEL ${Lista_elementos} ${elementos_excel}
# log to console ${resultado}
IF ("${resultado}"=="True")
# log to console LISTA API: ${Lista_elementos}
# log to console LISTA EXCEL: ${elementos_excel}
@{id_actual}= get value from json ${JSON} id
${id}= get from list ${id_actual} 0
ELSE
${id}= set variable -
END
# log to console ${id}
[return] ${id}
Obtener ID - plan acuerdo
[Arguments] ${data_json}
# log to console ${data_json}
IF "${data_json}" != "-"
@{valor}= get value from json ${data_json} agreementVersion.planVersionId
${id}= get from list ${valor} 0
ELSE
${id}= set variable -
END
log to console ${id}
[return] ${id}
MODIFICAR ID ESTRUCTURA
[Arguments] ${json_plan} ${nombre_estructura}
${id}= set variable -
@{data_plan}= get value from json ${json_plan} planVersion.planConceptList
@{lista_estructuras_plan}= get from list ${data_plan} 0
# log to console DATOS DEL PLAN: ${lista_estructuras_plan}
${n_data_plan}= get length ${lista_estructuras_plan}
# log to console CANTIDAD DE ESTRUCTURAS DENTRO DEL PLAN: ${n_data_plan}
FOR ${i} IN RANGE 0 ${n_data_plan}
@{tipo_estructura}= get value from json ${lista_estructuras_plan}[${i}] type
${tipo}= get from list ${tipo_estructura} 0
# log to console TIPO DE ESTRUCTURA: ${tipo}
IF "${tipo}"=="C"
@{nombre_estructura_API}= get value from json ${lista_estructuras_plan}[${i}] commissionStructureVersion.description
${nombre}= get from list ${nombre_estructura_API} 0
# log to console NOMBRE DE ESTRUCTURA: ${nombre}
IF "${nombre}" == "${nombre_estructura}"
@{id_estructura}= get value from json ${lista_estructuras_plan}[${i}] id
${id}= get from list ${id_estructura} 0
BREAK
END
ELSE
@{nombre_estructura_API}= get value from json ${data_plan}[${i}] bonusPlanVersion.description
${nombre}= get from list ${nombre_estructura_API} 0
# log to console NOMBRE DE ESTRUCTURA: ${nombre}
IF "${nombre}" == "${nombre_estructura}"
@{id_estructura}= get value from json ${data_plan}[${i}] id
${id}= get from list ${id_estructura} 0
BREAK
END
END
END
# log to console ID DE ESTRUCTURA: ${id}
[return] ${id}
Modificar identificador - tipo de criterio
[Arguments] ${json}
${tipo}= set variable -
@{data}= get value from json ${json} valueType
${tipo_valor}= get from list ${data} 0
IF "${tipo_valor}" == "C"
${tipo}= set variable itemCatalog
ELSE IF "${tipo_valor}" == "O"
${tipo}= set variable value
END
# log to console TIPO DE ESTRUCTURA: ${id}
[return] ${tipo}
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../Componentes/MenuAgentes/Roles.robot
Resource ../Componentes/MenuAgentes/Individuos.robot
Resource ../Componentes/MenuAgentes/Organizaciones.robot
Library ../Funciones/FuncionesPython/LecturaExcel.py
Library ../Funciones/FuncionesPython/FuncionesReporte.py
Variables ../Variables/variables.py
*** Variables ***
*** Test Cases ***
TC VALIDACION DEL MENU DE CONFIGURACION
Create Session ${session} ${URL_BASE}
${reporte}= crear reporte ${ruta_reporte}
# ${data_excel}= llamar datos excel Roles ${ruta_excel} Agentes
# VALIDAR ROLES ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Gestor Agentes - Individuos ${ruta_excel} Agentes
# VALIDAR INDIVIDUOS ${data_excel} ${flag_reporte} ${reporte}
${data_excel}= llamar datos excel Gestor Agentes - Organización ${ruta_excel} Agentes
VALIDAR ORGANIZACIONES ${data_excel} ${flag_reporte} ${reporte}
llenarreporte ${reporte} - - - - - Terminado
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../Componentes/MenuConfiguracion/Calendarios.robot
Resource ../Componentes/MenuConfiguracion/Catalogos.robot
Resource ../Componentes/MenuConfiguracion/CicloLiquidacion.robot
Resource ../Componentes/MenuConfiguracion/ClaseUbigeo.robot
Resource ../Componentes/MenuConfiguracion/Conceptos.robot
Resource ../Componentes/MenuConfiguracion/Equivalencias.robot
Resource ../Componentes/MenuConfiguracion/Impuestos.robot
Resource ../Componentes/MenuConfiguracion/Intervalos.robot
Resource ../Componentes/MenuConfiguracion/Moneda.robot
Resource ../Componentes/MenuConfiguracion/ParametroNegocio.robot
Resource ../Componentes/MenuConfiguracion/ParametroSistema.robot
Resource ../Componentes/MenuConfiguracion/TareaProgramada.robot
Resource ../Componentes/MenuConfiguracion/TipoCambio.robot
Resource ../Componentes/MenuConfiguracion/TipoCatalogo.robot
Resource ../Componentes/MenuConfiguracion/TiposAjuste.robot
Resource ../Componentes/MenuConfiguracion/Ubigeo.robot
Resource ../Componentes/MenuConfiguracion/ValoresPosibles.robot
Library ../Funciones/FuncionesPython/LecturaExcel.py
Library ../Funciones/FuncionesPython/FuncionesReporte.py
Variables ../Variables/variables.py
*** Variables ***
*** Test Cases ***
TC VALIDACION DEL MENU DE CONFIGURACION
Create Session ${session} ${URL_BASE}
${reporte}= crear reporte ${ruta_reporte}
${data_excel}= llamar datos excel Parámetros de sistema ${ruta_excel} Parametros
VALIDAR PARAMETROS DE SISTEMA ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Parametros de Negocio ${ruta_excel} Parametros
# VALIDAR PARAMETROS DE NEGOCIO ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Tareas Programadas ${ruta_excel} Parametros
# VALIDAR TAREAS PROGRAMADAS ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Moneda ${ruta_excel} Parametros
# VALIDAR MONEDAS ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Ubigeo ${ruta_excel} Parametros
# VALIDAR UBIGEOS ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Tipos de Ajuste ${ruta_excel} Parametros
# VALIDAR TIPOS DE AJUSTES ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Calendario ${ruta_excel} Parametros
# VALIDAR CALENDARIOS ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Tipos de catálogo ${ruta_excel} Parametros
# VALIDAR TIPOS CATALOGOS ${data_excel} ${flag_reporte} ${reporte}
# NECESITA LA FUNCION ENCODE
# ${data_excel}= llamar datos excel Catalogos ${ruta_excel} Parametros
# VALIDAR CATALOGOS ${data_excel} ${flag_reporte} ${reporte}
##
# ${data_excel}= llamar datos excel Valores posibles ${ruta_excel} Parametros
# VALIDAR VALORES POSIBLES ${data_excel} ${flag_reporte} ${reporte}
# NECESITA FUNCION BUSQUEDA
# ${datos}= llamar datos excel Tipo de Cambio ${ruta_excel} Parametros
# validar tipo de cambios ${datos} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Ciclos de Liquidacion ${ruta_excel} Parametros
# VALIDAR CICLOS LIQUIDACION ${data_excel} ${flag_reporte} ${reporte}
##
# ${data_excel}= llamar datos excel Conceptos ${ruta_excel} Parametros
# VALIDAR CONCEPTOS ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Equivalencias ${ruta_excel} Parametros
# VALIDAR EQUIVALENCIAS ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Impuestos ${ruta_excel} Parametros
# VALIDAR IMPUESTOS ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Clase Ubigeo ${ruta_excel} Parametros
# VALIDAR CLASES UBIGEO ${data_excel} ${flag_reporte} ${reporte}
#
# ${data_excel}= llamar datos excel Intervalo ${ruta_excel} Parametros
# VALIDAR INTERVALOS ${data_excel} ${flag_reporte} ${reporte}
llenarreporte ${reporte} - - - - - Terminado
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../Componentes/MenuExtraccion/Conexiones.robot
Resource ../Componentes/MenuExtraccion/Credenciales.robot
Resource ../Componentes/MenuExtraccion/Insumos.robot
Resource ../Componentes/MenuExtraccion/Repositorios.robot
Resource ../Componentes/MenuConfiguracion/ParametroSistema.robot
Library ../Funciones/FuncionesPython/LecturaExcel.py
Library ../Funciones/FuncionesPython/FuncionesReporte.py
Variables ../Variables/variables.py
*** Variables ***
*** Test Cases ***
TC VALIDACION DEL MENU DE EXTRACCION
Create Session ${session} ${URL_BASE}
${reporte}= crear reporte ${ruta_reporte}
# ${data_excel}= llamar datos excel Credenciales ${ruta_excel} Extraccion
# VALIDAR CREDENCIALES ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Conexiones ${ruta_excel} Extraccion
# VALIDAR CONEXIONES ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Repositorios ${ruta_excel} Extraccion
# VALIDAR REPOSITORIOS ${data_excel} ${flag_reporte} ${reporte}
${data_excel}= llamar datos excel Insumos ${ruta_excel} Extraccion
VALIDAR INSUMOS ${data_excel} ${flag_reporte} ${reporte}
llenarreporte ${reporte} - - - - - Terminado
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../Componentes/MenuGestores/Acuerdos.robot
Resource ../Componentes/MenuGestores/Ajustes.robot
Resource ../Componentes/MenuGestores/Estructuras.robot
Resource ../Componentes/MenuGestores/Excepciones.robot
Resource ../Componentes/MenuGestores/Matrices.robot
Resource ../Componentes/MenuGestores/Penalidades.robot
Resource ../Componentes/MenuGestores/Planes.robot
Library ../Funciones/FuncionesPython/LecturaExcel.py
Library ../Funciones/FuncionesPython/FuncionesReporte.py
Variables ../Variables/variables.py
*** Variables ***
*** Test Cases ***
TC VALIDACION DEL MENU DE GESTORES
Create Session ${session} ${URL_BASE}
${reporte}= crear reporte ${ruta_reporte}
# ${data_excel}= llamar datos excel Ajustes ${ruta_excel} Gestores
# VALIDAR AJUSTES ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Plan de comision ${ruta_excel} Gestores
# VALIDAR PLANES ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Penalidades ${ruta_excel} Gestores
# VALIDAR PENALIDADES ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Matriz de puntos ${ruta_excel} Gestores
# VALIDAR MATRICES ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Excepciones ${ruta_excel} Gestores
# VALIDAR EXCEPCIONES ${data_excel} ${flag_reporte} ${reporte}
# ${data_excel}= llamar datos excel Acuerdos ${ruta_excel} Gestores
# VALIDAR ACUERDOS ${data_excel} ${flag_reporte} ${reporte}
${data_excel}= llamar datos excel Estructura de Comisión ${ruta_excel} Gestores
VALIDAR ESTRUCTURAS ${data_excel} ${flag_reporte} ${reporte}
llenarreporte ${reporte} - - - - - Terminado
\ No newline at end of file
*** Settings ***
Library RequestsLibrary
Library JSONLibrary
Library Collections
Library SeleniumLibrary
Resource ../Funciones/FuncionesRobot/FuncionesAPI.robot
Resource ../Componentes/MenuInterfaz/Filtros.robot
Resource ../Componentes/MenuInterfaz/Vistas.robot
Library ../Funciones/FuncionesPython/LecturaExcel.py
Library ../Funciones/FuncionesPython/FuncionesReporte.py
Variables ../Variables/variables.py
*** Test Cases ***
TC VALIDACION DEL MENU DE INTERFAZ
Create Session ${session} ${URL_BASE}
${reporte}= crear reporte ${ruta_reporte}
${data_excel}= llamar datos excel Vista ${ruta_excel} Interfaz
VALIDAR VISTAS ${data_excel} ${flag_reporte} ${reporte}
${data_excel}= llamar datos excel Filtro ${ruta_excel} Interfaz
VALIDAR FILTROS ${data_excel} ${flag_reporte} ${reporte}
llenarreporte ${reporte} - - - - - Terminado
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
PARAMETRO DE NEGOCIO
http://int.bcom.tbs.com:980/service/config-service/business-parameter/page
http://int.bcom.tbs.com:980/service/config-service/business-parameter/84
CALENDARIO
http://int.bcom.tbs.com:980/service/config-service/calendar/page
http://int.bcom.tbs.com:980/service/config-service/calendar/zzzzz
http://int.bcom.tbs.com:980/service/config-service/calendar-exception/find-by-calendar-id
TAREA PROGRAMADA
http://int.bcom.tbs.com:980/service/config-service/settings/scheduler-task/page
http://int.bcom.tbs.com:980/service/config-service/settings/scheduler-task/2
PARAMETRO DE SISTEMA
http://int.bcom.tbs.com:980/service/config-service/input/system-field/page
http://int.bcom.tbs.com:980/service/config-service/input/system-field/3
TIPO DE CATALOGO
http://int.bcom.tbs.com:980/service/config-service/catalog-type/page
http://int.bcom.tbs.com:980/service/config-service/catalog-type/sub-tcatalog
CATALOGO
http://int.bcom.tbs.com:980/service/config-service/catalog/page
http://int.bcom.tbs.com:980/service/config-service/catalog/68
http://int.bcom.tbs.com:980/service/config-service/characteristic-value/list-value-group-pagination/68
VALORES POSIBLES
http://int.bcom.tbs.com:980/service/config-service/possible-value/page
http://int.bcom.tbs.com:980/service/config-service/possible-value/15
MONEDA
http://int.bcom.tbs.com:980/service/config-service/currency/page
http://int.bcom.tbs.com:980/service/config-service/currency/13
TIPO DE CAMBIO
http://int.bcom.tbs.com:980/service/config-service/currency-exchange/page
CICLO DE LIQUIDACION
http://int.bcom.tbs.com:980/service/config-service/billing-cycle/page
http://int.bcom.tbs.com:980/service/config-service/billing-cycle/4
CONCEPTOS
http://int.bcom.tbs.com:980/service/config-service/concept/page
http://int.bcom.tbs.com:980/service/config-service/concept/1
EQUIVALENCIAS
http://int.bcom.tbs.com:980/service/config-service/equivalence-entity/page
http://int.bcom.tbs.com:980/service/config-service/equivalence-entity/10
CLASE UBIGEO
http://int.bcom.tbs.com:980/service/config-service/class-ubigeo/page
http://int.bcom.tbs.com:980/service/config-service/class-ubigeo/5
UBIGEO
http://int.bcom.tbs.com:980/service/config-service/ubigeo/page
http://int.bcom.tbs.com:980/service/config-service/ubigeo/3
IMPUESTOS
http://int.bcom.tbs.com:980/service/config-service/tax/page
http://int.bcom.tbs.com:980/service/config-service/tax/4
INTERVALO
http://int.bcom.tbs.com:980/service/config-service/interval/page
http://int.bcom.tbs.com:980/service/config-service/interval/3
TIPOS DE AJUSTES
http://int.bcom.tbs.com:980/service/config-service/adjustment-type/page
http://int.bcom.tbs.com:980/service/config-service/adjustment-type/3
http://192.168.27.29:38080/service/config-service/interval-condition/page/621?searchString=
http://192.168.27.29:38080/service/config-service/interval-condition/25921/ranges
ROLES
http://int.bcom.tbs.com:980/service/config-service/role/page
http://int.bcom.tbs.com:980/service/config-service/role/46
INDIVIDUOS
http://int.bcom.tbs.com:980/service/config-service/party/page
http://int.bcom.tbs.com:980/service/config-service/party/233
ORGANIZACIONES
http://int.bcom.tbs.com:980/service/config-service/party/page
http://int.bcom.tbs.com:980/service/config-service/party/232
INSUMOS
http://int.bcom.tbs.com:980/service/config-service/input/page
http://int.bcom.tbs.com:980/service/config-service/input/146
REPOSITORIOS
http://int.bcom.tbs.com:980/service/config-service/repository/page
http://int.bcom.tbs.com:980/service/config-service/repository/27
CREDENCIALES
http://int.bcom.tbs.com:980/service/config-service/credential/page
http://int.bcom.tbs.com:980/service/config-service/credential/7
CONEXIONES
http://int.bcom.tbs.com:980/service/config-service/database-connection-inventory/page
http://int.bcom.tbs.com:980/service/config-service/database-connection-inventory/2
MATRICES
http://int.bcom.tbs.com:980/service/config-service/point-matrix/page
http://int.bcom.tbs.com:980/service/config-service/point-matrix/10
ESTRUCTURAS
http://int.bcom.tbs.com:980/service/config-service/commission-structure/page
http://int.bcom.tbs.com:980/service/config-service/commission-structure/80
PENALIDADES
http://int.bcom.tbs.com:980/service/config-service/sanction/page
http://int.bcom.tbs.com:980/service/config-service/sanction-version/7
PLANES
http://int.bcom.tbs.com:980/service/config-service/commission-plan/page
http://int.bcom.tbs.com:980/service/config-service/commission-plan/version/51&1
ACUERDOS
http://int.bcom.tbs.com:980/service/config-service/agreement/page
http://int.bcom.tbs.com:980/service/config-service/agreement-version/76
http://int.bcom.tbs.com:980/service/config-service/commission-plan-version/version/90 <-- para obtener plan y luego estructura
EXCEPCIONES
http://int.bcom.tbs.com:980/service/config-service/exception/page
http://int.bcom.tbs.com:980/service/config-service/exception-version/1
AJUSTES
http://int.bcom.tbs.com:980/service/config-service/adjustment/page
http://int.bcom.tbs.com:980/service/config-service/adjustment/8
VISTAS
http://int.bcom.tbs.com:980/service/config-service/view/page
http://int.bcom.tbs.com:980/service/config-service/view/27
FILTROS
http://int.bcom.tbs.com:980/service/config-service/filter/page
http://int.bcom.tbs.com:980/service/config-service/filter/27
\ No newline at end of file
URL_BASE = 'http://int.bcom.tbs.com:980'
# URL_BASE = 'http://192.168.27.29:38080'
TOKEN = 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJZMXdqNFd4NlUwaDVkTW1aY3U0Z0praURaUFM5UnVCeURHQmpubDZPY2ZZIn0.eyJleHAiOjE2ODc4ODEyNzUsImlhdCI6MTY4Nzg4MDk3NSwiYXV0aF90aW1lIjoxNjg3ODgwOTY3LCJqdGkiOiI2NWZmNWYzNC1lYzlkLTQzODctYjEyZS02MzE3ZGQyYmUwNTkiLCJpc3MiOiJodHRwOi8vdGVzdC5iY29tLnRicy5jb206NDgwOTUvYXV0aC9yZWFsbXMvQkNPTSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJlZmE0MzVjNC1kNmFiLTRkNzAtYWVmMC00NjBmNjMxMWEzNzEiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJiY29tLWZyb250ZW5kIiwibm9uY2UiOiI5YzNjYzJjNy1lOWFlLTQ1MDItYjljOS0wMGZiY2IyMmMxZmMiLCJzZXNzaW9uX3N0YXRlIjoiNmZkN2QwMzYtZGVmOC00MWFkLWEzNzgtYTJiZDhlMjI3MjRlIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwOi8vZGV2LmtleWNsb2FrLmJjb20udGJzLmNvbTo4MDgwIiwiaHR0cHM6Ly9kZXYuYmNvbS50YnMuY29tOjg0NDMiLCJodHRwOi8vZGV2LmJjb20udGJzLmNvbTo4MDgwIiwiaHR0cDovLzE5Mi4xNjguMjcuMTMyOjMxMDI3IiwiaHR0cDovL2xvY2FsaG9zdDo0MjAwIiwiaHR0cDovL2ludC5iY29tLnRicy5jb206OTgwIiwiaHR0cDovL2Rldi5saXF1aWRhdGlvbi5iY29tLnRicy5jb206ODA4MCIsImh0dHA6Ly9xYS5iY29tLnRicy5jb206ODA4MCIsImh0dHA6Ly90ZXN0LmJjb20udGJzLmNvbTo1ODA4MCIsImh0dHA6Ly8xOTIuMTY4LjI3LjEzMzozMTAyNyIsImh0dHBzOi8vZGV2LmxpcXVpZGF0aW9uLmJjb20udGJzLmNvbTo4NDQzIiwiaHR0cDovL2ludC5iY29tLnRicy5jb206MzgwODAiLCJodHRwOi8vaW50LmJjb20udGJzLmNvbTo4MDgwIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJiYXRjaC1leGVjdXRpb24iLCJhZ2VudGUiLCJxdWVyeV9zZXJ2aWNlX3JvbGUiLCJhdXRoX3Jlc291cmNlX3JvbGUiLCJlamVjdXRpdm8iLCJhZG1pbiIsImFnZW50ZS1jb21lcmNpYWwtZXh0ZXJubyIsImd1ZXNzIiwib2ZmbGluZV9hY2Nlc3MiLCJhZ2VudGUtY29tZXJjaWFsIiwidW1hX2F1dGhvcml6YXRpb24iLCJjb25maWciLCJ1c2VyIiwic3VwZXJ2aXNvciJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwibmFtZSI6Ikx1aXMgVmFzcXVleiIsInByZWZlcnJlZF91c2VybmFtZSI6Imx2YXNxdWV6IiwiZ2l2ZW5fbmFtZSI6Ikx1aXMiLCJsb2NhbGUiOiJlcyIsImZhbWlseV9uYW1lIjoiVmFzcXVleiIsInRlbmFudCI6InRlbmFudDEiLCJlbWFpbCI6Imx2YXNxdWV6QGJ5dGVzdy5jb20ifQ.QQrg67ZtU7vaxK8HwbGLWN7nn3rE0mlymb6EdysARbHK2fZT2bo9bXU1PnfYAEC7oMzvKr8wj-xympiJRbr8_vsVyuGv5Pab4eb_nd3muwA9ZBd2BE2LjeF_GWnXYRt3mTMm8E8ZWrs1SFT2cIK-4MRVJtwhA886tEas8dqnIqoFad3wl8uIIVx85MMllEYCYybvUME-U1esPeT9opg6c241Lal-eWVuFM1tuZeWUW9IcvFa3v6f4haGSBboWrbp_f1NRTSrPHUQthBu3QB_yXuvVXfpZoo0p53jl66Q2N4qqTFwNa8r4v3mwerldSLC0rIiFhWD8nLBhD_TiP9dNQ'
session = 'BCOM'
# VARIABLES NECECESARIAS PARA EXTRACCIÓN DE DATOS
ruta_excel = "D:\\DATOS 14 10 22\\Escritorio\\Proyectos y Trabajos personales\\Empresa BYTE\\ficheros ROBOT\\Configuracion_API.xlsx"
# VARIABLES NECESARIAS PARA LA CREACION Y MANEJO DEL REPORTE (RUTA DEL REPORTE Y FLAG DE REPORTE)
# EN LA RUTA NO INCLUIR EL NOMBRE DEL REPORTE, SOLO LA UBICACION
# EN CASO NO SE QUIERA ESPECIFICAR UNA RUTA PARA EL REPORTE,
# DEJAR LA VARIABLE DE LA SIGUIENTE MANERA:
# ruta_reporte = ''
ruta_reporte = 'C:\\Users\\Daniel\\Desktop\\REPORTE'
# POSIBLES VALORES PARA DETERMINAR LA FORMA DE MOSTRAR EL REPORTE:
# CONSOLA --> IMPRIMIR EN TERMINAL
# REPORTE --> IMPRIMIR UN REPORTE EN UN ARCHIVO JSON
# AMBOS --> IMPRIME EN CONSOLA Y EN REPORTE
flag_reporte = 'AMBOS'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment