https://ithelp.ithome.com.tw/articles/10201503
runner iteration 操作說明:
- + New Collection
- Add Request
- 編輯該request,如url, 測試環境
- 寫遞迴時的測試const FIRST_ON_LINE_REGION = ["global", "de", "pl", "se", "dk", "cz", "it", "hu", "fi", "pt", "es", "fr", "nl", "be-fr", "be-nl"];const OTHER_REGION = ["bt", "me-en", "lk", "in", "tr", "tw", "bd", "cn", "hk", "vn", "kr", "jp", "ru", "th", "sg", "nz", "ph", "id", "au", "my", "br", "latin", "no", "uk", "sk", "ch-fr", "ch-it", "ch-de", "ro", "rs", "ua", "gr", "za", "ca-fr", "ca-en", "us", "me-ar", "mx", "bg", "ie", "il", "ea", "middleeast-fa", "eg", "ua-ua", "nafr-ar", "africa-fr", "np", "wa", "middleeast-fa", "lt", "lv", "ee", "kz", "mm", "eg-en", "hk-en", "co", "cl", "ar", "pe", "ea-sw", "ch-en", "bn", "gr-el", ""];const REGION_LIST = FIRST_ON_LINE_REGION.concat(OTHER_REGION);pm.environment.set("countryname", REGION_LIST[pm.info.iteration]);// pm.info.iterationpm.test("Successful GET request - "+ REGION_LIST[pm.info.iteration -1] || "NO", function () {pm.expect(pm.response.code).to.be.oneOf([200,201,202]);});
- 用runner跑遞迴
沒有留言:
張貼留言