Implementing data table diffs to compare tables

Consider a situation where you need to verify an application response that is in the form of Table to another Data Table that we are sending in Feature file. This kind of verification is very common when we are testing REST services.

Based on what we have learned so far, we will break the Data Table down in the Feature file into a List of Lists, and then we will verify each element of those Lists with expected Lists (which we got after breaking the table). Let's understand how we can do this in an easier way.

How to do it…

  1. For this recipe, consider the following Scenario:
     Scenario: Table Diff Given user send a get request to "localhost:8080/e" Then user gets following response | username | age | | sham ...

Get Cucumber Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.