Skip to content

Commit

Permalink
Update skills.cy.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
YuvanTec committed Jun 15, 2024
1 parent 2bea546 commit 854a492
Showing 1 changed file with 34 additions and 27 deletions.
61 changes: 34 additions & 27 deletions cypress/e2e/cv/skills.cy.ts
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
describe('Work Experience Editor Form Test', () => {
beforeEach(() => {
cy.visit('http://localhost:3000/login');
cy.get('input[type=email]').type('[email protected]');
cy.get('input[type=password]').type('123');
cy.contains('Sign In').click();
// Runs before each test case
beforeEach(() => {
cy.visit('http://localhost:3000/login');
cy.get('input[type=email]').type('[email protected]');
cy.get('input[type=password]').type('123');
cy.contains('Sign In').click();

cy.url().should(url => {
expect(url).to.match(/\/cv_gallery|\/editor/);
});

// navegar al editor
cy.url().then(url => {
if (!url.includes('/editor')) {
cy.visit('http://localhost:3000/editor');
}
});
cy.url().should((url) => {
expect(url).to.match(/\/cv_gallery|\/editor/);
});

it ('Renders skills section correctly', () => {
cy.contains('Skills').should('exist');
cy.url().then((url) => {
if (!url.includes('/editor')) {
cy.visit('http://localhost:3000/editor');
}
});
});

it ('Updates skills section', () => {
cy.get('ul.steps').find('button').contains('Skills').click();
cy.get('button').contains('Add Skill').click();
it('Renders Skills section correctly', () => {
cy.contains('Skills').should('exist');
});

// Fill out the form
cy.get('input[name="title"]').type('AWS');
cy.get('select[name="proficiency"]').select('Basic');
it('Updates Skills section', () => {
cy.get('ul.steps').find('button').contains('Skills').click();
cy.get('button').contains('Add Skill').click();
cy.get('input[name="title"]').type('AWS');
cy.get('select[name="proficiency"]').select('Basic');
cy.get('button').contains('Save').click();
cy.contains('AWS').should('be.visible');
cy.contains('Basic').should('be.visible');
});

// Save the new work experience
cy.get('button').contains('Save').click();

it('Validates Skills Form Fields', () => {
cy.get('ul.steps').find('button').contains('Skills').click();
cy.get('button').contains('Add Skill').click();
cy.get('input[name="title"]').should('be.visible');
cy.get('select[name="proficiency"]').should('be.visible');
});

});
});

});
export {};

0 comments on commit 854a492

Please sign in to comment.