Automatch is a pattern matching strategy that allows to determine which tests should be run based on an endpoint URL. This is particularly useful if you’re willing to launch a test using our API against a provided payload.
On the test interstitial page, choose “Automatch”
All you have to do is inserting the “automatch pattern” that best describes the endpoint being tested:
The grammar of the pattern matcher is:
- the pattern involves the whole path
- A single star ( * ) ignores one segment in the url. In the above example, the product id is being ignored hence any value can be placed in that spot
- A double star ( ** ) ignores all the segments in that area. **/api/product/*/edit ignores the id and everything that comes before /api
How it works
Using the “runAutomatch” action in our API you can provide the URL (or a portion of it) of the resource being forwarded.
In the “payload” mode you have a “url” field at the top level object, while in the serializer mode the field is located at “request.url”.
If the URL matches the automatch pattern in a test, the test will be executed.