Hi,
I’m investigating into postman and it looks good. Is there possibility to somehow make postman use a list of methods for single test (script). For example in pytest I can write something like this.
@pytest.mark.parametrize('path', ['/profiles/1/days/1'])
@pytest.mark.parametrize('method', ['POST', 'PUT', 'DELETE', 'PATCH', 'CONNECT'])
def test_must_return_405_method_not_allowed_for_any_distinct_from_GET_request(sut_base_url, path, method):
response = requests.request(method, urljoin(sut_base_url, path))
data = response.json()
assert response.status_code == 405
assert data['data'] == dict()
assert data['meta']['result'] == 'error'
assert data['meta']['desc'] == 'Method not allowed'
assert re.match(r'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}', data['meta']['id']) is not None
This will actually create 5 tests and run it for every method designated in the pytest.mark.parametrize
list passing over method
as actual argument. But with postman I have to create distinct request for every METHOD
(see in the picture please) and copy paste test body (script). Is it possible to achieve what I’m asking about?
Thank you.