<pre>@And("^I perform GET for postcode \"(.*\\s.*)\"$") public void iPerformGETForPostcode(String postCode) throws Throwable { response = spec.get(new URI(postCode)); } Scenario: Postcode search JL Given I perform get operation for postcode "/postcode" And I perform GET for postcode "PO8 9YD" Then I should be able to see the list of addresses in the postcode JL | index | uprn | | 1 | 176560291782 | | 2 | 100060965783 | | 3 | 100012391784 | And Verify Response body contents matched with expected values | key | value | | code | 200 | | message | Ok |
other regexes I tried:
^I perform GET for postcode \"(.*)\"$ ^I perform GET for postcode \"(.*\s.*)\"$ ^I perform GET for postcode \"(.*\\s.*)\"$ ^I perform GET for postcode \"([a-zA-Z0-9_ ]*)\"$ ^I perform GET for postcode \"([^\"]*)\"$ - this is the one recommended
[a-zA-Z]{2}\d\s?\d[a-zA-Z]{2}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)