This would seem to be a simple question, but not sure how to best set it up. I have a few test cases for the same endpoint. I want to just pass different values for the various {{variables}}
I know I can use pm.globals.set('..') and other ways to modify the env during testing, but i don’t want to basically code up my tests in JS.
I’m assuming there must be somewhere in the UI (maybe test runner?) to say - run the same test and endpoint, but changing out these values, and expecting different results.
Each column in the csv file will be a variable you can add to your request/tests. Each row will be an iteration.
Given your example, you’d want a csv that has two columns: one for userId, and another for expected response code.
You can just simply plug in the userId variable in your request probably like how you’re already doing it. The test might be a little tricker.
pm.test('Has expected response code', function(){
let expectedResponse = pm.iterationData.get('<The name of the column header in your csv for the response code>');
pm.expect(pm.response.code).to.equal(expectedResponse);
});