From 6c4c5d9db7a100c3ec5417a56609f43bdf703d27 Mon Sep 17 00:00:00 2001 From: Marco Podesta <59153650+marcopod@users.noreply.github.com> Date: Fri, 14 Jun 2024 21:52:15 -0600 Subject: [PATCH] E2E indicated with comments --- cypress/e2e/auth/credentialsSignIn.cy.ts | 1 + cypress/e2e/auth/login.cy.ts | 10 --------- cypress/e2e/cv/editworkexperience.cy.ts | 28 ------------------------ cypress/e2e/cv/education.cy.ts | 1 + cypress/e2e/cv/generalInfo.cy.ts | 1 + cypress/e2e/cv/projects.cy.ts | 1 + cypress/e2e/cv/skills.cy.ts | 2 +- cypress/e2e/cv/workexperience.cy.ts | 1 + 8 files changed, 6 insertions(+), 39 deletions(-) delete mode 100644 cypress/e2e/auth/login.cy.ts delete mode 100644 cypress/e2e/cv/editworkexperience.cy.ts diff --git a/cypress/e2e/auth/credentialsSignIn.cy.ts b/cypress/e2e/auth/credentialsSignIn.cy.ts index fb03378..7f7e92b 100644 --- a/cypress/e2e/auth/credentialsSignIn.cy.ts +++ b/cypress/e2e/auth/credentialsSignIn.cy.ts @@ -7,6 +7,7 @@ describe('Login Component', () => { cy.get('.flex.items-center.justify-center.h-screen.w-screen').should('be.visible'); }); + // E2E it('should allow users to enter email and password', () => { cy.get('input[type="email"]').type('test@example.com'); cy.get('input[type="password"]').type('password123'); diff --git a/cypress/e2e/auth/login.cy.ts b/cypress/e2e/auth/login.cy.ts deleted file mode 100644 index 6d1db99..0000000 --- a/cypress/e2e/auth/login.cy.ts +++ /dev/null @@ -1,10 +0,0 @@ -describe('Login Page Tests', () => { - beforeEach(() => { - cy.visit('http://localhost:3000/login'); - }); - - it('should find an h2 element with the id "login-h2"', () => { - // Check if an h2 with the specified ID exists - cy.contains('Login').should('exist'); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/cv/editworkexperience.cy.ts b/cypress/e2e/cv/editworkexperience.cy.ts deleted file mode 100644 index 97f96f2..0000000 --- a/cypress/e2e/cv/editworkexperience.cy.ts +++ /dev/null @@ -1,28 +0,0 @@ -describe('Edit Existing Work Experience', () => { - beforeEach(() => { - cy.visit('http://localhost:3000/login'); - cy.get('input[type=email]').type('francoelugo@live.com'); - cy.get('input[type=password]').type('123'); - cy.get('form').submit(); - - cy.url().should(url => { - expect(url).to.match(/\/cv_gallery|\/editor/); - }); - - // Navigate to the editor if not already there - cy.url().then(url => { - if (!url.includes('/editor')) { - cy.visit('http://localhost:3000/editor'); - } - }); - }); - - it('Edits existing Work Experience', () => { - cy.get('ul.work-experience-list').contains('Software Developer').click(); - cy.get('input[name="description"]').clear().type('Led a team to develop software solutions'); - cy.get('button').contains('Save').click(); - cy.contains('Work Experience updated successfully'); - }); -}); - -export{} \ No newline at end of file diff --git a/cypress/e2e/cv/education.cy.ts b/cypress/e2e/cv/education.cy.ts index 38a32d1..c1ed4d8 100644 --- a/cypress/e2e/cv/education.cy.ts +++ b/cypress/e2e/cv/education.cy.ts @@ -16,6 +16,7 @@ describe('Education Editor Form Test', () => { }); }); + // E2E it('Updates the Education Section', () => { cy.get('ul.steps').find('button').contains('Education').click(); cy.get('button').contains('Add New Education').click(); diff --git a/cypress/e2e/cv/generalInfo.cy.ts b/cypress/e2e/cv/generalInfo.cy.ts index 7194aac..752d98a 100644 --- a/cypress/e2e/cv/generalInfo.cy.ts +++ b/cypress/e2e/cv/generalInfo.cy.ts @@ -23,6 +23,7 @@ describe('General Information Test', () => { cy.contains('General Info').should('exist'); }); + // E2E it('loads the correct initial values', () => { cy.visit('http://localhost:3000/editor'); // Asegurar que los campos se carguen con los valores esperados provenientes de la BD diff --git a/cypress/e2e/cv/projects.cy.ts b/cypress/e2e/cv/projects.cy.ts index d9ff2d0..26642c7 100644 --- a/cypress/e2e/cv/projects.cy.ts +++ b/cypress/e2e/cv/projects.cy.ts @@ -21,6 +21,7 @@ describe('Education Editor Form Test', () => { cy.contains('Projects').should('exist'); }); + // E2E it ('Updated Projects Section', () => { cy.get('ul.steps').find('button').contains('Projects').click(); cy.get('button').contains('Add New Project').click(); diff --git a/cypress/e2e/cv/skills.cy.ts b/cypress/e2e/cv/skills.cy.ts index 7602c32..cc44de7 100644 --- a/cypress/e2e/cv/skills.cy.ts +++ b/cypress/e2e/cv/skills.cy.ts @@ -21,6 +21,7 @@ describe('Work Experience Editor Form Test', () => { cy.contains('Skills').should('exist'); }); + // E2E it('Updates Skills section', () => { cy.get('ul.steps').find('button').contains('Skills').click(); cy.get('button').contains('Add Skill').click(); @@ -31,7 +32,6 @@ describe('Work Experience Editor Form Test', () => { cy.contains('Basic').should('be.visible'); }); - it('Validates Skills Form Fields', () => { cy.get('ul.steps').find('button').contains('Skills').click(); cy.get('button').contains('Add Skill').click(); diff --git a/cypress/e2e/cv/workexperience.cy.ts b/cypress/e2e/cv/workexperience.cy.ts index 2319d56..2e13c13 100644 --- a/cypress/e2e/cv/workexperience.cy.ts +++ b/cypress/e2e/cv/workexperience.cy.ts @@ -17,6 +17,7 @@ describe('Work Experience Editor Form Test', () => { }); }); + // E2E it ('Updates work experience section', () => { cy.get('ul.steps').find('button').contains('Work Experience').click(); cy.get('button').contains('Add New Work Experience').click();