📜 ⬆️ ⬇️

JarvisJS: Functional Testing of Web Applications

Hello Habr! In this post, we would like to say hello and for the first time show the world our project JarvisJS.com - a service for functional testing of web applications. The project is still very young and has been developed with love by a team of three people for seven months now.

Under the cut, we will tell about our service and the reasons that prompted us to create it.

No matter what size of application we develop - small or large, as developers, we always understand the importance of testing in our work. And the more experience we gain, the more clearly we see this. Do we always test our code? I think even the strongest of us, hand on heart, will answer - no.

Testing is always associated with two tasks: setting up some infrastructure for testing and, in fact, developing tests. It happens, at first in small projects it seems that spending time on testing is not worth it - I want to go forward as soon as possible and build a new functionality. But then life turns out to be very predictable and the project is reborn into a huge anti-hydra — by cutting off one piece of the functionality we’re crashing and the other two.


Depending on the type of testing our code, the costs of preparing for it are different. If for organization of unit-tests it is usually not necessary to do anything supernatural, then, for example, for functional testing of the frontend with the help of Selenium, you need to deploy a whole infrastructure, especially if you want all the tests to be run somewhere remotely.
')
It is this functional testing for a long time did not give us peace of mind. The idea is simple and clear - we are testing the application as a living person would work with it, right in the browser. At the same time, the organization of the entire testing process is not the easiest task and may require from members of a team of competencies that they do not possess or are not interested at all (for example, unix and its command line, a new language like Java for writing Selenium tests, although WebdriverJS recently appeared) .

In our subjective view, for the average team, where the development of tests is treated as an inevitable evil, it is important that this development takes place in the most comfortable environment, with the help of familiar, native tools.

For a frontend developer, Javascript is certainly a native tool, and the most “correct" implementation of functional testing based on Javascript is probably PhanotmJS, which is already familiar to all. PhantomJS is really an amazing tool that allows you to control the browser using the Javascript language and at the same time allows you to automate the execution of tests on a remote server. True, this testing is carried out only in one branch of browsers - Webkit, but if you are interested in functional testing of logic, and not the rendering engines, then compared to the feeling of being in a native environment, this is not a critical drawback.

At the same time, on top of PhantomJS a lot of different tools have already been formed that make working with it even easier: CasperJS, Zombie.JS, DalekJS, ... Personally, we opted for CasperJS.

CasperJS is an open source project that provides a simple interface for working with PhantomJS and SlimerJS and allows you to develop functional tests for browsers on the webkit (Chrome, Safari, ...) and gecko (Firefox) engines.

However, in spite of the entire Javascript lamp-like nature of such tools, tests still need to be somehow stored, run somewhere, and written by someone.

Our vision of solving these tasks was expressed in a project that we would like to present to you - JarvisJS.


JarvisJS is a service that simplifies the development of functional tests based on the CasperJS framework and allows you to run them in the cloud.

To help test development, Jarvis provides a browser extension that allows you to record a sequence of your actions. At the moment, the extension is available only for the Chrome browser.

An example of working with JarvisJS can be viewed on this video:



After recording the test, you can immediately save it in the service and execute it on a remote server. Tests can be grouped by project and run the entire project at once. Test results consist of a set of assertions given in it with the results of their verification. A screen capture is automatically created for each such check.

For those cases when for the description of the test the flexibility of the browser extension is not enough, any test can be converted to CasperJS-code and continue to develop the test in JavaScript.

Like usual frameworks, test annotations are available for testing in Jarvis-e, such as “before” and “after”. Thanks to these annotations, you can easily spread the functionality, for example, put the authorization test in a separate test with the beforeEach annotation.

At the moment we are at the pre-launch stage. And we would like to check the functioning of all systems in "combat" conditions on real users, but with a controlled number of them. =)

In this connection, all interested in our project, we will be very happy to see on our beta. Leave your email on the page jarvisjs.com and soon, as soon as we are ready - we will invite you to visit our service.

In further posts, we would like to talk about the internal kitchen of our project, about how PhantomJS and CasperJS were tamed, about the technologies used and about the project planning in part-time employment.

We will be glad to any of your comments and suggestions! Thanks for attention!

Separately, I would like to thank the Thematic Media administration for the start-up support program, thanks to which we placed this post.

Source: https://habr.com/ru/post/243329/


All Articles