By writing tests, it is possible for developers to release high quality software in the long run. High test coverage also ensures that future regression tests provide meaningful results with little effort. The difficulty here comes from the added value perceived in daily work. In my projects, I have discovered that the development of new features in particular ensures a sense of personal accomplishment and promotes the development of a software product.
The tests do not initially provide any direct added value in the short term, except that they verify the logic and ensure its functionality. In the long term, the added value increases as soon as the writing of the tests is systematically integrated into your own development. In my work, Cypress has a proven track record, as it can be integrated into projects with little effort and can create tests quickly. In addition to Cypress, there are a number of other frameworks that can be used to write tests. This article should first introduce the relatively new framework for test automation. Next comes a comparison with a possible alternative, the long established Selenium test tool. The two tools each have different idiosyncrasies, which is why they are suitable for different application scenarios, which the article will elaborate on towards the end.
This contribution is part of a series of articles to which heise Developer has explicitly invited young developers – with the aim of informing their own genre, but of course also interested “old people”, about trends, developments, phenomena and current personal experiences. Articles in this series appear monthly. Are you a “young professional” yourself and want to be part of this series? Then apply with a suggestion to the editorial team: [email protected] We’re by your side with helpful advice throughout the drafting, editing, and approval process.
What is cypress
Introducing the Sample Project Blog
The “Blogs” project allows you to view the tests. The app consists of a simple interface including elements that users can interact with, for example to activate a dark mode or to create a new blog entry. The app is based on Vue.js in combination with Vuetify. Vuetify is a hardware design framework for quickly building a sample app with UI elements for your own project. However, Cypress is not bound by any particular framework. In total, there should be three components in the example project – first of all, the surface itself, which can be seen in Figure 1.
There is also a dialog for adding a new entry, shown in Figure 2. An entry consists of a title, material design icon, content, and tags. As soon as the entry has been added via the dialog box, the publication date also appears automatically.
First, we will implement a test for the existing components and then develop an extension in the form of a filtering tag cloud. With tests in mind, the component can be constructed in such a way that tests are easy to create.
Disclaimer: This article is generated from the feed and is not edited by our team.