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

This closes #29, adds cypress for e2e tests. #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

josenaranjo
Copy link

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Documentation content changes
[x] Other... Please describe:

Adds cypress as the e2e tests framework.

What is the current behavior?

Issue Number: 29

What is the new behavior?

You can open cypress console running npx cypress open in your terminal.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

README.md Outdated
The following command opens the cypress console from which you can run the tests.

```
npx cypress open
Copy link
Member

Choose a reason for hiding this comment

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

Hello @josenaranjo, thanks for working on this!

It would be nice to have an npm script that does this. I can think of something like test:e2e or just e2e.

Copy link
Author

Choose a reason for hiding this comment

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

Done

@@ -15,7 +15,7 @@ const Container = styled.div`

const displayBoxes = ({ numberBoxes, width, height }) =>
Array.from({ length: numberBoxes }, (_, i) =>
<Box primary={i % 2 === 0} width={width} height={height} key={i}/>);
<Box data-e2e={`box-${i}`} primary={i % 2 === 0} width={width} height={height} key={i}/>);
Copy link
Member

Choose a reason for hiding this comment

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

👌

@@ -18,6 +18,7 @@
"predeploy": "yarn build",
"deploy": "gh-pages -d build",
"test": "react-scripts test --env=jsdom",
"test:e2e": "npx cypress open",
Copy link
Member

Choose a reason for hiding this comment

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

You can just do cypress open

Copy link
Author

Choose a reason for hiding this comment

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

I tried it command not found: cypress. I think it depends if you installed globally or not.

@@ -18,6 +18,7 @@
"predeploy": "yarn build",
"deploy": "gh-pages -d build",
"test": "react-scripts test --env=jsdom",
"test:e2e": "npx cypress open",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"test:e2e": "npx cypress open",
"test:e2e": "cypress open",

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.

None yet

2 participants