Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial e2e-tests #26

Merged
merged 4 commits into from May 6, 2022
Merged

Initial e2e-tests #26

merged 4 commits into from May 6, 2022

Conversation

magdapoppins
Copy link
Contributor

Fixes #17

Purpose

In addition to our unit test, let's have a set of e2e-tests that ensure that the page works and looks as expected. I chose cypress for this purpose since the NextJS docs point at it as an easy starting point.

How to test

Run yarn cypress and the example test.

@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #26 (22e995d) into main (ba4995c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main      #26   +/-   ##
=======================================
  Coverage   99.07%   99.07%           
=======================================
  Files           8        8           
  Lines         108      108           
  Branches       22       22           
=======================================
  Hits          107      107           
  Partials        1        1           
Flag Coverage Δ
db-unittests 100.00% <ø> (ø)
ui-unittests 98.07% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/pages/Homepage/EventCard.tsx 95.45% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa1d355...22e995d. Read the comment docs.

@magdapoppins magdapoppins marked this pull request as ready for review April 4, 2022 14:35
Copy link
Contributor

@lauravuo lauravuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it cypress style to have the tests in folder cypress ? I mean, does the gh action require it? I would use e2e.

package.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@eevajonnapanula eevajonnapanula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looking good 👍🏻 One think I think should be changed is the way to reach the tested element; so, use (for example) data-cy instead of redundant class name :) See the comments for exact places. More information about data-cy etc.

README.md Show resolved Hide resolved
cypress/integration/landingpage_spec.js Outdated Show resolved Hide resolved
components/pages/Homepage/EventCard.tsx Outdated Show resolved Hide resolved
@magdapoppins
Copy link
Contributor Author

magdapoppins commented May 2, 2022

@lauravuo I think the cypress folder is a cypress convention. We could apparently change it to e.g. "e2e" but that seems to require a a few different configs being changed (they don't seem to have a single option to change the test folder name). Should we still change it or is the current way ok?

As it is now yarn cypress creates a new "cypress" folder each time it's run if there isn't one already. :D

@lauravuo
Copy link
Contributor

lauravuo commented May 2, 2022

@magdapoppins if it is convention, then it is ok!

@magdapoppins magdapoppins dismissed eevajonnapanula’s stale review May 6, 2022 12:15

Fixed comments + taking Lauras approval!

@magdapoppins magdapoppins merged commit 07e81dd into main May 6, 2022
@magdapoppins magdapoppins deleted the e2e branch May 6, 2022 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add initial e2e tests
3 participants