-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#58] Cover feedback page with E2E tests
- Loading branch information
Andrey Romanov
committed
Mar 31, 2019
1 parent
9c54434
commit c8f88da
Showing
16 changed files
with
206 additions
and
119 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
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 |
---|---|---|
|
@@ -20,3 +20,4 @@ static/index.appcache | |
.idea | ||
.vscode | ||
npm-debug.* | ||
jsconfig.json |
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,52 @@ | ||
import { eventsPage } from '../objects/events-page'; | ||
import { feedbackPage } from '../objects/feedback-page'; | ||
|
||
describe('Feedback page', () => { | ||
beforeEach(() => { | ||
cy.visit('/'); | ||
}); | ||
|
||
specify('should be available from events page', () => { | ||
eventsPage.root().should('be.visible'); | ||
eventsPage.feedbackButton().should('be.visible'); | ||
eventsPage.feedbackButton().click(); | ||
|
||
eventsPage.root().should('not.be.visible'); | ||
feedbackPage.root().should('be.visible'); | ||
feedbackPage.back().should('be.visible'); | ||
feedbackPage.submit().should('be.visible'); | ||
feedbackPage.feedbackField().should('be.visible'); | ||
feedbackPage.emailField().should('be.visible'); | ||
}); | ||
|
||
specify('should have working back button', () => { | ||
cy.openFeedbackPage(); | ||
|
||
feedbackPage.back().should('be.visible'); | ||
feedbackPage.back().click(); | ||
|
||
feedbackPage.root().should('not.be.visible'); | ||
eventsPage.root().should('be.visible'); | ||
}); | ||
|
||
specify('should return to events page after submit', () => { | ||
cy.openFeedbackPage(); | ||
|
||
feedbackPage.feedbackField().type('Hello from E2E tests!'); | ||
feedbackPage.emailField().type('[email protected]'); | ||
feedbackPage.submit().click(); | ||
|
||
feedbackPage.root().should('not.be.visible'); | ||
eventsPage.root().should('be.visible'); | ||
}); | ||
|
||
specify('should be able to submit review without email', () => { | ||
cy.openFeedbackPage(); | ||
|
||
feedbackPage.feedbackField().type('Hello from E2E tests!'); | ||
feedbackPage.submit().click(); | ||
|
||
feedbackPage.root().should('not.be.visible'); | ||
eventsPage.root().should('be.visible'); | ||
}); | ||
}); |
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,27 @@ | ||
class FeedbackPage { | ||
root() { | ||
return cy.get('[data-marker="feedback-page"]'); | ||
} | ||
|
||
title() { | ||
return cy.get('[data-marker="feedback-page/title"]'); | ||
} | ||
|
||
feedbackField() { | ||
return cy.get('[data-marker="feedback-page/feedback-field"]'); | ||
} | ||
|
||
emailField() { | ||
return cy.get('[data-marker="feedback-page/email-field"]'); | ||
} | ||
|
||
back() { | ||
return cy.get('[data-marker="feedback-page/back"]'); | ||
} | ||
|
||
submit() { | ||
return cy.get('[data-marker="feedback-page/submit"]'); | ||
} | ||
} | ||
|
||
export const feedbackPage = new FeedbackPage(); |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
import { eventsPage } from '../../objects/events-page'; | ||
import { feedbackPage } from '../../objects/feedback-page'; | ||
|
||
Cypress.Commands.add('openFeedbackPage', () => { | ||
cy.visit('/'); | ||
feedbackPage.root().should('not.be.visible'); | ||
eventsPage.root().should('be.visible'); | ||
eventsPage.feedbackButton().should('be.visible'); | ||
|
||
eventsPage.feedbackButton().click(); | ||
|
||
eventsPage.root().should('not.be.visible'); | ||
feedbackPage.root().should('be.visible'); | ||
}); |
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
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,12 @@ | ||
import { EventsPage as EventsPageView } from './view'; | ||
import withRouter from 'react-router/lib/withRouter'; | ||
import { connect } from 'react-redux'; | ||
|
||
const mapStateToProps = ({ events }) => ({ | ||
isFetchingEvents: events.isFetchingEvents, | ||
events: events.events, | ||
eventsById: events.eventsById, | ||
localEvents: events.localEvents, | ||
}); | ||
|
||
export const EventsPage = connect(mapStateToProps)(withRouter(EventsPageView)); |
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 was deleted.
Oops, something went wrong.
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,5 @@ | ||
import withRouter from 'react-router/lib/withRouter'; | ||
import { connect } from 'react-redux'; | ||
import { FeedbackPage as FeedbackPageView } from './view'; | ||
|
||
export const FeedbackPage = connect()(withRouter(FeedbackPageView)); |
Oops, something went wrong.
c8f88da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
c8f88da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
potracheno-personal – ./
potracheno-personal-git-master.dudeka.vercel.app
potracheno-personal.vercel.app
potracheno-personal.dudeka.vercel.app