Developers Club geek daily blog

Effective UI tests for Selenide

2 years, 1 month ago

Waiting for miracles


The eve of New Year — time of miracles. In anticipation of new year all of us remember the year leaving and we make plans for following. Also we hope that all problems will remain in the past, and in new year there will be a miracle, and we will begin to live in a new way.

What Java the developer does not dream of a miracle which will dawn on it and will allow to become the Most Abrupt On Sveta Java Programmistom.

Good news: I want to tell just about such miracle.

Name to it — automatic tests!

Read more »


There was a new LinqTestable version — libraries for testing of requests to a DB through ORM

2 years, 1 month ago
LinqTestable is the library helping to overcome with tests the conceptual gap between OOP and a relational DB arising because of a difference of behavior NULL-and in these two paradigms. For example, comparison of NULL == returns to NULL truth in object languages, and lie in a relational model. In addition, NULL.SomeField will return NULL in a relational model and will throw out NullReferenceException in C#. LinqTestable is intended for a solution of this problem.


Read more »


Visual tests with Galen Framework. We improve readability of a code

2 years, 1 month ago
Two years passed from the moment of writing of the first article about Galen Framework. At that time everything that Galen was, is only an unpretentious set of checks for an arrangement of elements of the page concerning other elements. Then in it there was no opportunity to check a screenshot pixel-by-pixel, to expand the Galen Specs language which, actually, and is a framework basis. Also tests could be started only with use of one format of test suits that very much limited possibilities of Galen of tests. Since then, thanks to support of community, a lot of things changed in Galen. Today, it is already full-fledged tool for visual testing which can not only check screenshots pixel-by-pixel and impose filters on the tested images, but also provides a rich set of the features allowing to expand possibilities of the Galen Specs language. In this article I would like to show new vozmnozhnost of the Galen Specs language, and also to show how to improve readability of visual tests in Galen Framework on the example of this page.



Readability — one of important properties of any test code. One my employee even claimed that readability of tests is more important than readability of the master code since the test will be an input point in attempt to understand as any functionality in the application works. This idea was pleasant to me, and I decided to apply it to visual tests in Galen Framework. My purpose was to write the test, having read which, it will become clear how the website in different sizes of the browser has to look. Let's look at the most widespread cases when testing imposition of the adaptive website and we will try to understand how to improve our tests.

Read more »


The automated testing of controllers in Rails

2 years, 2 months ago
Hi, Habr! Long ago monasteries attract me to be the author, and here, at last, that light hour when I dopinat myself came to provide my small opus on your court.
Studying at a leisure Ruby and Rails, trying RSpec, suddenly Minitest, I reached creation of a web application with a frontend on JavaScript and the backend on Ruby which is sticking out outside REST API based on normal Rails controllers. I use Rails though it is perfect not essentially. The approach described below can be applied to anything.
Here it is necessary to make small retreat. At heart I am a person exacting, and in every possible way I fight for the proved stability of a code (in words precisely). And when the speech comes about safety of users in my application, without tests at least showing that anyone will not obtain my data, I feel absolutely not comfortably. I begin to long and in general not to write any code. Even if I — the user one and only so far.
It would seem, everything is very simple: we take RSpec and we write tests. But same it is boring! For each controller, for each supported method to check, at least, that without the token issued earlier the user will get the heave-ho — it how many an identical code it is necessary to write! And further as? It is more and more controllers, it is boring to copy tests and in opportunities to change approaches I remain is limited. Go then rewrite all these tests if I want to transfer, for example, the API version not to URL, and in heading, or on the contrary. Generally, I conceived to write the generator.

Read more »


Evolution of automatic testing in the environment 1C: Enterprise

2 years, 2 months ago
To release of the new version of a framework on testing of "xUnitFor1C" remained very little, so time to tell about the done work and that it expects users came.

The release will turn out really major, there is a lot of changes, and they have global character. But about everything one after another.

Why everything to saw?


As far as I understand, for a moment, when the project was only born, the main objective was to understand how modular testing can be demanded in the environment 1C. Clear business that to think over and select levels of abstractions at a prototyping stage — business not especially perspective. The prototype does not possess elasticity of this code. The prototype is an experiment which results need to be thrown out.

Further the flag of development passed from one enthusiast to another, at the same time the foundation architecture remained former. With growth of popularity of a product and understanding of what it would be desirable to receive it became more difficult to make changes.

I like Alan Cooper's metaphor:
Creation of the big program can be compared to construction of a column from a brick. This column consists of one thousand bricks put one on another. The column can be built, only if to lay bricks with a big accuracy. Any deviation will lead to falling of bricks. If the brick with number 998 is able to reject on five millimeters, the column will probably be able to sustain one thousand bricks, but if a deviation on the 5th brick, the column never becomes higher than three tens.

Read more »


The library helping to overcome a conceptual gap between OOP and a DB during testing when using ORM — LinqTestable

2 years, 2 months ago
It is known that between an object-oriented and relational model there is a conceptual gap which is not able to overcome even ORM. Generally this gap influences that when using relational database we are forced to work on sets, but not on specific objects. But there is also other factor: the behavior of NULL in a DB differs from behavior of NULL in object-oriented languages. It can become a problem when you use the same request in two situations: 1) at request to a DB 2) at a unit testing when instead of the table of a DB the array in random access memory is used. Moreover, it can become a problem if you address only a DB, but think about NULL in terms OOPs, but not a relational DB!

image

Read more »


TDD on-folksvagenovski

2 years, 3 months ago
The Volkswagen company has shown to the whole world that such the real Test Driven Development. Tests have passed — it is possible to sleep peacefully.

The software developed in the company quite specific is also intended for industrial platforms (automobile computers). The company does not open, what tools uses when developing; and the more so does not upload these tools publicly as it often happens among the leading IT companies. But innovation approach of Volkswagen to testing has struck all. These best practices undoubtedly deserve to adopt it and to implement also in mainstream of our industry. And the community Github has immediately responded to this call. So, meet: libraries for support of TDD in Volkswagen style.


Read more »


We separate interfaces for unit testing

2 years, 3 months ago
According to the blog of our company the impression can be made that we are engaged only in data mining'om and networks. Therefore I as the representative of developer workshop, could not refuse in pleasure to write himself article how unit-testing and division of code into modules at us in frontend is abruptly organized.


Read more »


New in Runkit 1.0.4: PHP 5.6+, closures everywhere and 12 more new features

2 years, 4 months ago

Runkit 1.0.4 for PHP is let out!


I congratulate all users of Runkit on new long-awaited mega-release! If you constantly use Runkit and are well familiar with its opportunities, history and development, can pass to the description of changes of release 1.0.4 at once. Anyway I suggest to read article entirely.

Read more »


Creation of test DB context in tests with use of xUnit

2 years, 5 months ago
In cases when your application has the nontrivial data scheme (people, products, orders, the prices, volumes, statuses depending on heap of parameters, etc.) it is simpler to have some dump of data recreated on test environment, or taken from production and to use it for tests. In this case, some dump of data, can be necessary for each of cases which automatic tests have to be able to roll and roll away on test environment. I will try to show in this article how it can be made, using fixtures and collections of framework of xUnit. All solution it is constructed on the basis of version 2.0 xUnit of March 16, 2015.

Read more »