6 Test Frameworks To Follow in 2021 for Java/Fullstack Developers
It is time to learn new test frameworks to improve your code quality and decrease the time of your testing phase. I have selected six testing frameworks that sound promising. Some have existed for quite a long time but I have not heard about them before.
At the end of the article, please tell me what you think about them and what your favorite ones are.
Robot Framework is open and extensible and can be integrated with virtually any other tool to create powerful and flexible automation solutions. Being open-source also means that Robot Framework is free to use without licensing costs.
The RoboFramework is a framework to write test cases and automation processes. It means that it may replace your classic combo Selenium + Cucumber + Gherkins. To be more precise, the Cucumber Gherkins custom implementation you wrote will be handled by RoboFramework and Selenium invoked below.
It provides a light DSL over the Browser API to write concise tests. It does not require WebDrivers; it uses Node.JS and the browsers installed on the machine. In a sense, it may not be the best solution for CI/CD environments but it is quite easy to use. It is still possible to use headless browsers for advanced users (and for CI/CD). It also supports mock HTTP requests that are also great to make tests on a smaller portion of your scenario. Last but not least, the framework is supposed to handle the timeouts and sleep pause between the browser actions automatically.
JUnit Extension Random beans
This JUnit extension integrates RandomBeans to enable your tests to integrate POJO generation with dynamic values.
Person person = random(Person.class);
Too often, tests are using fixed static data and are too long to read and maintain. With this extension, you may fill out your POJO with random values and ensures that your tests are validating properly their results.
junit-quickcheck is a library that supports writing and running property-based tests in JUnit, inspired by QuickCheck for Haskell.
To be more concrete, you define properties or invariants, and they are checked on random values produced by generators. So you can use define properties on objects and provide a generator that will initialize the POJOs with random values if possible.
Rather than testing such properties for all possible inputs, junit-quickcheck and other QuickCheck kin generate some number of random inputs and verify that the properties hold at least for the generated inputs. This gives us some reasonable assurance upon repeated test runs that the properties hold true for any valid inputs.
Several examples are located here to get an idea of how to use the framework and which benefits you may earn.
Among the interesting features provided by the framework:
- Test for mobile: Use device emulation to test your responsive web apps in mobile web browsers.
- Auto-wait APIs: Playwright interactions auto-wait for elements to be ready. This improves reliability and simplifies test authoring.
- Timeout-free automation: Playwright receives browser signals, like network requests, page navigations, and page load events to eliminate the need for sleep timeouts that cause flakiness
My personal opinion is to have a look at it since the integration with Robot Framework confirmed.
The JQF Maven Plugin documentation shows how to run mvn jqf:fuzz.
It is another version of a Random library like RandomBeans for which I am a frequent user. PODAM is extensible and you can create your own generators. If you do not like Randombeans, have a look at PODAM.