Posts

QA Specialist in an Agile Team

Image
  QA Specialist in an Agile Team Agile ! The buzz word that emerges frequently and is practiced everywhere you look around. New roles have emerged and challenges are being tackled while the teams have evolved with time, practising and implementing Agile. One such role is of a ‘so called’  Agile QA  /  QA Specialist  in a Development team whose role has evolved over a period of time and is significant. Please note the so called is quoted and that’s for a reason. Agile dev teams identifies no roles within the dev team. QA Specialist If you are playing the above role ask yourself the below questions : Is my ultimate goal to ensure that high quality product is being built iteratively Am I Involved beyond writing test cases and executing them? Like analyse the user requirement Am I able to visualize the product/feature that is being built and have clarity Do I try to bring in automation where ever possible Am I able to enhance, maintain and utilize the test automatio...

How to setup Jenkins on Minikube

Setting up Jenkins on Kubernetes  is very efficient than setting it up on a local agent.   Hence, I have listed down steps to setup Jenkins on Minikube so that you get a good understanding of how Jenkins works on Kubernetes before you set it up on multi node clusters.  1. minikube config set memory 16384 (If space is full or your total memory is only 16384 then set to lower, 8192) 2. minikube config set cpus 4 3. minikube config set kubernetes-version 1.16.0 4. minikube start --driver=virtualbox 5. Create a namespace yaml file:  jenkins-namespace.yaml  Contents: apiVersion: v1 kind: Namespace metadata:    name: jenkins _________________________________________________ kubectl apply -f jenkins-namespace.yaml 6. Persistent volume : jenkins-volume.yaml Contents:  apiVersion: v1 kind: PersistentVolume metadata:   name: jenkins-pv   namespace: jenkins spec:   storageClassName: jenkins-pv   accessModes:     - ReadWrite...

How to use java objects in Rest Assured effectively

Using objects is more convenient for complex assertion logics and dynamic requests. But java's boiler plate code makes it very difficult to maintain such request and response pojo's when it comes to rest api automation. Hence we can make use of Lombok and Jackson's annotation for this purpose. It helps in reducing huge lines of code and automating complex orchestration in an easy manner.  Let's look at an example :  Say we have a " Payment " endpoint, which accepts  'SavedCard' and ' NewCard' as payment methods i.e a polymorphic request, for the same endpoint. In such cases we would write different sub classes for each modification in request or response. This makes java for restapi automation cumbersome and tedious. But let's see how easily we can achieve the same using Jackson & Lombok annotations in Java. Sample Request :  New Card :   { "cartId" : "a123" , "paymentMethod" : { "newCardPay...

RestAssured : Redirect console logging to a file or a string object

  RestAssured has rich features to be explored and customised.    One of the things we can customize is logs. If you would want to capture the request body along with headers and the response body which definitely helps in case of failure analysis of test here is a simple approach. The  RequestLoggingFilter & ResponseLoggingFilter    allows you to specify a default java.io.PrintStream that is used for logging when calling e.g. log().all(). You could choose to log just the Request / Response or both. If you do not specify a PrintStream explicitly then  RestAssured  will default to the PrintStream defined by System.out, i.e. it will print the logs to the console.  Let us look into how we can change this to write a file or a String Object instead: File f = new File(".//src//test//resources//temp.txt"); PrintStream printStream = null; try { printStream = new PrintStream(f); } catch (FileNotFoundException e) { e.printStackTrace(); ...

Benefits of Customised Assertions

Customised Assertions in your test automation framework : For complex and repetitive test scenarios, it can be useful to create custom assertions where  logic is plugged away from the tests and placed into separate class Customised assertions help us dive into the intent of the tests Plug in various features like attaching the responses , logging and so on which other wise gets complex using assertions straight away in tests  Example Custom assertion class : public abstract class Verify extends BaseClass {     public static void verifyTrue(boolean condition, String message, Object... response) {         try {             Assert.assertTrue(condition, message);         } catch (AssertionError e) {             // Perform actions like attaching or logging             Assert.fail(message);         }     } ...