-
Notifications
You must be signed in to change notification settings - Fork 311
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
test(cypress): Add support for integration tests via cypress #732
Conversation
Verified that @jstoffan has signed the CLA. Thanks for the pull request! |
This is great! |
test/cypress/integration/ContentExplorer/ContentExplorer.spec.js
Outdated
Show resolved
Hide resolved
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.
lgtm
@@ -50,6 +50,9 @@ | |||
"build:prod:npm": "BABEL_ENV=production OUTPUT=dist LANGUAGE=en-US REACT=true yarn build:prod:dist", | |||
"clean": "rm -rf dist lib i18n/json i18n/*.js reports styleguide", | |||
"copy:styles": "cpx './src/**/*.scss' lib", | |||
"cy:open": "yarn cy:wait; cypress open --project ./test", | |||
"cy:run": "yarn cy:wait; cypress run --project ./test --spec test/cypress/**/*.spec.js", | |||
"cy:wait": "wait-on tcp:6060", |
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.
Are there any concerns with hardcoding the port? Parallelism issues in Travis maybe?
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.
This is the hardcoded port of the styleguidist server. There's not really a way around it.
test/cypress.json
Outdated
@@ -0,0 +1,6 @@ | |||
{ | |||
"baseUrl": "http://localhost:6060/#", |
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.
Can we use the test folder instead, and inject the access token? This way we can use a non-hardcoded access token which could have additional scopes such as those needed for creating comments.
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.
The example files accept a token via the TOKEN
environment variable.
@@ -14,7 +14,7 @@ type Props = { | |||
}; | |||
|
|||
const SidebarContent = ({ actions, title, children }: Props) => ( | |||
<div className="bcs-content"> | |||
<div className="bcs-content" data-testid="bcs-content"> |
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.
It seems like we will have to add a bit of these to our code. Can we remove them with something like https://www.npmjs.com/package/babel-plugin-react-remove-properties ?
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.
We can look into doing so in a follow-up PR. I'd like to avoid transforming the lib/dist output with this change, if possible.
test/cypress/integration/ContentExplorer/ContentExplorer.spec.js
Outdated
Show resolved
Hide resolved
test/cypress/integration/ContentExplorer/ContentExplorer.spec.js
Outdated
Show resolved
Hide resolved
test/cypress/integration/ContentExplorer/ContentExplorer.spec.js
Outdated
Show resolved
Hide resolved
0f6bdaf
to
b9a58c7
Compare
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.
Once uncommented LGTM
🎉 This PR is included in version 8.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This isn't quite ready to merge yet due to some outstanding issues: