-
Notifications
You must be signed in to change notification settings - Fork 13
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
base: master
Are you sure you want to change the base?
Conversation
README.md
Outdated
The following command opens the cypress console from which you can run the tests. | ||
|
||
``` | ||
npx cypress open |
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.
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
.
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.
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}/>); |
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.
👌
@@ -18,6 +18,7 @@ | |||
"predeploy": "yarn build", | |||
"deploy": "gh-pages -d build", | |||
"test": "react-scripts test --env=jsdom", | |||
"test:e2e": "npx cypress open", |
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.
You can just do cypress open
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.
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", |
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.
"test:e2e": "npx cypress open", | |
"test:e2e": "cypress open", |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
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?
Other information