Skip to content

GX-23698-✅-tools-qa-forms-practice-form #425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 4, 2023
9 changes: 4 additions & 5 deletions .github/workflows/CI-Suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
browser: chrome
command: | #EDITAR AQUÍ EL ARCHIVO SUITE A EJECUTAR:
yarn file cypress/e2e/Tests/Interactions/GX2-5320-Sortable.cy.js
yarn file cypress/e2e/Tests/Forms/GX-23698-PracticeForm.cy.js

- name: ✅Import Test Results to Xray
if: always()
Expand All @@ -64,10 +64,9 @@ jobs:
password: ${{secrets.XRAY_CLIENT_SECRET}}
testFormat: 'junit' #OPCIONES PARA CAMBIAR: 'junit' (para xml) o 'cucumber' (para json)
testPaths: 'reports/test-results.xml' #OPCIONES: '/test-results.xml' o 'cucumber-report.json'
testExecKey: 'GX2-5322' #EDITAR AQUÍ EL TEST EXECUTION A IMPORTAR LAS PRUEBAS.
projectKey: 'GX2' #EDITAR EN CASO DE TRABAJAR CON OTRO PROYECTO.


testExecKey: 'GX-23700' #EDITAR AQUÍ EL TEST EXECUTION A IMPORTAR LAS PRUEBAS.
projectKey: 'GX' #EDITAR EN CASO DE TRABAJAR CON OTRO PROYECTO.

- name: 🔔Slack Notification of Done
if: always()
uses: rtCamp/[email protected]
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/Tests/Forms/GX-23698-PracticeForm.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,15 @@ describe('US GX-23698 | TS: ✅ToolsQA | Forms | Practice Form', () => {
usuario.datos.Email().should('have.css', 'border-color', 'rgb(220, 53, 69)');
});

it.skip('23699 | TC4: Validate if field date picker has the current date as a default value.', () => {
it('23699 | TC4: Validate if field date picker has the current date as a default value.', () => {
const fechaActual = new Date();
const dia = fechaActual.getDate();
const mes = fechaActual.toLocaleString('default', { month: 'short' });
const mesCapitalized = mes.charAt(0).toUpperCase() + mes.slice(1);
const año = fechaActual.getFullYear();

const fechaFormateada = `${dia} ${mesCapitalized} ${año}`;
const mesIngles = usuario.traducirMes(mesCapitalized);
const diaFormateado = dia < 10 ? `0${dia}` : dia;
const fechaFormateada = `${diaFormateado} ${mesIngles} ${año}`;
usuario.datos.dateOfBirth().should('have.value', fechaFormateada);
});
});
Expand Down
31 changes: 31 additions & 0 deletions cypress/support/pages/Forms/GX-23698-PracticeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,36 @@ class Usuario {
const anio = fecha.getFullYear();
return `${dia} ${mes}, ${anio}`;
}

traducirMes(mesEnEspañol) {
switch (mesEnEspañol) {
case 'Ene':
return 'Jan';
case 'Feb':
return 'Feb';
case 'Mar':
return 'Mar';
case 'Abr':
return 'Apr';
case 'May':
return 'May';
case 'Jun':
return 'Jun';
case 'Jul':
return 'Jul';
case 'Ago':
return 'Aug';
case 'Sep':
return 'Sep';
case 'Oct':
return 'Oct';
case 'Nov':
return 'Nov';
case 'Dic':
return 'Dec';
default:
return mesEnEspañol;
}
}
}
export const usuario = new Usuario();