Given the API base URL is "url"

This step definition is used to set the base URL for all API requests in your automated tests. Instead of writing the full URL every time, you define it once, and all requests will use it as the starting point.

 

Given (?:the API base URL is|I set the API base URL to|the base URL is) "([^"]*)"$

This tells the test framework where the API lives.

 

Example #1: Given the API base URL is "https://jsonplaceholder.typicode.com"
Example #2: Given I set the API base URL to "https://api.example.com/v1"
Example #3: Given the base URL is "http://localhost:3000/api"