Generating a HTML test-report with Karma - html

My team currently use karma as the testrunner for our unit tests. We are now trying to figure out if there is a way to get karma to generate a html-file containing the test-results.
What we hope to achieve by this is that we can have karma running on one of our servers and that whenever we upload new code or tests, our tests will be re-run on a myriad of different browsers. The html-files generated by these tests could then be displayed by anyone wanting to see whether or not all tests still go green on all the different desktop and mobile browsers tested.
Currently I've looked into using Karma's junit reporter and then post-process these files with ant to get HTML-files, but we're currently using Grunt as our building tool and I'd prefer not having to include ant to the mix.
Also, is there some sort of guide to creating Karma reporters if we decide that creating one would be the best way to solve our issue?

I've written a simple HTML reporter which does the job:
https://github.com/matthias-schuetz/karma-htmlfile-reporter
Just add it to your karma.conf.js and it will produce an HTML file with test results.

Related

Writing Jasmine unit tests in ES6 and using Chutzpah as test runner Visual Studio 2019

I am using the Jasmine testing library to write my unit tests. I'd like to use ES6 syntax to write the tests and am also testing files written in ES6.
I want to use Chutzpah as the test runner (I am open to other suggestions). At a basic level, I just want my tests discovered and ran in the Visual Studio Test Explorer menu. I cannot do this with ES6 files as Chutzpah isn't 'discovering' them if there's any ES6 syntax in the Javascript files (no import/export use, just something like plain arrow functions).
Ideally, I do not want to use node, hence the Jasmine library with no dependencies. At the moment I'm able to run my tests using the Chrome browser as a test runner. I'm using the standalone Jasmine library.
I'd like for these tests and the process to be transportable across both ASP.NET Core and ASP.NET projects. Also, it would be a huge plus if I can have this automated into an Azure build process so the JavaScript unit tests run any time I make a code commit, instead of me manually running the tests before I commit.
Is this achievable? Completely new to testing and setting up this kind of process.
I see my only pain point here is that I need to just transpile my ES6 code into ES5 and I can use all the tools I've mentioned (Chutzpah, Jasmine). However, I'm not sure how to do this without adding a node configuration.
If anyone can so much as to just give me an example of a simple transpilation process from ES6 to ES5 (without node), even that would be a huge help.

is it possible to execute nightwatch tests using/within another tool like playright or puppeteer?

I have a bunch of Nightwatch tests. Nightwatch is not getting updates as fast as other JS tools in the market. I don't want to recreate the tests again just so I can make a switch to for example playwright. Is it possible to run nightwatch tests with anothert ool?
As far as I know, it is NOT possible to do that currently.
But would be interested to know what is your case in getting this done. If you are looking to run Nightwatch tests using cucumber, jest, etc.., you can try Nightwatch-API

AIR Build Server Setup

I am at the point where I am running into incredibly long build times for my project and more projects to come. I would like to make a build server but I have not had any experience with them aside from downloading files from them as an end user.
My ideal setup is this: A GitHub where I can place my .fla file, classes and ANEs. The server sees this, compiles it, and allows me to test it remotely or hook into some debugger that lets me see stack traces and active variables at breakpoints and errors like Adobe Animate or Flash Builder.
Now I see there are GitHub plugins for Jenkins. I see there are questions referring to how to set one up with Flex/AIR. I come here with a few issues.
I am too far into my project to switch over from using Animate to something like Flash Develop or anything ADT related. The only thing I have found is how to take existing elements from my library in Animate and have them in a .swc for handling. However, this doesn't let me access existing elements in the Timeline and would rather not try to export/position/handle them in code (which is the only workaround that I see if this is not possible)
I run ANEs that are dependent on Google Play services and other Android specific libraries. Thus, I haven't been able to use the standard mobile debug launcher for AIR. I see Jenkins has some specific abilities for Android. Is it possible to somehow use this to give me a proper window for testing? I am thinking that I would need to run their emulator after compiling everything but I am unsure if there is a more efficient method or if it would even work.
I have never worked with Jenkins before or any other tools capable of automating tasks. Any step by step explanations is appreciated if you have the time.

optimisation of time test on Maven by testing only modified files?

I'm working on pdfBox project, and I try to test different version (revision) of the project and I would like to reduce testing time by running only test that include modified files ? Is there any solution ?
(I just started working with Maven)
This is not a good idea. A change in one file may have an effect on other (unchanged) files.
If your wish is to save time, then do this instead: run maven with -DskipTests and it will not run the tests.
Besides, even if tests fail, the PDFBox devs will already know it, because a test failure on the build server triggers a mail on the developers mailing list.

WSO2 JUnit/Integration Testing

I'm in the process of building a Carbon Archive using the new WSO2 Developer Studio. I'm trying to work out how I can wrap the components (Sequences/Proxies etc) in JUnit tests. These tests will need to run as part of a CI build process (Jenkins) in order to detect errors with any modified code. I've done some research and can't seem to find anything that immediately stands out on how to achieve this. I did find this link https://wso2.org/jira/browse/TOOLS-855
which suggests that it hasn't yet been implemented. Can anyone confirm when this will be implemented or if there is any way at present to achieve this?
There is currently no straight forward way to implement this scenario and this feature will be supported in a future version.
One mechanism i can think is that, add a separate Test module as a part of the build which executes after building C-Apps.
So what happens in here is that, first Jenkins produce the CAR file for C-Apps. Then Maven start executing the JUnit test suite. Before the execution of Test Suite, you can configure maven to copy the CAR files to Servers and start up server. Then execute the Test Cases against the started up server.
This way you can deploy the new CAR files in your Carbon Server and execute the tests against the new configuration in the Server.
Thanks and Regards,
Harshana