From 828b2aa557f308501f2d1d07031d08b04b5bf0eb Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 25 Nov 2024 12:30:08 +0100 Subject: [PATCH] feat: refs #6943 sh script to create branch and copy e2e tests --- create_branch_and_copy_e2e.sh | 42 +++++++++++++++++ create_branch_and_copy_e2e_echo.sh | 43 ++++++++++++++++++ cypress.config.js | 6 ++- import_e2e.zip | Bin 0 -> 1648 bytes package.json | 3 +- .../client/01_create_client.spec.js | 14 ++++++ .../client/02_edit_basic_data.spec.js | 21 +++++++++ .../client/03_edit_fiscal_data.spec.js | 22 +++++++++ .../client/04_edit_billing_data.spec.js | 7 +++ .../integration/client/05_add_address.spec.js | 14 ++++++ .../client/06_add_address_notes.spec.js | 5 ++ .../client/07_edit_web_access.spec.js | 2 + .../integration/client/09_add_credit.spec.js | 4 ++ .../integration/client/10_add_greuge.spec.js | 4 ++ .../integration/client/11_mandate.spec.js | 2 + .../client/12_lock_of_verified_data.spec.js | 22 +++++++++ .../cypress/integration/client/13_log.spec.js | 3 ++ .../integration/client/14_balance.spec.js | 9 ++++ .../integration/client/15_user_config.spec.js | 12 +++++ .../integration/client/16_web_payment.spec.js | 5 ++ .../cypress/integration/client/17_dms.spec.js | 4 ++ .../integration/client/18_contacts.spec.js | 3 ++ .../integration/client/19_summary.spec.js | 11 +++++ .../client/20_credit_insurance.spec.js | 14 ++++++ .../integration/client/21_defaulter.spec.js | 7 +++ .../integration/client/22_unpaid.spec.js | 4 ++ .../client/23_send_compensation.spec.js | 2 + test/cypress/support/commands.js | 5 ++ 28 files changed, 288 insertions(+), 2 deletions(-) create mode 100644 create_branch_and_copy_e2e.sh create mode 100644 create_branch_and_copy_e2e_echo.sh create mode 100644 import_e2e.zip create mode 100644 test/cypress/integration/client/01_create_client.spec.js create mode 100644 test/cypress/integration/client/02_edit_basic_data.spec.js create mode 100644 test/cypress/integration/client/03_edit_fiscal_data.spec.js create mode 100644 test/cypress/integration/client/04_edit_billing_data.spec.js create mode 100644 test/cypress/integration/client/05_add_address.spec.js create mode 100644 test/cypress/integration/client/06_add_address_notes.spec.js create mode 100644 test/cypress/integration/client/07_edit_web_access.spec.js create mode 100644 test/cypress/integration/client/09_add_credit.spec.js create mode 100644 test/cypress/integration/client/10_add_greuge.spec.js create mode 100644 test/cypress/integration/client/11_mandate.spec.js create mode 100644 test/cypress/integration/client/12_lock_of_verified_data.spec.js create mode 100644 test/cypress/integration/client/13_log.spec.js create mode 100644 test/cypress/integration/client/14_balance.spec.js create mode 100644 test/cypress/integration/client/15_user_config.spec.js create mode 100644 test/cypress/integration/client/16_web_payment.spec.js create mode 100644 test/cypress/integration/client/17_dms.spec.js create mode 100644 test/cypress/integration/client/18_contacts.spec.js create mode 100644 test/cypress/integration/client/19_summary.spec.js create mode 100644 test/cypress/integration/client/20_credit_insurance.spec.js create mode 100644 test/cypress/integration/client/21_defaulter.spec.js create mode 100644 test/cypress/integration/client/22_unpaid.spec.js create mode 100644 test/cypress/integration/client/23_send_compensation.spec.js diff --git a/create_branch_and_copy_e2e.sh b/create_branch_and_copy_e2e.sh new file mode 100644 index 000000000..6c280ddd1 --- /dev/null +++ b/create_branch_and_copy_e2e.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Verificar si se pasaron los parámetros correctos +if [ "$#" -ne 3 ]; then + echo "Uso: $0 " + exit 1 +fi + +# Asignar parámetros a variables +ID_TAREA=$1 +MODULO=$2 +E2E_PATH=$3 + +# Nombre de la rama +BRANCH_NAME="${ID_TAREA}_${MODULO}_missing_e2e" + +# Paso 1: Crear la rama local a partir de dev +git checkout dev +git pull origin dev +git checkout -b "${BRANCH_NAME}" + +# Paso 2: Copiar archivos al directorio destino +SOURCE_DIR="../salix/e2e/paths/${E2E_PATH}" +DEST_DIR="../test-processing/tests" + +mkdir -p "${DEST_DIR}" +cp -r "${SOURCE_DIR}"/* "${DEST_DIR}" + +# Paso 3: Ejecutar el comando node +cd ../test-processing +PROCESS_SCRIPT="../test-processing/index.js" +node "${PROCESS_SCRIPT}" +cd ../salix-front + +# Paso 4: Copiar archivos procesados al destino Cypress +PROCESSED_DIR="../test-processing/processedTests" +CYPRESS_DEST="./test/cypress/integration/${MODULO}" +mkdir -p "${CYPRESS_DEST}" +cp -r "${PROCESSED_DIR}"/* "${CYPRESS_DEST}" + +# Confirmación final +echo "Flujo completado exitosamente. Revisa los resultados." diff --git a/create_branch_and_copy_e2e_echo.sh b/create_branch_and_copy_e2e_echo.sh new file mode 100644 index 000000000..d89ea56c6 --- /dev/null +++ b/create_branch_and_copy_e2e_echo.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Verificar si se pasaron los parámetros correctos +if [ "$#" -ne 3 ]; then + echo "Uso: $0 " + exit 1 +fi + +# Asignar parámetros a variables +ID_TAREA=$1 +MODULO=$2 +E2E_PATH=$3 + +# Nombre de la rama +BRANCH_NAME="${ID_TAREA}_${MODULO}_missing_e2e" + +# Paso 1: Crear la rama local a partir de dev +echo "git checkout dev" +echo "git pull origin dev" +echo "git checkout -b ${BRANCH_NAME}" + +# Paso 2: Copiar archivos al directorio destino +SOURCE_DIR="../salix/e2e/paths/${E2E_PATH}" +DEST_DIR="../test-processing/tests" + +echo "mkdir -p ${DEST_DIR}" +echo "cp -r ${SOURCE_DIR}/* ${DEST_DIR}" + +# Paso 3: Ejecutar el comando node +echo "cd ../test-processing" +PROCESS_SCRIPT="../test-processing/index.js" +echo "node ${PROCESS_SCRIPT}" +echo "cd ../salix-front" + +# Paso 4: Copiar archivos procesados al destino Cypress +PROCESSED_DIR="../test-processing/processedTests" +CYPRESS_DEST="./test/cypress/integration/${MODULO}" + +echo "mkdir -p ${CYPRESS_DEST}" +echo "cp -r ${PROCESSED_DIR}/* ${CYPRESS_DEST}" + +# Confirmación final +echo "Flujo completado (pendiente de ejecución real). Valida los comandos antes de proceder." diff --git a/cypress.config.js b/cypress.config.js index f8e771093..401c6c82d 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,4 +1,7 @@ const { defineConfig } = require('cypress'); +// https://docs.cypress.io/app/tooling/reporters +// https://docs.cypress.io/app/references/configuration +// https://www.npmjs.com/package/cypress-mochawesome-reporter module.exports = defineConfig({ e2e: { @@ -9,13 +12,14 @@ module.exports = defineConfig({ supportFile: 'test/cypress/support/index.js', videosFolder: 'test/cypress/videos', video: false, - specPattern: 'test/cypress/integration/**/*.spec.js', + specPattern: 'test/cypress/integration/vnComponent/vnLocation.spec.js', experimentalRunAllSpecs: true, watchForFileChanges: true, reporter: 'cypress-mochawesome-reporter', reporterOptions: { charts: true, reportPageTitle: 'Cypress Inline Reporter', + reportFilename: '[status]_[datetime]-report', embeddedScreenshots: true, reportDir: 'test/cypress/reports', inlineAssets: true, diff --git a/import_e2e.zip b/import_e2e.zip new file mode 100644 index 0000000000000000000000000000000000000000..9359ce9ae0bace73e5d36bbeb6e9f66c053dd941 GIT binary patch literal 1648 zcmWIWW@Zs#-~hr!Jr$7*P*BUlz@WsSz>r*&nplz=pH!5Xmz)uwn3octoL^8GpK6pE zpPHPJuUDKA8p6xKZW!jA4#TAt+zgCB?FA|%hF#67HvFt%VL84*UPu&{d{JAzo+(#-aJmx z^D|=E4hr5`Bv>41z#P`#x?)DEoA!iTmu}kp)4V8YC4NgnXU?|98HfEj7B3dC;(EwZ zSIfBFMU){nLdUelJZ!$x7tV7m=VgsgoO`(DN{yr;X^#v&TyDb&S*ZJXeXQUa)G=od-&pqXTJy9zhceQKYP6SrK`QwN2Tk#=18*i zDM(6$ZF-Pxw!=^F)9ZtwxA+(PuHJNZvG3wdXT1~G26WGP;iPYr7Iyffrix2`l%mnn zgh?G8=Q$sH7sRmpUgmzaI3lTVefT+hKK^;(+M15i8wFlHUA=tDIi5vl8DEy2zo^U? z%gL0uETU^`xhs?SSBIVpOETvMSk36k+oW=~eR`z*o3iB7ODZ~6F1;b0_c-HnlbzK3vIi85}ByuGb`QB&VS@!ywj|9JfQz_#AW!5;57 zL|pV@@Vd2PlIA+c%)Ye}?bi(w4bHiFTFrbiS!K73|9uv*uE);b&uxo{o1!r<{oTUX zR$Fc7TITM)?Oa#)wluiy@qx(-@`Tb@L z6_PdOd#@c5qpYr>L_Ni;pTK@IFpJ(h!{J>_ zOVb?Yi+D3%oNN4CpuT}yhx`26C({c8XBI8x5#6NTJ?r<=)GhOGENBllJI-KSu;W5Y zQO=pfv$~&VPU?&0?|!Lpp6&0CDR+C?%H!St?l`_FF06Q=LeD^we0v{O?-37dbr-(C1pz-E?AxHS_Z46NL8WwrYqR6crSl z?=G$5wKI+TR%3+M$Aqwd8v@o(VM;D+{FNJ=?#7tczoG2>GFu~4(@EOflR94uG&Tv% z{-P@tR4lhOaq`93d1*&KSiN_@oA+qPAz!CIo*vg#KW;nQdZhhkO4W-mzy!QjaMR7= z&+j=FR4ItRxYD>*c0pvI^YON=>4#&d?5V$c_0jyf&Sm;XyUxijS(F`I7%O#Q*%Y5C zAFj>o{Tw*USM8|E+4aXS*9$Gud%CRJe}bdB#eNyCDZORFPU(K)H{?6)_VJeJpFO=i z=X;~muhrX9ZZM@D{;&2ezm=Nj3{0({G#TK{$RxsyD1ebuGN=HCfo+W-7Ujh;x_!uQ j0p$-E*w%Ov=tA7~5s_O0yjj^m#xVimZ6ICG3gQ6(I#R6y literal 0 HcmV?d00001 diff --git a/package.json b/package.json index 04b75a0b0..550a08abf 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "lint": "eslint --ext .js,.vue ./", "format": "prettier --write \"**/*.{js,vue,scss,html,md,json}\" --ignore-path .gitignore", "test:e2e": "cypress open", + "test:e2e:run": "cypress run", "test:e2e:ci": "npm run resetDatabase && cd ../salix-front && cypress run", "test": "echo \"See package.json => scripts for available tests.\" && exit 0", "test:unit": "vitest", @@ -64,4 +65,4 @@ "vite": "^5.1.4", "vitest": "^0.31.1" } -} \ No newline at end of file +} diff --git a/test/cypress/integration/client/01_create_client.spec.js b/test/cypress/integration/client/01_create_client.spec.js new file mode 100644 index 000000000..5f13bed69 --- /dev/null +++ b/test/cypress/integration/client/01_create_client.spec.js @@ -0,0 +1,14 @@ +describe('Client create path', () => { + it(`should search for the user Carol Danvers to confirm it isn't created yet`, async() => { + it('should now access to the create client view by clicking the create-client floating button', async() => { + it('should receive an error when clicking the create button having name and Business name fields empty', + it(`should create a new province`, async() => { + it(`should create a new city`, async() => { + it(`should create a new post code`, async() => { + it(`should attempt to create a new user with all it's data but wrong email`, async() => { + it(`should attempt to create a new user with all it's data but wrong business type`, async() => { + it(`should attempt to create a new user with all it's data but wrong postal code`, async() => { + it(`should check for autocompleted city, province and country`, async() => { + it(`should create a new user with all correct data`, async() => { + it('should click on the Clients button of the top bar menu', async() => { + it(`should search for the user Carol Danvers to confirm it exists`, async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/02_edit_basic_data.spec.js b/test/cypress/integration/client/02_edit_basic_data.spec.js new file mode 100644 index 000000000..4dd9fc129 --- /dev/null +++ b/test/cypress/integration/client/02_edit_basic_data.spec.js @@ -0,0 +1,21 @@ +describe('Client Edit basicData path', () => { + describe('as employee', () => { + it('should not be able to change the salesPerson', async() => { + it('should edit the client basic data but leave salesPerson untainted', async() => { + it('should confirm the name have been edited', async() => { + it('should confirm the contact name have been edited', async() => { + it('should confirm the business type have been edited', async() => { + it('should confirm the email have been edited', async() => { + it('should confirm the channel have been selected', async() => { + it('should confirm the previous client have been selected', async() => { + describe('as salesAssistant', () => { + it('should navigate to a client basic data', async() => { + it('should be able to change the salesPerson', async() => { + it('should edit the client basic data including salesPerson', async() => { + it('should now confirm the name have been edited', async() => { + it('should now confirm the contact name have been edited', async() => { + it('should now confirm the email have been edited', async() => { + it('should now confirm the phone have been edited', async() => { + it('should now confirm the mobile have been edited', async() => { + it('should confirm the sales person have been selected', async() => { + it('should now confirm the channel have been selected', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/03_edit_fiscal_data.spec.js b/test/cypress/integration/client/03_edit_fiscal_data.spec.js new file mode 100644 index 000000000..0f447fb4d --- /dev/null +++ b/test/cypress/integration/client/03_edit_fiscal_data.spec.js @@ -0,0 +1,22 @@ +describe('Client Edit fiscalData path', () => { + describe('as employee', () => { + it(`should click on the 1st edit icon to check EQtax isnt checked`, async() => { + it(`should go back to addresses then select the second one and confirm the EQtax isnt checked`, async() => { + it(`should click on the fiscal data button`, async() => { + it('should not be able to edit the verified data checkbox', async() => { + describe('as administrative', () => { + it(`should edit the fiscal data but fail as the fiscal id ain't valid`, async() => { + it(`should edit the fiscal this time with a valid fiscal id`, async() => { + it('should propagate the Equalization tax', async() => { + it('should receive an error if the fiscal id contains A or B at the beginning', async() => { + it('should edit the fiscal data correctly as VIES isnt checked and fiscal id is valid for EQtax', async() => { + it(`should click on the addresses button to access to the client's addresses`, async() => { + it(`should click on the 1st edit icon to confirm EQtax is checked`, async() => { + it(`should go back to addresses then select the second one and confirm the EQtax is checked`, async() => { + it('should navigate back to fiscal data and uncheck EQtax then check VIES', async() => { + it('should propagate the Equalization tax changes', async() => { + it('should confirm its name have been edited', async() => { + it('should confirm the fiscal data have been edited', async() => { + it(`should click on the addresses button to access to the client's addresses`, async() => { + it(`should click on the 1st edit icon to access the address details and uncheck EQtax checkbox`, async() => { + it('should navigate back to fiscal data to confirm invoice by address is now checked', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/04_edit_billing_data.spec.js b/test/cypress/integration/client/04_edit_billing_data.spec.js new file mode 100644 index 000000000..17d8adc56 --- /dev/null +++ b/test/cypress/integration/client/04_edit_billing_data.spec.js @@ -0,0 +1,7 @@ +describe('Client Edit billing data path', () => { + it(`should attempt to edit the billing data without an IBAN but fail`, async() => { + it(`should edit the billing data and save the form`, async() => { + it(`should create a new BIC code`, async() => { + it(`should confirm the IBAN pay method was sucessfully saved`, async() => { + it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => { + it('should confirm the billing data have been edited', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/05_add_address.spec.js b/test/cypress/integration/client/05_add_address.spec.js new file mode 100644 index 000000000..866b4c481 --- /dev/null +++ b/test/cypress/integration/client/05_add_address.spec.js @@ -0,0 +1,14 @@ +describe('Client Add address path', () => { + it(`should click on the add new address button to access to the new address form`, async() => { + it('should receive an error after clicking save button as consignee, street and town fields are empty', async() => { + it('should confirm that the city and province are propertly filled', async() => { + it(`should throw after clicking save button as consignee, incoterms and customsAgent are empty`, async() => { + it(`should receive an error after clicking save button as customsAgent is empty`, async() => { + it(`should create a new custom agent and then save the address`, async() => { + it(`should navigate back to the addresses index`, async() => { + it(`should confirm the new address exists and it's the default one`, async() => { + it('should click on the make default icon of the second address', async() => { + it(`should confirm the default address is the expected one`, async() => { + it(`should click on the edit icon of the default address`, async() => { + it(`should click on the active checkbox and receive an error to save it because it is the default address`, async() => { + it(`should go back to the addreses section by clicking the cancel button`, async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/06_add_address_notes.spec.js b/test/cypress/integration/client/06_add_address_notes.spec.js new file mode 100644 index 000000000..16817bfc9 --- /dev/null +++ b/test/cypress/integration/client/06_add_address_notes.spec.js @@ -0,0 +1,5 @@ +describe('Client add address notes path', () => { + it(`should click on the edit icon of the default address`, async() => { + it('should not save a description without observation type', async() => { + it('should not save an observation type without description', async() => { + it('should create two new observations', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/07_edit_web_access.spec.js b/test/cypress/integration/client/07_edit_web_access.spec.js new file mode 100644 index 000000000..1c3c82628 --- /dev/null +++ b/test/cypress/integration/client/07_edit_web_access.spec.js @@ -0,0 +1,2 @@ +describe('Client web access path', () => { + it('should modify and save web access attributes', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/09_add_credit.spec.js b/test/cypress/integration/client/09_add_credit.spec.js new file mode 100644 index 000000000..b202e6109 --- /dev/null +++ b/test/cypress/integration/client/09_add_credit.spec.js @@ -0,0 +1,4 @@ +describe('Client Add credit path', () => { + it(`should click on the add credit button`, async() => { + it(`should edit the credit`, async() => { + it('should confirm the credit was updated', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/10_add_greuge.spec.js b/test/cypress/integration/client/10_add_greuge.spec.js new file mode 100644 index 000000000..ec3eff96d --- /dev/null +++ b/test/cypress/integration/client/10_add_greuge.spec.js @@ -0,0 +1,4 @@ +describe('Client Add greuge path', () => { + it(`should click on the add greuge button`, async() => { + it(`should receive an error if all fields are empty but date and type on submit`, async() => { + it(`should create a new greuge with all its data and confirm the greuge was added to the list`, async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/11_mandate.spec.js b/test/cypress/integration/client/11_mandate.spec.js new file mode 100644 index 000000000..cc216dc5d --- /dev/null +++ b/test/cypress/integration/client/11_mandate.spec.js @@ -0,0 +1,2 @@ +describe('Client mandate path', () => { + it('should confirm the client has a mandate of the CORE type', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/12_lock_of_verified_data.spec.js b/test/cypress/integration/client/12_lock_of_verified_data.spec.js new file mode 100644 index 000000000..b63d21116 --- /dev/null +++ b/test/cypress/integration/client/12_lock_of_verified_data.spec.js @@ -0,0 +1,22 @@ +describe('Client lock verified data path', () => { + describe('as salesPerson', () => { + it('should confirm verified data button is disabled for salesPerson', async() => { + it('should edit the social name', async() => { + it('should confirm the social name have been edited', async() => { + describe('as administrative', () => { + it('should confirm verified data button is enabled for administrative', async() => { + it('should check the Verified data checkbox', async() => { + it('should confirm Verified data checkbox is checked', async() => { + it('should again edit the social name', async() => { + it('should again confirm the social name have been edited', async() => { + describe('as salesPerson second run', () => { + it('should confirm verified data button is disabled once again for salesPerson', async() => { + it('should not be able to save change throwing a verified data error', async() => { + describe('as salesAssistant', () => { + it('should log in as salesAssistant then get to the client fiscal data', async() => { + it('should confirm verified data button is enabled for salesAssistant', async() => { + it('should now edit the social name', async() => { + it('should now confirm the social name have been edited once and for all', async() => { + describe('as salesPerson third run', () => { + it('should confirm verified data button is enabled once again', async() => { + it('should confirm the form is enabled for salesPerson', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/13_log.spec.js b/test/cypress/integration/client/13_log.spec.js new file mode 100644 index 000000000..a0c971fa5 --- /dev/null +++ b/test/cypress/integration/client/13_log.spec.js @@ -0,0 +1,3 @@ +describe('Client log path', () => { + it('should update the clients name', async() => { + it('should navigate to the log section', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/14_balance.spec.js b/test/cypress/integration/client/14_balance.spec.js new file mode 100644 index 000000000..44e631122 --- /dev/null +++ b/test/cypress/integration/client/14_balance.spec.js @@ -0,0 +1,9 @@ +describe('Client balance path', () => { + it('should now edit the local user config data', async() => { + it('should create a new payment that clears the debt', async() => { + it('should edit the 1st line reference and check data', async() => { + it('should create a new payment, check the cash comparison works correctly and balance value is -100', async() => { + it('should create a new payment and check the cash exceeded the maximum', async() => { + it('should create a new payment that sets the balance back to negative value and check it', async() => { + it('should now click on the Clients button of the top bar menu', async() => { + it('should now search for the user Petter Parker not check the payment button is not present', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/15_user_config.spec.js b/test/cypress/integration/client/15_user_config.spec.js new file mode 100644 index 000000000..ac6e10951 --- /dev/null +++ b/test/cypress/integration/client/15_user_config.spec.js @@ -0,0 +1,12 @@ +describe('User config', () => { + describe('as salesPerson', () => { + it('should login', async() => { + it('should now open the user config form to check the settings', async() => { + describe('as employee', () => { + it('should log in', async() => { + it('should open the user config form to check the settings', async() => { + it('should now edit the user config data', async() => { + describe('as salesPerson 2nd run', () => { + it('should log in once more', async() => { + it('should again open the user config form to check the local settings', async() => { + it('should now clear the local settings', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/16_web_payment.spec.js b/test/cypress/integration/client/16_web_payment.spec.js new file mode 100644 index 000000000..586012c63 --- /dev/null +++ b/test/cypress/integration/client/16_web_payment.spec.js @@ -0,0 +1,5 @@ +describe('Client web Payment', () => { + describe('as employee', () => { + it('should not be able to confirm payments', async() => { + describe('as administrative', () => { + it('should be able to confirm payments', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/17_dms.spec.js b/test/cypress/integration/client/17_dms.spec.js new file mode 100644 index 000000000..382162a50 --- /dev/null +++ b/test/cypress/integration/client/17_dms.spec.js @@ -0,0 +1,4 @@ +describe('Client DMS', () => { + describe('as salesPerson', () => { + it('should delete de first file', async() => { + it(`should click on the first document line worker name making the descriptor visible`, async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/18_contacts.spec.js b/test/cypress/integration/client/18_contacts.spec.js new file mode 100644 index 000000000..a2194e318 --- /dev/null +++ b/test/cypress/integration/client/18_contacts.spec.js @@ -0,0 +1,3 @@ +describe('Client contacts', () => { + it('should add a contact', async() => { + it('should delete de contact', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/19_summary.spec.js b/test/cypress/integration/client/19_summary.spec.js new file mode 100644 index 000000000..960765b8d --- /dev/null +++ b/test/cypress/integration/client/19_summary.spec.js @@ -0,0 +1,11 @@ +describe('Client summary path', () => { + it('should reach the first route summary section', async() => { + it('should display details from the client on the header', async() => { + it('should display some basic data', async() => { + it('should display fiscal address details', async() => { + it('should display some fiscal data', async() => { + it('should display pay method details', async() => { + it('should display default address details', async() => { + it('should display web access details', async() => { + it('should display business data', async() => { + it('should display financial information', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/20_credit_insurance.spec.js b/test/cypress/integration/client/20_credit_insurance.spec.js new file mode 100644 index 000000000..5c0ecb240 --- /dev/null +++ b/test/cypress/integration/client/20_credit_insurance.spec.js @@ -0,0 +1,14 @@ +describe('Client credit insurance path', () => { + it('should open the create a new credit contract form', async() => { + it('should create a new credit contract', async() => { + it(`should verify the addNewContract button is not present since there's an active contract`, async() => { + it(`should click the view credits button`, async() => { + it('should click the add new credit button which opens the new credit form', async() => { + it('should fill the form but provide no grade to the new credit hence fail', async() => { + it('should provide a correct grade and succesfully save a new credit', async() => { + it('should be redirected to the credit index', async() => { + it('should check the amount of credits is the expected', async() => { + it('should navigate to the credit insurance section', async() => { + it('should bring the current contract to an end', async() => { + it(`should verify the addNewContract button is now present since there's no active contract`, async() => { + it(`should verify the endCurrentContract button is not present since there's no active contract`, async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/21_defaulter.spec.js b/test/cypress/integration/client/21_defaulter.spec.js new file mode 100644 index 000000000..33bfac42c --- /dev/null +++ b/test/cypress/integration/client/21_defaulter.spec.js @@ -0,0 +1,7 @@ +describe('Client defaulter path', () => { + it('should count the amount of clients in the turns section', async() => { + it('should check contain expected client', async() => { + it('should first observation not changed', async() => { + it('should not add empty observation', async() => { + it('should checked all defaulters', async() => { + it('should add observation for all clients', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/22_unpaid.spec.js b/test/cypress/integration/client/22_unpaid.spec.js new file mode 100644 index 000000000..704509373 --- /dev/null +++ b/test/cypress/integration/client/22_unpaid.spec.js @@ -0,0 +1,4 @@ +describe('Client unpaid path', () => { + it('should set cliet unpaid', async() => { + it('should save unpaid', async() => { + it('should confirm the unpaid have been saved', async() => { \ No newline at end of file diff --git a/test/cypress/integration/client/23_send_compensation.spec.js b/test/cypress/integration/client/23_send_compensation.spec.js new file mode 100644 index 000000000..2131b7456 --- /dev/null +++ b/test/cypress/integration/client/23_send_compensation.spec.js @@ -0,0 +1,2 @@ +describe('Client Send balance compensation', () => { + it(`should click on send compensation button`, async() => { \ No newline at end of file diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 728342304..53f9d1d73 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -91,6 +91,11 @@ Cypress.Commands.add('selectOption', (selector, option) => { cy.get(selector).click(); cy.get('.q-menu .q-item').contains(option).click(); }); +Cypress.Commands.add('countSelectOptions', (selector, option) => { + cy.waitForElement(selector); + cy.get(selector).click(); + cy.get('.q-menu .q-item').should('have.length', option); +}); Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => { cy.waitForElement('.q-form > .q-card');