Category: Java

Cucumber JUnit XML report with logs

In the previous post, tutorial, I explained the solution of how to add logs for the cucumber JSON report. In the current post, I will try to make an easy explanation that will cover the JUnit cucumber XML report problem where no logs are displayed. At the same time, I will reuse the implementation from

How to add log messages to cucumber Jenkins report

As you may know by default pretty cucumber reports don’t save log messages in the cucumber.json file by default in order to display more information in the generated HTML report. This post will cover this function via declaring a java Appender in order to store log messages in the cucumber.json file. Before starting I would

Factory Method Pattern in the creation of Selenium WebDriver

As software engineer, We all face some errors/exceptions while writing code! So what do we do when we face such a problem? If we are not sure, We google for solutions immediately. Don’t we? We google because we know that we would not be alone and someone would have already found the solution, for the problem we

How to attach log message to cucumber report via MDC

As you may know by default pretty cucumber reports don’t have informative log messages in the report. In order to achieve this we will use MDC. What is MDC Base on documentation of logback MDC is deciphered as Mapped Diagnostic Context. MDC lets the developer place information in a diagnostic context that can be subsequently retrieved by

How to send different values in cucumber features based on profile

First of all, I want to mention that this post continues the previous one where we have added AOP to execute some additional logic on cucumber steps. My recommendation will be to read mentioned post. Let’s start… About Spring Profile From official documentation a profile has the following role:Spring Profiles provide a way to segregate

Strategy Pattern in Test Automation with Selenium WebDriver

As a software engineer, We all face some errors/exceptions while writing code! So what do we do when we face such a problem? If we are not sure, We google for solutions immediately. Don’t we? We google because we know that we would not be alone and someone would have already found the solution, for the problem

Spring Security with JWT token

Today I will show you how to make your REST APIs secure and authenticate requests using Spring Security JWT (Json Web Token). Today, JWT is one of the most common methods for authenticating requests for Java WEB applications. And this is not casual. This type of protection and authentication has several advantages: convenience (you do

Cucumber 6 Spring Integration

Cucumber is a very powerful testing framework written in the Ruby programming language, which follows the BDD (behavior-driven development) methodology. It enables developers to write high-level use cases in plain text that can be verified by non-technical stakeholders, and turn them into executable tests, written in a language called Gherkin. And the Cucumber-Spring Integration is intended to

Generic Scenario Context for Cucumber

How to Share Test Context between Cucumber Steps, in this post we will explain it and share our implementation Scenario Context class holds the test data information explicitly. It helps you store values in a key-value pair between the steps. Moreover, it helps in organizing step definitions better rather than using private variables in step definition classes.

How To Improve Your Assertions Using AssertJ

Overview: As you might already know,Fluent APIs make your code readable and easily maintainable. We already have seen few articles on designing Page Objects and Business Workflows in fluent style. In this article, Lets see how we could include fluent assert statements for your automated tests using AssertJ library. Take a look at the examples