Skip to content

Commit

Permalink
Refactor e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Billmike committed Mar 16, 2018
1 parent fb83d43 commit 3e6a08e
Show file tree
Hide file tree
Showing 26 changed files with 701 additions and 48 deletions.
6 changes: 3 additions & 3 deletions client/public/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/public/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/public/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/public/style.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/src/__tests__/components/RecipesForm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('<RecipesForm/>', () => {
url: 'link'
});
});
it('Should handle onDrop method', () => {
it('Should handle onDrop method that sets the imageUrl state', () => {
const handleDrop = jest.fn();
const wrapper = shallow(<RecipesForm>
<DropZone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports[`Should render the 404 page correctly 1`] = `
/>
<Link
id="homepageLink"
replace={false}
to="/"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`<ProfilePage /> Should render the profile page correctly 1`] = `
<div>
<main
className="container"
id="profileContainer"
>
<h1
className="profile-h1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ exports[`<UserLinks /> Should render the UserLinks component correctly 1`] = `
>
<Link
className="nav-link custom-link"
id="profileID"
replace={false}
to="/profile"
>
Expand Down
6 changes: 5 additions & 1 deletion client/src/actions/userSignupAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,9 @@ export const signupRequest = userData => (dispatch) => {
toastr.success('Login Successful.');
dispatch(setCurrentUser(jwt.decode(token)));
})
.catch(error => error);
.catch((error) => {
if (error.response.data.message === 'Username must be unique.') {
toastr.error(error.response.data.message);
}
});
};
5 changes: 4 additions & 1 deletion client/src/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ html {

body {
background: whitesmoke !important;
margin-bottom: 120px !important;
margin-bottom: 60px !important;
}

.navbar {
Expand Down Expand Up @@ -317,6 +317,7 @@ h4 {
background-color: brown;
border-color: white;
border-radius: 10px !important;
margin-bottom: 7pc;
}

.action-btn {
Expand Down Expand Up @@ -498,6 +499,7 @@ a:hover {
.custom-pagination {
justify-content: center;
padding-top: 15px;
padding-bottom: 50px;
}

.page-item.active .page-link {
Expand Down Expand Up @@ -529,6 +531,7 @@ a:hover {
border-radius: 15px;
overflow-y: scroll;
max-height: 700px;
margin-bottom: 7pc;
}

.reviewer-name {
Expand Down
1 change: 0 additions & 1 deletion client/src/components/Hompage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export class Homepage extends Component {
}

export const mapStateToProps = (state) => {
console.log('current state', state);
return {
popularRecipes: state.recipes.popularRecipes,
recipes: state.recipes.recipes,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/NotFoundPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const NotFoundPage = () => (
<p className="p-section">
You've gone too far in search of a dessert, init?
<Emoji text=":'(" />{' '}
<Link to="/"> Go back</Link>
<Link id="homepageLink" to="/"> Go back</Link>
</p>
</div>
<Footer />
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ProfilePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ProfilePage extends Component {
render() {
return (
<div>
<main className="container">
<main id="profileContainer" className="container">
<h1 className="profile-h1">My Profile</h1>
<div className="profile-card">
<img src={cool} alt="John" className="profile-image" />
Expand Down
1 change: 1 addition & 0 deletions client/src/components/navlinks/userLinks.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const userLinks = props => (
</li>
<li className="nav-item">
<Link
id="profileID"
to="/profile"
className="nav-link custom-link">
My Profile
Expand Down
45 changes: 31 additions & 14 deletions e2e_test_reports/CHROME_64.0.3282.186_Mac OS X_dashboard_test.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="0"
failures="0"
tests="6">
tests="7">

<testsuite name="dashboard_test"
errors="0" failures="0" hostname="" id="" package="dashboard_test" skipped="0"
tests="6" time="60.97" timestamp="Wed, 14 Mar 2018 14:35:43 GMT">
tests="7" time="71.77" timestamp="Fri, 16 Mar 2018 04:43:18 GMT">

<testcase name="Signin a user into their dashboard" classname="dashboard_test" time="11.75" assertions="10">
<testcase name="Signin a user into their dashboard" classname="dashboard_test" time="8.689" assertions="10">



Expand All @@ -30,11 +30,7 @@

</testcase>

<testcase name="Create a recipe with a logged-in user" classname="dashboard_test" time="8.369" assertions="13">




<testcase name="Create a recipe without complete details" classname="dashboard_test" time="8.047" assertions="11">



Expand All @@ -59,7 +55,9 @@

</testcase>

<testcase name="Delete a recipe by a logged in user" classname="dashboard_test" time="2.991" assertions="12">
<testcase name="Create a recipe as a logged-in user" classname="dashboard_test" time="9.162" assertions="13">





Expand All @@ -86,7 +84,15 @@

</testcase>

<testcase name="Edit recipe by logged-in user" classname="dashboard_test" time="2.561" assertions="8">
<testcase name="Delete a recipe by a logged in user" classname="dashboard_test" time="1.976" assertions="12">











Expand All @@ -105,7 +111,7 @@

</testcase>

<testcase name="Add and remove Recipe from users favorites" classname="dashboard_test" time="15.87" assertions="14">
<testcase name="Edit recipe by logged-in user" classname="dashboard_test" time="2.795" assertions="8">



Expand All @@ -121,6 +127,15 @@




</testcase>

<testcase name="Add and remove Recipe from users favorites" classname="dashboard_test" time="18.94" assertions="13">








Expand All @@ -134,9 +149,6 @@



</testcase>

<testcase name="Upvote a recipe and leave reviews as a logged-in user" classname="dashboard_test" time="19.43" assertions="26">



Expand All @@ -145,6 +157,11 @@



</testcase>

<testcase name="Upvote a recipe and leave reviews as a logged-in user" classname="dashboard_test" time="22.16" assertions="23">





Expand Down
17 changes: 14 additions & 3 deletions e2e_test_reports/CHROME_64.0.3282.186_Mac OS X_hompage_test.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="0"
failures="0"
tests="1">
tests="2">

<testsuite name="hompage_test"
errors="0" failures="0" hostname="" id="" package="hompage_test" skipped="0"
tests="1" time="4.691" timestamp="Wed, 14 Mar 2018 14:36:45 GMT">
tests="2" time="10.06" timestamp="Fri, 16 Mar 2018 04:44:30 GMT">

<testcase name="Homepage Test" classname="hompage_test" time="4.691" assertions="11">
<testcase name="Homepage Test" classname="hompage_test" time="5.094" assertions="11">



Expand All @@ -28,6 +28,17 @@





</testcase>

<testcase name="Search for recipes" classname="hompage_test" time="4.968" assertions="4">








</testcase>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites errors="0"
failures="0"
tests="2">

<testsuite name="recipe_validation"
errors="0" failures="0" hostname="" id="" package="recipe_validation" skipped="0"
tests="2" time="17.42" timestamp="Thu, 15 Mar 2018 18:04:46 GMT">

<testcase name="Signin a user into their dashboard" classname="recipe_validation" time="9.296" assertions="10">




















</testcase>

<testcase name="Create a recipe without complete details" classname="recipe_validation" time="8.124" assertions="11">






















</testcase>





</testsuite>
</testsuites>
10 changes: 5 additions & 5 deletions e2e_test_reports/CHROME_64.0.3282.186_Mac OS X_signup_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

<testsuite name="signup_page"
errors="0" failures="0" hostname="" id="" package="signup_page" skipped="0"
tests="4" time="20.27" timestamp="Wed, 14 Mar 2018 14:36:49 GMT">
tests="4" time="21.87" timestamp="Fri, 16 Mar 2018 04:44:40 GMT">

<testcase name="Signup with incomplete user information" classname="signup_page" time="8.872" assertions="5">
<testcase name="Signup with incomplete user information" classname="signup_page" time="10.60" assertions="5">



Expand All @@ -20,7 +20,7 @@

</testcase>

<testcase name="Signup with valid credentials" classname="signup_page" time="6.761" assertions="10">
<testcase name="Signup with valid credentials" classname="signup_page" time="6.676" assertions="10">



Expand All @@ -43,7 +43,7 @@

</testcase>

<testcase name="Sign-in a registered user" classname="signup_page" time="3.273" assertions="10">
<testcase name="Sign-in a registered user" classname="signup_page" time="3.256" assertions="10">



Expand All @@ -66,7 +66,7 @@

</testcase>

<testcase name="Sign-out a signed-in user" classname="signup_page" time="1.361" assertions="6">
<testcase name="Sign-out a signed-in user" classname="signup_page" time="1.337" assertions="6">



Expand Down
Loading

0 comments on commit 3e6a08e

Please sign in to comment.