Should I test a minified production build with cypress? - testing

I'm testing a meteor app (with React.js as client) with cypress.
I'm willing to create a CI/CD script which will execute my cypress tests, but I think I am missing a point; how will cypress test my app with a production version of my app running, meaning with minified code ?
I saw that best practices were to provide data-* attributes as selectors for my elements, but this is pointless if every value is going to be minified.
I believe this is the wrong approach since I didn't see any question here about that.. But maybe someone can help me understand why ?
Thanks in advance !

Related

For TestCafe, is it possible to get a hook before the browser is launched?

Is it possible to get a hook on e.g. fixture before the browser is launched? The hooks on fixture (e.g. before) and test all happen after the browser is launched.
The only thing I can see to use is the --app switch but I'm not sure that's enough for me. Any help appreciated.
m
Could you please describe why you need this usage scenario?
Currently, there is no way to run the fixture hooks before the browser is launched. As a workaround, you can use the `createTestCafe function to run TestCafe tests from script. In this script, you can run any JS code you want before the tests start.
Please refer to the following article for details:
https://testcafe.io/documentation/402662/reference/testcafe-api/global/createtestcafe

Why might my Vue.js project not show up during a CircleCI test using Cypress?

My project is built using Vue.js, powered by Nuxt
I’m using Cypress to write/run tests
I’m using CircleCI (v2) to run the tests
Locally, using Cypress’s instance of the Electron browser on macOS, the tests run correctly.
On CircleCI, the tests display a blank screen.
I’ve SSHed into CircleCI after the tests have failed, and if I make a curl request to the local server at that address, the correct HTML is returned to me.
My hypothesis is that the browser is not able to run Vue.js, but without a console log it’s hard to tell.
Any ideas as either how to continue debugging, or even better, fix it?
Edit: I’ve written an extra test to use another site, and it loaded correctly, so I can confirm that everything else is working.
Edit: It’s in my Nuxt config, just going through it now to pull out the line causing the problem.
So, of course this was super annoying. I’m not sure what the chances are of this happening to somebody else, but here’s the answer to my problem:
Google Analytics
On my CI I don’t have a GA code, and it was falling back to empty string, so it wasn’t able to load the page. It didn’t show up on the sever logs as it was an issue on the client side, and it’s not yet possible to easily get client logs using Cypress (coming soon).
Interesting, Thomas,
Could you open a GitHub issue with a link to a small repo that we can try ourselves? I do not see any factors that might affect running Cypress tests against Nuxt app on Circle

How to integrate TestRail with Jest tests?

I'm running Jest integration tests on Jenkins and I want to integrate them with TestRail in order to automatically put test results to TestRail. In this way I will know easily how many tests are passed/failed?
Does anyone tried that?
I guess you are looking for something like this one https://github.com/zeljkosimic95/Jest-2-Testrail . Although your question is too old but it might help someone else. This is not official plugin but it may help you.
Adding a suggestion here, we should choose the tool after analyzing all the requirements in your software testing services and product. Because there is no official plugin for this except this https://gitlab.com/craydent/jest-testrail (haven't tried). But you still can do this without plugin with this library/code https://github.com/zeljkosimic95/Jest-2-Testrail
You can probably have a look at Agiletestware Pangolin solution which allows you to export results of your tests into TestRail automatically from popular CI systems.
In order to be able to upload test results, Pangolin requires you to create report in JUnit format which can be done by using https://github.com/jest-community/jest-junit
Disclaimer: I'm a developer of Agiletestware Pangolin

Integrating Jest with JSPM based app

So I wanted to use Jest with my jspm project to write some unit tests, but it turned out it's not so easy... Well, it even turned out it's not so easy with any other testing framework.
How do I write tests for my jspm app? Which framework should I choose? Everything that I look up is quite complicated. I haven't found an easy solution. Every framework seems to require a bunch of workarounds to get things working in jspm setup. I feel kind of lost at the moment
If not Jest, then what would be the least painful way of testing an app in jspm setup?
its true that without a 3rd party utility its not really possible to test a jspm based app with Jest.
luckily, there's such a tool to help you do that: https://www.npmjs.com/package/gulp-jest-jspm (mine coincidentally)
You will need to install and use Gulp in order to run your tests
Ive been testing my own React app (built with JSPM) with Jest and its very straightforward.
I've found Jest to be very easy to learn and use. Let me know if you need more info
Yoav

Any good command-line tools (for a build server) for validating websites?

My team creates a number of dynamic/data-driven websites. We use a CruiseControl.NET to download the code, create test data, run unit tests, and install each site into IIS for manual testing. However we haven't found a good tool (or tools) that can actually run through some simple tests of the websites, such as checking for broken links or invalid HTML.
Are there any good tools that we can incorporate into our build process to automate basic website testing? E.g. check for broken links, check for HTML/JavaScript/CSS coding errors, and so on? Load testing would be great too.
Looking for something totally generic; we don't need to write/record scripts for playback. Just something to cover the basics.
Thank you!
-James
For link checking you could always look at http://linkchecker.sourceforge.net/ if that isn't suitable they list other alternatives.
It also seems like it is an active project.
JSLint does javascript validation and there are two options for executing it via the commandline so that might be worth a look too http://www.jslint.com/