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

test(cypress): Add support for integration tests via cypress #732

Merged
merged 8 commits into from
Jan 4, 2019

Conversation

jstoffan
Copy link
Contributor

@jstoffan jstoffan commented Jan 3, 2019

This isn't quite ready to merge yet due to some outstanding issues:

  • Improve the example test and selectors
  • Improve eslint rules via cypress plugin
  • Decide on using /examples or /test harness files
  • Decide on nested component testing format (ContentExplorer -> ContentPreview -> ContentSidebar)
  • Update CI tasks to run tests on merge and release

@jstoffan jstoffan requested a review from a team as a code owner January 3, 2019 01:13
@boxcla
Copy link

boxcla commented Jan 3, 2019

Verified that @jstoffan has signed the CLA. Thanks for the pull request!

@alexkrolick
Copy link
Contributor

This is great!

Copy link
Contributor

@jeremypress jeremypress left a comment

Choose a reason for hiding this comment

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

lgtm

test/cypress/fixtures/example.json Outdated Show resolved Hide resolved
test/cypress/plugins/index.js Outdated Show resolved Hide resolved
test/cypress/support/index.js Outdated Show resolved Hide resolved
pramodsum
pramodsum previously approved these changes Jan 3, 2019
@@ -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",
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@@ -0,0 +1,6 @@
{
"baseUrl": "http://localhost:6060/#",
Copy link
Contributor

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.

Copy link
Contributor Author

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">
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.

.npmignore Show resolved Hide resolved
DanDeMicco
DanDeMicco previously approved these changes Jan 4, 2019
Copy link
Contributor

@DanDeMicco DanDeMicco left a comment

Choose a reason for hiding this comment

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

Once uncommented LGTM

package.json Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@jstoffan jstoffan merged commit 3904eb0 into box:master Jan 4, 2019
@jstoffan jstoffan deleted the cypress branch January 4, 2019 22:55
@pramodsum
Copy link
Contributor

🎉 This PR is included in version 8.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants