-
Notifications
You must be signed in to change notification settings - Fork 58
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
Browser testing #291
Browser testing #291
Conversation
|
Codecov Report
@@ Coverage Diff @@
## master #291 +/- ##
===========================================
+ Coverage 93.53% 100.00% +6.46%
===========================================
Files 1 1
Lines 263 108 -155
Branches 70 33 -37
===========================================
- Hits 246 108 -138
+ Misses 16 0 -16
+ Partials 1 0 -1
Continue to review full report at Codecov.
|
@stefcameron, e2e cypress tests fail because of missing permission that I don't have access to permit. Once fixed I can continue. Edit: unrelated I would like to know why Codecov thinks there is a change to the test coverage as I haven't touched any source or test code that it knows about. |
This is a strange issue. I'm not aware of any special permissions given in focus-trap and focus-trap-react as comparison, and yet Cypress works fine in CI in those repos. Maybe you need
Another mystery, I'm afraid. You also asked somewhere else how to merge code coverage from Cypress into code coverage from Jest. I don't know how to do that either. Not much help... 😞 I did find this article: https://docs.cypress.io/guides/tooling/code-coverage But I don't think it's talking about how to merge coverage from two test systems into one for a single combined report. Honestly, integration with As for what to have as unit tests in Jest (since I'd prefer to keep Jest "hooked up" than to rip it out), if everything moves over because everything is technically an integration/e2e test, then we can add 2 simple tests that verify that Ideally, more inner parts of the source code would be exported so that they could be individually unit tested, but I'm not asking to do that. I would simply prefer to keep Jest in place and ready for unit tests in the future for new work in future PRs (so that adding a unit test then doesn't also mean re-adding Jest to the repo and configuring it; that will be too much effort to ask, and the test just won't get written, or it'll get written with Cypress, which, at least IMO, isn't really the tool to test such things). |
👍 this was the issue
I don't mind having tests for node and browser. I believe it isn't an overkill to test any flow that should run in the browser if we already run other tests in a browser, the overhead is non existing (I will expand in the issue). We can keep the node testing for unit tests and set the env to node, so it will not mock the dom and it can actually check that the lib can load in node and do other non-dom related tests (although I would still pick a setup with common test libs with the browser tests - mocha/chai/sinon - not that I have any particular love for them :/ ).
I think I will continue and see where this leads. Getting 2 separate reports is not helpful. |
@stefcameron, I think I'm done, Notice that I changed the CI tests and you need to reset the required jobs. |
Thank you for your work here! 🎉 I will review as soon as I can. I updated the required CI tests to be the new Node 14, e2e Chrome and e2e Firefox jobs. |
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.
Nice work! This looks great to me. I'm glad the existing Jest/Testing-Library tests moved over to Cypress fairly easily (at least that's what it looks like to me 😄 maybe it wasn't so easy for you when you were figuring it out 😉 ).
I'm approving ahead of updating/syncing the version of Cypress used for testing. Let's see if that works, and we'll merge this!
I would say no problem, but I'm stuck in a remote place until Saturday and for some weird reason installing Cypress from my Wifi/mobile just won't finish :/ I will try again tomorrow. |
- single test that uses the current fixtures - add test:e2e to package scripts
- combination of promise and cypress commands caused tests to be skipped - moved helpers to e2e folder instead of cypress commands
install and then run
- lint - types - unit tests - build
bc58248
to
f392dde
Compare
Thanks for trying. I found a few minutes this morning and made the change myself. It was a lot more than just one new commit because there had been conflicting package.json updates made on master since, and those had to be carried all the way through your dozen or so commits... 😄 LMK if it looks good to you. If so, and if it succeeds, I'll merge it. |
Thank you. Looks fine to me. |
@allcontributors add @idoros for tests |
I've put up a pull request to add @idoros! 🎉 |
This PR brings back browser testing using Cypress as requested in #289.
Fixes #289
try merging with unit if possibletest
scriptNot done in this PR:
PR Checklist