-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from stazrouti/testing
Testing
- Loading branch information
Showing
6 changed files
with
172 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
describe('Footer', () => { | ||
beforeEach(() => { | ||
cy.visit("http://localhost:3000/about"); | ||
|
||
}); | ||
|
||
it('displays About information', () => { | ||
cy.get('h3').contains('About').should('exist'); | ||
cy.get('h2').contains('You start the engine and your adventure begins').should('exist'); | ||
cy.get('p').contains('Certain but she but shyness why cottage. Guy the put instrument sir entreaties affronting. Pretended exquisite see cordially the you. Weeks quiet do vexed or whose. Motionless if no to affronting imprudence no precaution. My indulged as disposal strongly attended.').should('exist'); | ||
|
||
}); | ||
|
||
it('plan section', () => { | ||
cy.get('h3').contains('Plan your trip now').should('exist'); | ||
cy.get('h2').contains('Quick & easy car rental').should('exist'); | ||
cy.get('h3').contains('Contact Operator').should('exist'); | ||
|
||
}); | ||
|
||
it('Banner', () => { | ||
cy.get('h2').contains('Book a car by getting in touch with us').should('exist'); | ||
cy.get('h3').contains('(123) 456-7869').should('exist'); | ||
|
||
}); | ||
|
||
}); | ||
|
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
describe('Faq component tests', () => { | ||
beforeEach(() => { | ||
cy.visit('http://localhost:3000/'); | ||
}); | ||
|
||
it('renders Faq component', () => { | ||
cy.get('.faq-content').should('exist'); | ||
cy.get('h5').contains('FAQ'); | ||
cy.get('h2').contains('Frequently Asked Questions'); | ||
}); | ||
|
||
it('initially sets activeQ state to "q1"', () => { | ||
cy.get('p').contains('1. What is special about comparing rental car deals?'); | ||
cy.get('#q1').should('have.class', 'active-question'); | ||
// Simulate a click to toggle the question state | ||
cy.get('#q1').click(); | ||
|
||
// Now, the class 'active-question' should be removed | ||
cy.get('#q1').should('not.have.class', 'active-question'); | ||
}); | ||
|
||
it('initially sets activeQ state to "q2"', () => { | ||
// the class 'active-question' should be removed | ||
cy.get('#q2').should('not.have.class', 'active-question'); | ||
cy.get('p').contains('2. How do I find the car rental deals?'); | ||
// Simulate a click to toggle the question state | ||
cy.get('#q2').click(); | ||
cy.get('#q2').should('have.class', 'active-question'); | ||
cy.get('#q2').click(); | ||
cy.get('#q2').should('not.have.class', 'active-question'); | ||
}); | ||
|
||
it('initially sets activeQ state to "q3"', () => { | ||
// the class 'active-question' should be removed | ||
cy.get('#q3').should('not.have.class', 'active-question'); | ||
cy.get('p').contains('2. How do I find the car rental deals?'); | ||
// Simulate a click to toggle the question state | ||
cy.get('#q3').click(); | ||
cy.get('#q3').should('have.class', 'active-question'); | ||
cy.get('#q3').click(); | ||
cy.get('#q3').should('not.have.class', 'active-question'); | ||
}); | ||
|
||
it('test open close multiple times', () => { | ||
cy.get('#q1').click(); | ||
// the class 'active-question' should be removed | ||
cy.get('#q1').should('not.have.class', 'active-question'); | ||
cy.get('#q2').should('not.have.class', 'active-question'); | ||
cy.get('#q3').should('not.have.class', 'active-question'); | ||
|
||
// Simulate a click to toggle the question state | ||
cy.get('#q1').click(); | ||
cy.get('#q1').should('have.class', 'active-question'); | ||
cy.get('#q2').should('not.have.class', 'active-question'); | ||
cy.get('#q3').should('not.have.class', 'active-question'); | ||
|
||
cy.get('#q2').click(); | ||
cy.get('#q1').should('not.have.class', 'active-question'); | ||
cy.get('#q2').should('have.class', 'active-question'); | ||
cy.get('#q3').should('not.have.class', 'active-question'); | ||
|
||
cy.get('#q3').click(); | ||
cy.get('#q1').should('not.have.class', 'active-question'); | ||
cy.get('#q2').should('not.have.class', 'active-question'); | ||
cy.get('#q3').should('have.class', 'active-question'); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
describe('Footer', () => { | ||
beforeEach(() => { | ||
cy.visit("http://localhost:3000/"); | ||
|
||
}); | ||
|
||
it('displays company information', () => { | ||
cy.get('.footer-content__1').should('exist'); | ||
|
||
|
||
cy.contains('CAR Rental').should('exist'); | ||
cy.contains('We offers a big range of vehicles for all your driving needs. We have the perfect car to meet your needs.').should('exist'); | ||
cy.contains('(123) -456-789').should('exist'); | ||
cy.contains('[email protected]').should('exist'); | ||
cy.contains('Design by XpeedStudio').should('exist'); | ||
}); | ||
|
||
it('navigates to external link', () => { | ||
cy.get('.footer-content__1 a[href="https://xpeedstudio.com/"]').should('exist'); | ||
cy.get('.footer-content__1 a[href="https://xpeedstudio.com/"]').should('have.attr', 'target', '_blank'); | ||
cy.get('.footer-content__1 a[href="https://xpeedstudio.com/"]').should('have.attr', 'rel', 'noreferrer'); | ||
}); | ||
|
||
it('displays working hours', () => { | ||
cy.get('.footer-content__2 li').contains('Working Hours').should('exist'); | ||
cy.get('.footer-content__2 li').contains('Mon - Fri: 9:00AM - 9:00PM').should('exist'); | ||
cy.get('.footer-content__2 li').contains('Sat: 9:00AM - 19:00PM').should('exist'); | ||
cy.get('.footer-content__2 li').contains('Sun: Closed').should('exist'); | ||
}); | ||
|
||
it('handles subscription form', () => { | ||
cy.get('.footer-content__2 li').contains('Subscription').should('exist'); | ||
cy.get('.footer-content__2 input[type="email"]').should('exist'); | ||
cy.get('.footer-content__2 button.submit-email').should('exist'); | ||
}); | ||
}); | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
it("show car details", () => { | ||
cy.visit("http://localhost:3000/"); | ||
cy.get('.pick-container__title') // replace with the actual selector for your modal | ||
.should('be.visible') // Check if the modal is visible | ||
.contains('Vehicle Models'); | ||
|
||
cy.get('.pick-description__table__col').should('be.visible').contains('Audi'); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('AC'); | ||
|
||
/* cy.get('BMW 320 ModernLine'); */ | ||
cy.get('#btn4').click(); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('320'); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('BMW'); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('AC'); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('Diesel'); | ||
|
||
cy.get('.cta-btn').click(); | ||
cy.expect('http://localhost:3000/#booking-section'); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
it("show car details", () => { | ||
cy.visit("http://localhost:3000/"); | ||
cy.get('.pick-container__title') // replace with the actual selector for your modal | ||
.should('be.visible') // Check if the modal is visible | ||
.contains('Vehicle Models'); | ||
|
||
cy.get('.pick-description__table__col').should('be.visible').contains('Audi'); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('AC'); | ||
|
||
/* cy.get('BMW 320 ModernLine'); */ | ||
cy.get('#btn4').click(); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('320'); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('BMW'); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('AC'); | ||
cy.get('.pick-description__table__col').should('be.visible').contains('Diesel'); | ||
|
||
cy.get('.show-scroll').click({force: true}); | ||
cy.get('.show-scroll').should('not.exist'); | ||
}); |