-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {}; |