[{"data":1,"prerenderedAt":1995},["ShallowReactive",2],{"navigation_docs":3,"-guide-scripts-and-tests":172,"-guide-scripts-and-tests-surround":1990},[4,30,100,134],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":29},"Getting started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,14,18,21,25],{"title":11,"path":12,"stem":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":5,"path":19,"stem":20},"\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":22,"path":23,"stem":24},"Build from source","\u002Fgetting-started\u002Fbuild-from-source","1.getting-started\u002F4.build-from-source",{"title":26,"path":27,"stem":28},"Troubleshooting","\u002Fgetting-started\u002Ftroubleshooting","1.getting-started\u002F5.troubleshooting",false,{"title":31,"icon":32,"path":33,"stem":34,"children":35,"page":29},"Guide","i-lucide-book-open","\u002Fguide","2.guide",[36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96],{"title":37,"path":38,"stem":39},"Interface","\u002Fguide\u002Finterface","2.guide\u002F01.interface",{"title":41,"path":42,"stem":43},"Workspace","\u002Fguide\u002Fworkspace","2.guide\u002F02.workspace",{"title":45,"path":46,"stem":47},"Collections","\u002Fguide\u002Fcollections","2.guide\u002F03.collections",{"title":49,"path":50,"stem":51},"HTTP requests","\u002Fguide\u002Fhttp-requests","2.guide\u002F04.http-requests",{"title":53,"path":54,"stem":55},"Variables","\u002Fguide\u002Fvariables","2.guide\u002F05.variables",{"title":57,"path":58,"stem":59},"Authorization","\u002Fguide\u002Fauthorization","2.guide\u002F06.authorization",{"title":61,"path":62,"stem":63},"Scripts and tests","\u002Fguide\u002Fscripts-and-tests","2.guide\u002F07.scripts-and-tests",{"title":65,"path":66,"stem":67},"Collection runner","\u002Fguide\u002Fcollection-runner","2.guide\u002F08.collection-runner",{"title":69,"path":70,"stem":71},"Import and export","\u002Fguide\u002Fimport-export","2.guide\u002F09.import-export",{"title":73,"path":74,"stem":75},"Code snippets","\u002Fguide\u002Fcode-snippets","2.guide\u002F10.code-snippets",{"title":77,"path":78,"stem":79},"gRPC","\u002Fguide\u002Fgrpc","2.guide\u002F11.grpc",{"title":81,"path":82,"stem":83},"WebSocket","\u002Fguide\u002Fwebsocket","2.guide\u002F12.websocket",{"title":85,"path":86,"stem":87},"Cookies, proxy and certificates","\u002Fguide\u002Fcookies-proxy-certificates","2.guide\u002F13.cookies-proxy-certificates",{"title":89,"path":90,"stem":91},"Settings","\u002Fguide\u002Fsettings","2.guide\u002F14.settings",{"title":93,"path":94,"stem":95},"Keyboard shortcuts","\u002Fguide\u002Fkeyboard-shortcuts","2.guide\u002F15.keyboard-shortcuts",{"title":97,"path":98,"stem":99},"Privacy and security","\u002Fguide\u002Fprivacy-and-security","2.guide\u002F16.privacy-and-security",{"title":101,"icon":102,"path":103,"stem":104,"children":105,"page":29},"Reference","i-lucide-square-terminal","\u002Freference","3.reference",[106,110,114,118,122,126,130],{"title":107,"path":108,"stem":109},"Command line","\u002Freference\u002Fcli","3.reference\u002F1.cli",{"title":111,"path":112,"stem":113},"Automation tools","\u002Freference\u002Fautomation-tools","3.reference\u002F2.automation-tools",{"title":115,"path":116,"stem":117},"Scripting API","\u002Freference\u002Fscripting-api","3.reference\u002F3.scripting-api",{"title":119,"path":120,"stem":121},"Dynamic variables","\u002Freference\u002Fdynamic-variables","3.reference\u002F4.dynamic-variables",{"title":123,"path":124,"stem":125},"UI control channel","\u002Freference\u002Fui-control-channel","3.reference\u002F5.ui-control-channel",{"title":127,"path":128,"stem":129},"Workspace format","\u002Freference\u002Fworkspace-format","3.reference\u002F6.workspace-format",{"title":131,"path":132,"stem":133},"Feature status","\u002Freference\u002Ffeature-status","3.reference\u002F7.feature-status",{"title":135,"icon":136,"path":137,"stem":138,"children":139,"page":29},"Contributing","i-lucide-git-pull-request","\u002Fcontributing","4.contributing",[140,144,148,152,156,160,164,168],{"title":141,"path":142,"stem":143},"Contributing overview","\u002Fcontributing\u002Foverview","4.contributing\u002F1.overview",{"title":145,"path":146,"stem":147},"Development","\u002Fcontributing\u002Fdevelopment","4.contributing\u002F2.development",{"title":149,"path":150,"stem":151},"Architecture","\u002Fcontributing\u002Farchitecture","4.contributing\u002F3.architecture",{"title":153,"path":154,"stem":155},"Known gaps","\u002Fcontributing\u002Fgaps","4.contributing\u002F4.gaps",{"title":157,"path":158,"stem":159},"Adding a feature","\u002Fcontributing\u002Fadding-a-feature","4.contributing\u002F5.adding-a-feature",{"title":161,"path":162,"stem":163},"Assets and clean-room","\u002Fcontributing\u002Fassets-and-clean-room","4.contributing\u002F6.assets-and-clean-room",{"title":165,"path":166,"stem":167},"Releasing","\u002Fcontributing\u002Freleasing","4.contributing\u002F7.releasing",{"title":169,"path":170,"stem":171},"Writing the documentation","\u002Fcontributing\u002Fdocumentation","4.contributing\u002F8.documentation",{"id":173,"title":61,"body":174,"description":1984,"extension":1985,"links":1986,"meta":1987,"navigation":625,"path":62,"seo":1988,"stem":63,"__hash__":1989},"docs\u002F2.guide\u002F07.scripts-and-tests.md",{"type":175,"value":176,"toc":1967},"minimark",[177,181,198,214,219,306,313,317,320,357,363,369,373,430,450,455,466,505,512,516,522,781,790,940,960,1060,1063,1170,1174,1182,1197,1250,1256,1260,1263,1286,1669,1672,1694,1703,1707,1714,1798,1801,1807,1819,1876,1886,1890,1896,1905,1909,1963],[178,179,180],"p",{},"Postguy runs JavaScript before a request is sent and after the response arrives. It also checks a table of assertions against the response.",[178,182,183,184,188,189,192,193,197],{},"Scripts run in an embedded QuickJS sandbox with the ",[185,186,187],"code",{},"pm"," API, the ",[185,190,191],{},"pg"," object and Bruno-style globals. This page covers where scripts live, when they run and which limits apply. The full API is in the ",[194,195,196],"a",{"href":116},"Scripting API reference",".",[199,200,201,202,205,206,209,210,213],"note",{},"This page covers HTTP requests. gRPC requests run their own request-level Pre-invoke, On message and Post-response scripts and Test tab; see ",[194,203,77],{"href":204},"\u002Fguide\u002Fgrpc#scripts-and-tests",". WebSocket script phases are not available. ",[185,207,208],{},"pm.cookies.jar()"," and ",[185,211,212],{},"pm.visualizer"," are not implemented.",[215,216,218],"h2",{"id":217},"where-scripts-live","Where scripts live",[220,221,222,238],"table",{},[223,224,225],"thead",{},[226,227,228,232,235],"tr",{},[229,230,231],"th",{},"Place",[229,233,234],{},"Tab",[229,236,237],{},"Phases",[239,240,241,261,276,291],"tbody",{},[226,242,243,247,252],{},[244,245,246],"td",{},"Collection",[244,248,249],{},[185,250,251],{},"Scripts",[244,253,254,257,258],{},[185,255,256],{},"Pre-request",", ",[185,259,260],{},"Post-response",[226,262,263,266,270],{},[244,264,265],{},"Folder",[244,267,268],{},[185,269,251],{},[244,271,272,257,274],{},[185,273,256],{},[185,275,260],{},[226,277,278,281,285],{},[244,279,280],{},"Request",[244,282,283],{},[185,284,251],{},[244,286,287,257,289],{},[185,288,256],{},[185,290,260],{},[226,292,293,295,300],{},[244,294,280],{},[244,296,297],{},[185,298,299],{},"Tests",[244,301,302,303],{},"assertion table and ",[185,304,305],{},"Test script",[178,307,308,309,312],{},"A tab shows a dot when it has content. The script editors have a ",[185,310,311],{},"Snippets"," menu with ready-made code.",[215,314,316],{"id":315},"execution-order","Execution order",[178,318,319],{},"For one send:",[321,322,323,338,343,349],"ol",{},[324,325,326,330,331,209,334,337],"li",{},[327,328,329],"strong",{},"Pre-request:"," the collection script, then each folder script from the outermost to the innermost folder, then the request script. Every script runs in its own function scope, so ",[185,332,333],{},"const",[185,335,336],{},"let"," names never collide between levels.",[324,339,340,341,197],{},"Postguy builds auth, URL and body from the (possibly edited) request and sends it. See ",[194,342,49],{"href":50},[324,344,345,348],{},[327,346,347],{},"Post-response:"," the collection script, the folder scripts (outer to inner), then the request script.",[324,350,351,354,355,197],{},[327,352,353],{},"Tests tab:"," the enabled assertion rows in table order, then the ",[185,356,305],{},[178,358,359,360,362],{},"All scripts of one phase share one sandbox run and one time budget. They see each other's variable changes. The ",[185,361,299],{}," assertions and script are part of the post-response run.",[178,364,365,366,368],{},"A request with only a ",[185,367,299],{}," tab and no scripts still runs the post-response phase.",[215,370,372],{"id":371},"failure-behaviour","Failure behaviour",[220,374,375,385],{},[223,376,377],{},[226,378,379,382],{},[229,380,381],{},"Where",[229,383,384],{},"What happens",[239,386,387,399,410,418],{},[226,388,389,392],{},[244,390,391],{},"Pre-request script throws, times out or runs out of memory",[244,393,394,395,398],{},"Nothing is sent. The send fails with ",[185,396,397],{},"pre-request script in \u003Corigin> failed at line \u003Cn>: \u003Cmessage>",", and the error is written to the Console. Later pre-request scripts do not run.",[226,400,401,407],{},[244,402,403,406],{},[185,404,405],{},"pm.execution.skipRequest()"," in a pre-request script",[244,408,409],{},"The request is skipped. This is not a failure.",[226,411,412,415],{},[244,413,414],{},"Post-response script throws",[244,416,417],{},"The response is kept. The failure is listed as a script failure and a warning. The next scripts and the Tests tab still run. A timeout or memory limit stops the rest.",[226,419,420,423],{},[244,421,422],{},"An assertion fails",[244,424,425,426,429],{},"One failed result with a message such as ",[185,427,428],{},"expected res.status equals 201, got 200",". The remaining rows still run.",[178,431,432,435,436,257,439,442,443,446,447,197],{},[185,433,434],{},"\u003Corigin>"," names the level: ",[185,437,438],{},"collection \u003Cname>",[185,440,441],{},"folder \u003Cname>"," or ",[185,444,445],{},"request \u003Cname>",". The Tests tab is ",[185,448,449],{},"request \u003Cname> tests",[451,452,454],"h3",{"id":453},"test-results","Test results",[178,456,457,458,461,462,465],{},"The response viewer has a ",[185,459,460],{},"Test Results"," tab. It is labelled ",[185,463,464],{},"Test Results (passed\u002Ftotal)"," once something ran.",[467,468,469,484,496,499,502],"ul",{},[324,470,471,472,257,475,257,478,209,481,197],{},"Filters: ",[185,473,474],{},"All",[185,476,477],{},"Passed",[185,479,480],{},"Skipped",[185,482,483],{},"Failed",[324,485,486,487,257,490,209,493,197],{},"Rows are marked ",[185,488,489],{},"PASS",[185,491,492],{},"FAIL",[185,494,495],{},"SKIP",[324,497,498],{},"Each failure shows its message. Script failures show in a banner.",[324,500,501],{},"Results from assertion rows are tagged as assertions.",[324,503,504],{},"Secret variable values are masked in failure messages.",[178,506,507,508,511],{},"In the ",[194,509,510],{"href":66},"runner",", test results count towards the run's pass and fail totals.",[215,513,515],{"id":514},"examples","Examples",[178,517,518,519,521],{},"A ",[185,520,187],{},"-style post-response script:",[523,524,529],"pre",{"className":525,"code":526,"language":527,"meta":528,"style":528},"language-js shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pm.test(\"status is 200\", () => {\n  pm.response.to.have.status(200);\n});\n\npm.test(\"has an id\", () => {\n  const body = pm.response.json();\n  pm.expect(body.id).to.be.a(\"number\");\n  pm.environment.set(\"lastId\", String(body.id));\n});\n","js","",[185,530,531,571,610,620,627,653,682,730,772],{"__ignoreMap":528},[532,533,536,539,542,546,549,552,556,558,561,564,568],"span",{"class":534,"line":535},"line",1,[532,537,187],{"class":538},"sTEyZ",[532,540,197],{"class":541},"sMK4o",[532,543,545],{"class":544},"s2Zo4","test",[532,547,548],{"class":538},"(",[532,550,551],{"class":541},"\"",[532,553,555],{"class":554},"sfazB","status is 200",[532,557,551],{"class":541},[532,559,560],{"class":541},",",[532,562,563],{"class":541}," ()",[532,565,567],{"class":566},"spNyl"," =>",[532,569,570],{"class":541}," {\n",[532,572,574,577,579,582,584,587,589,592,594,597,600,604,607],{"class":534,"line":573},2,[532,575,576],{"class":538},"  pm",[532,578,197],{"class":541},[532,580,581],{"class":538},"response",[532,583,197],{"class":541},[532,585,586],{"class":538},"to",[532,588,197],{"class":541},[532,590,591],{"class":538},"have",[532,593,197],{"class":541},[532,595,596],{"class":544},"status",[532,598,548],{"class":599},"swJcz",[532,601,603],{"class":602},"sbssI","200",[532,605,606],{"class":599},")",[532,608,609],{"class":541},";\n",[532,611,613,616,618],{"class":534,"line":612},3,[532,614,615],{"class":541},"}",[532,617,606],{"class":538},[532,619,609],{"class":541},[532,621,623],{"class":534,"line":622},4,[532,624,626],{"emptyLinePlaceholder":625},true,"\n",[532,628,630,632,634,636,638,640,643,645,647,649,651],{"class":534,"line":629},5,[532,631,187],{"class":538},[532,633,197],{"class":541},[532,635,545],{"class":544},[532,637,548],{"class":538},[532,639,551],{"class":541},[532,641,642],{"class":554},"has an id",[532,644,551],{"class":541},[532,646,560],{"class":541},[532,648,563],{"class":541},[532,650,567],{"class":566},[532,652,570],{"class":541},[532,654,656,659,662,665,668,670,672,674,677,680],{"class":534,"line":655},6,[532,657,658],{"class":566},"  const",[532,660,661],{"class":538}," body",[532,663,664],{"class":541}," =",[532,666,667],{"class":538}," pm",[532,669,197],{"class":541},[532,671,581],{"class":538},[532,673,197],{"class":541},[532,675,676],{"class":544},"json",[532,678,679],{"class":599},"()",[532,681,609],{"class":541},[532,683,685,687,689,692,694,697,699,702,704,706,708,710,713,715,717,719,721,724,726,728],{"class":534,"line":684},7,[532,686,576],{"class":538},[532,688,197],{"class":541},[532,690,691],{"class":544},"expect",[532,693,548],{"class":599},[532,695,696],{"class":538},"body",[532,698,197],{"class":541},[532,700,701],{"class":538},"id",[532,703,606],{"class":599},[532,705,197],{"class":541},[532,707,586],{"class":538},[532,709,197],{"class":541},[532,711,712],{"class":538},"be",[532,714,197],{"class":541},[532,716,194],{"class":544},[532,718,548],{"class":599},[532,720,551],{"class":541},[532,722,723],{"class":554},"number",[532,725,551],{"class":541},[532,727,606],{"class":599},[532,729,609],{"class":541},[532,731,733,735,737,740,742,745,747,749,752,754,756,759,761,763,765,767,770],{"class":534,"line":732},8,[532,734,576],{"class":538},[532,736,197],{"class":541},[532,738,739],{"class":538},"environment",[532,741,197],{"class":541},[532,743,744],{"class":544},"set",[532,746,548],{"class":599},[532,748,551],{"class":541},[532,750,751],{"class":554},"lastId",[532,753,551],{"class":541},[532,755,560],{"class":541},[532,757,758],{"class":544}," String",[532,760,548],{"class":599},[532,762,696],{"class":538},[532,764,197],{"class":541},[532,766,701],{"class":538},[532,768,769],{"class":599},"))",[532,771,609],{"class":541},[532,773,775,777,779],{"class":534,"line":774},9,[532,776,615],{"class":541},[532,778,606],{"class":538},[532,780,609],{"class":541},[178,782,783,784,786,787,789],{},"The same with ",[185,785,191],{},". It has every ",[185,788,187],{}," member and adds a runtime variable scope. That scope lives for the app session and is never written to a file:",[523,791,793],{"className":525,"code":792,"language":527,"meta":528,"style":528},"pg.test(\"status is 200\", () => pg.response.to.have.status(200));\n\npg.setVar(\"token\", pg.response.json().token);\npg.report.set(\"traceId\", pg.response.headers.get(\"x-trace-id\"));\n",[185,794,795,844,848,887],{"__ignoreMap":528},[532,796,797,799,801,803,805,807,809,811,813,815,817,820,822,824,826,828,830,832,834,836,838,840,842],{"class":534,"line":535},[532,798,191],{"class":538},[532,800,197],{"class":541},[532,802,545],{"class":544},[532,804,548],{"class":538},[532,806,551],{"class":541},[532,808,555],{"class":554},[532,810,551],{"class":541},[532,812,560],{"class":541},[532,814,563],{"class":541},[532,816,567],{"class":566},[532,818,819],{"class":538}," pg",[532,821,197],{"class":541},[532,823,581],{"class":538},[532,825,197],{"class":541},[532,827,586],{"class":538},[532,829,197],{"class":541},[532,831,591],{"class":538},[532,833,197],{"class":541},[532,835,596],{"class":544},[532,837,548],{"class":538},[532,839,603],{"class":602},[532,841,769],{"class":538},[532,843,609],{"class":541},[532,845,846],{"class":534,"line":573},[532,847,626],{"emptyLinePlaceholder":625},[532,849,850,852,854,857,859,861,864,866,868,870,872,874,876,878,880,882,885],{"class":534,"line":612},[532,851,191],{"class":538},[532,853,197],{"class":541},[532,855,856],{"class":544},"setVar",[532,858,548],{"class":538},[532,860,551],{"class":541},[532,862,863],{"class":554},"token",[532,865,551],{"class":541},[532,867,560],{"class":541},[532,869,819],{"class":538},[532,871,197],{"class":541},[532,873,581],{"class":538},[532,875,197],{"class":541},[532,877,676],{"class":544},[532,879,679],{"class":538},[532,881,197],{"class":541},[532,883,884],{"class":538},"token)",[532,886,609],{"class":541},[532,888,889,891,893,896,898,900,902,904,907,909,911,913,915,917,919,922,924,927,929,931,934,936,938],{"class":534,"line":622},[532,890,191],{"class":538},[532,892,197],{"class":541},[532,894,895],{"class":538},"report",[532,897,197],{"class":541},[532,899,744],{"class":544},[532,901,548],{"class":538},[532,903,551],{"class":541},[532,905,906],{"class":554},"traceId",[532,908,551],{"class":541},[532,910,560],{"class":541},[532,912,819],{"class":538},[532,914,197],{"class":541},[532,916,581],{"class":538},[532,918,197],{"class":541},[532,920,921],{"class":538},"headers",[532,923,197],{"class":541},[532,925,926],{"class":544},"get",[532,928,548],{"class":538},[532,930,551],{"class":541},[532,932,933],{"class":554},"x-trace-id",[532,935,551],{"class":541},[532,937,769],{"class":538},[532,939,609],{"class":541},[178,941,942,943,257,946,257,949,257,952,209,954,956,957,959],{},"A Bruno-style script uses the ",[185,944,945],{},"bru",[185,947,948],{},"req",[185,950,951],{},"res",[185,953,545],{},[185,955,691],{}," globals. ",[185,958,951],{}," exists in the post-response phase only:",[523,961,963],{"className":525,"code":962,"language":527,"meta":528,"style":528},"test(\"created\", () => {\n  expect(res.status).to.equal(201);\n});\nbru.setVar(\"orderId\", res.body.id);\n",[185,964,965,986,1019,1027],{"__ignoreMap":528},[532,966,967,969,971,973,976,978,980,982,984],{"class":534,"line":535},[532,968,545],{"class":544},[532,970,548],{"class":538},[532,972,551],{"class":541},[532,974,975],{"class":554},"created",[532,977,551],{"class":541},[532,979,560],{"class":541},[532,981,563],{"class":541},[532,983,567],{"class":566},[532,985,570],{"class":541},[532,987,988,991,993,995,997,999,1001,1003,1005,1007,1010,1012,1015,1017],{"class":534,"line":573},[532,989,990],{"class":544},"  expect",[532,992,548],{"class":599},[532,994,951],{"class":538},[532,996,197],{"class":541},[532,998,596],{"class":538},[532,1000,606],{"class":599},[532,1002,197],{"class":541},[532,1004,586],{"class":538},[532,1006,197],{"class":541},[532,1008,1009],{"class":544},"equal",[532,1011,548],{"class":599},[532,1013,1014],{"class":602},"201",[532,1016,606],{"class":599},[532,1018,609],{"class":541},[532,1020,1021,1023,1025],{"class":534,"line":612},[532,1022,615],{"class":541},[532,1024,606],{"class":538},[532,1026,609],{"class":541},[532,1028,1029,1031,1033,1035,1037,1039,1042,1044,1046,1049,1051,1053,1055,1058],{"class":534,"line":622},[532,1030,945],{"class":538},[532,1032,197],{"class":541},[532,1034,856],{"class":544},[532,1036,548],{"class":538},[532,1038,551],{"class":541},[532,1040,1041],{"class":554},"orderId",[532,1043,551],{"class":541},[532,1045,560],{"class":541},[532,1047,1048],{"class":538}," res",[532,1050,197],{"class":541},[532,1052,696],{"class":538},[532,1054,197],{"class":541},[532,1056,1057],{"class":538},"id)",[532,1059,609],{"class":541},[178,1061,1062],{},"A pre-request script can change the request before it is sent, and can stop it:",[523,1064,1066],{"className":525,"code":1065,"language":527,"meta":528,"style":528},"pm.variables.set(\"requestTime\", new Date().toISOString());\nif (!pm.environment.get(\"baseUrl\")) {\n  pm.execution.skipRequest();\n}\n",[185,1067,1068,1110,1147,1165],{"__ignoreMap":528},[532,1069,1070,1072,1074,1077,1079,1081,1083,1085,1088,1090,1092,1095,1098,1100,1102,1105,1108],{"class":534,"line":535},[532,1071,187],{"class":538},[532,1073,197],{"class":541},[532,1075,1076],{"class":538},"variables",[532,1078,197],{"class":541},[532,1080,744],{"class":544},[532,1082,548],{"class":538},[532,1084,551],{"class":541},[532,1086,1087],{"class":554},"requestTime",[532,1089,551],{"class":541},[532,1091,560],{"class":541},[532,1093,1094],{"class":541}," new",[532,1096,1097],{"class":544}," Date",[532,1099,679],{"class":538},[532,1101,197],{"class":541},[532,1103,1104],{"class":544},"toISOString",[532,1106,1107],{"class":538},"())",[532,1109,609],{"class":541},[532,1111,1112,1116,1119,1122,1124,1126,1128,1130,1132,1134,1136,1139,1141,1144],{"class":534,"line":573},[532,1113,1115],{"class":1114},"s7zQu","if",[532,1117,1118],{"class":538}," (",[532,1120,1121],{"class":541},"!",[532,1123,187],{"class":538},[532,1125,197],{"class":541},[532,1127,739],{"class":538},[532,1129,197],{"class":541},[532,1131,926],{"class":544},[532,1133,548],{"class":538},[532,1135,551],{"class":541},[532,1137,1138],{"class":554},"baseUrl",[532,1140,551],{"class":541},[532,1142,1143],{"class":538},")) ",[532,1145,1146],{"class":541},"{\n",[532,1148,1149,1151,1153,1156,1158,1161,1163],{"class":534,"line":612},[532,1150,576],{"class":538},[532,1152,197],{"class":541},[532,1154,1155],{"class":538},"execution",[532,1157,197],{"class":541},[532,1159,1160],{"class":544},"skipRequest",[532,1162,679],{"class":599},[532,1164,609],{"class":541},[532,1166,1167],{"class":534,"line":622},[532,1168,1169],{"class":541},"}\n",[215,1171,1173],{"id":1172},"tests-tab","Tests tab",[178,1175,1176,1177,1179,1180,197],{},"The ",[185,1178,299],{}," tab has two parts: an assertion table and a ",[185,1181,305],{},[178,1183,1184,1185,1188,1189,1192,1193,1196],{},"Each assertion row has an enable checkbox, an ",[327,1186,1187],{},"expression",", an ",[327,1190,1191],{},"operator"," and a ",[327,1194,1195],{},"value",":",[467,1198,1199,1221,1244],{},[324,1200,1201,1204,1205,1207,1208,257,1211,257,1214,1217,1218,197],{},[327,1202,1203],{},"Expression:"," JavaScript evaluated after the post-response scripts, with ",[185,1206,951],{}," available. Examples: ",[185,1209,1210],{},"res.status",[185,1212,1213],{},"res.body.id",[185,1215,1216],{},"res.headers['content-type']",". An expression that throws fails the row with ",[185,1219,1220],{},"could not evaluate \u003Cexpr>: \u003Cmessage>",[324,1222,1223,1226,1227,1230,1231,257,1234,257,1237,257,1240,1243],{},[327,1224,1225],{},"Value:"," supports ",[185,1228,1229],{},"{{variables}}"," and is trimmed. Postguy parses it as a JSON literal when possible: ",[185,1232,1233],{},"undefined",[185,1235,1236],{},"true",[185,1238,1239],{},"false",[185,1241,1242],{},"null",", numbers, quoted strings and JSON arrays or objects. Anything else is plain text.",[324,1245,1246,1249],{},[327,1247,1248],{},"Unary operators"," ignore the value. The value field is hidden for them.",[178,1251,1252,1253,197],{},"The result name is ",[185,1254,1255],{},"\u003Cexpr> \u003Coperator token> \u003Cvalue>",[451,1257,1259],{"id":1258},"operators","Operators",[178,1261,1262],{},"There are 28 operators. Each has a label in the table and a token in the collection file.",[467,1264,1265,1281],{},[324,1266,1267,1268,209,1271,1274,1275,209,1278,197],{},"Postguy also reads ",[185,1269,1270],{},"equals",[185,1272,1273],{},"notEquals"," as ",[185,1276,1277],{},"eq",[185,1279,1280],{},"neq",[324,1282,1283,1284,197],{},"An unknown token is kept in the file and evaluated as ",[185,1285,1277],{},[220,1287,1288,1301],{},[223,1289,1290],{},[226,1291,1292,1295,1298],{},[229,1293,1294],{},"Token",[229,1296,1297],{},"Label",[229,1299,1300],{},"Passes when",[239,1302,1303,1314,1328,1345,1358,1370,1382,1394,1407,1419,1432,1445,1458,1474,1487,1505,1517,1530,1548,1560,1572,1584,1596,1608,1620,1632,1644,1656],{},[226,1304,1305,1309,1311],{},[244,1306,1307],{},[185,1308,1277],{},[244,1310,1270],{},[244,1312,1313],{},"deep-equal to the parsed value, or a string equal to the raw text",[226,1315,1316,1320,1323],{},[244,1317,1318],{},[185,1319,1280],{},[244,1321,1322],{},"not equals",[244,1324,1325,1326],{},"not ",[185,1327,1277],{},[226,1329,1330,1335,1338],{},[244,1331,1332],{},[185,1333,1334],{},"gt",[244,1336,1337],{},"greater than",[244,1339,1340,1341,1344],{},"number comparison; fails with ",[185,1342,1343],{},"expected a number"," otherwise",[226,1346,1347,1352,1355],{},[244,1348,1349],{},[185,1350,1351],{},"gte",[244,1353,1354],{},"greater or equal",[244,1356,1357],{},"number comparison",[226,1359,1360,1365,1368],{},[244,1361,1362],{},[185,1363,1364],{},"lt",[244,1366,1367],{},"less than",[244,1369,1357],{},[226,1371,1372,1377,1380],{},[244,1373,1374],{},[185,1375,1376],{},"lte",[244,1378,1379],{},"less or equal",[244,1381,1357],{},[226,1383,1384,1389,1391],{},[244,1385,1386],{},[185,1387,1388],{},"in",[244,1390,1388],{},[244,1392,1393],{},"equals one item of a JSON array or a comma-separated list",[226,1395,1396,1401,1404],{},[244,1397,1398],{},[185,1399,1400],{},"notIn",[244,1402,1403],{},"not in",[244,1405,1406],{},"equals none of those items",[226,1408,1409,1414,1416],{},[244,1410,1411],{},[185,1412,1413],{},"contains",[244,1415,1413],{},[244,1417,1418],{},"a string contains the text, or an array has an equal item",[226,1420,1421,1426,1429],{},[244,1422,1423],{},[185,1424,1425],{},"notContains",[244,1427,1428],{},"not contains",[244,1430,1431],{},"the opposite",[226,1433,1434,1439,1442],{},[244,1435,1436],{},[185,1437,1438],{},"startsWith",[244,1440,1441],{},"starts with",[244,1443,1444],{},"a string starts with the text",[226,1446,1447,1452,1455],{},[244,1448,1449],{},[185,1450,1451],{},"endsWith",[244,1453,1454],{},"ends with",[244,1456,1457],{},"a string ends with the text",[226,1459,1460,1465,1467],{},[244,1461,1462],{},[185,1463,1464],{},"matches",[244,1466,1464],{},[244,1468,1469,1470,1473],{},"a JavaScript ",[185,1471,1472],{},"RegExp"," built from the value finds a match in the string form of the result",[226,1475,1476,1481,1484],{},[244,1477,1478],{},[185,1479,1480],{},"notMatches",[244,1482,1483],{},"not matches",[244,1485,1486],{},"no match",[226,1488,1489,1494,1496],{},[244,1490,1491],{},[185,1492,1493],{},"between",[244,1495,1493],{},[244,1497,1498,1499,442,1502],{},"a number inside an inclusive range written ",[185,1500,1501],{},"1, 10",[185,1503,1504],{},"[1, 10]",[226,1506,1507,1512,1514],{},[244,1508,1509],{},[185,1510,1511],{},"length",[244,1513,1511],{},[244,1515,1516],{},"a string (characters), array or object (keys) has exactly the given length",[226,1518,1519,1524,1527],{},[244,1520,1521],{},[185,1522,1523],{},"isEmpty",[244,1525,1526],{},"is empty",[244,1528,1529],{},"unary",[226,1531,1532,1537,1540],{},[244,1533,1534],{},[185,1535,1536],{},"isNotEmpty",[244,1538,1539],{},"is not empty",[244,1541,1542,1543,209,1545,1547],{},"unary; ",[185,1544,1242],{},[185,1546,1233],{}," fail",[226,1549,1550,1555,1558],{},[244,1551,1552],{},[185,1553,1554],{},"isNull",[244,1556,1557],{},"is null",[244,1559,1529],{},[226,1561,1562,1567,1570],{},[244,1563,1564],{},[185,1565,1566],{},"isUndefined",[244,1568,1569],{},"is undefined",[244,1571,1529],{},[226,1573,1574,1579,1582],{},[244,1575,1576],{},[185,1577,1578],{},"isDefined",[244,1580,1581],{},"is defined",[244,1583,1529],{},[226,1585,1586,1591,1594],{},[244,1587,1588],{},[185,1589,1590],{},"isTruthy",[244,1592,1593],{},"is truthy",[244,1595,1529],{},[226,1597,1598,1603,1606],{},[244,1599,1600],{},[185,1601,1602],{},"isFalsy",[244,1604,1605],{},"is falsy",[244,1607,1529],{},[226,1609,1610,1615,1618],{},[244,1611,1612],{},[185,1613,1614],{},"isNumber",[244,1616,1617],{},"is number",[244,1619,1529],{},[226,1621,1622,1627,1630],{},[244,1623,1624],{},[185,1625,1626],{},"isString",[244,1628,1629],{},"is string",[244,1631,1529],{},[226,1633,1634,1639,1642],{},[244,1635,1636],{},[185,1637,1638],{},"isBoolean",[244,1640,1641],{},"is boolean",[244,1643,1529],{},[226,1645,1646,1651,1654],{},[244,1647,1648],{},[185,1649,1650],{},"isArray",[244,1652,1653],{},"is array",[244,1655,1529],{},[226,1657,1658,1663,1666],{},[244,1659,1660],{},[185,1661,1662],{},"isJson",[244,1664,1665],{},"is JSON",[244,1667,1668],{},"unary; an array or an object",[178,1670,1671],{},"Type errors:",[467,1673,1674,1685],{},[324,1675,1676,209,1678,1680,1681,1684],{},[185,1677,1438],{},[185,1679,1451],{}," fail with ",[185,1682,1683],{},"expected a string"," on other types.",[324,1686,1687,209,1689,1680,1691,197],{},[185,1688,1413],{},[185,1690,1425],{},[185,1692,1693],{},"expected a string or an array",[178,1695,1696,1697,1700,1701,197],{},"Tests and assertions travel with Postman exports as ",[185,1698,1699],{},"postguyTests",". Bruno assertions map to these operators on import. See ",[194,1702,69],{"href":70},[215,1704,1706],{"id":1705},"sandbox-limits","Sandbox limits",[178,1708,1709,1710,1713],{},"Scripts get no filesystem, process or network access. The only way out is ",[185,1711,1712],{},"pm.sendRequest"," and the cookie lookup. The app runs both through its own request pipeline. A script error or panic becomes a reported failure, never a crash.",[220,1715,1716,1726],{},[223,1717,1718],{},[226,1719,1720,1723],{},[229,1721,1722],{},"Limit",[229,1724,1725],{},"Value",[239,1727,1728,1736,1744,1752,1762,1770,1778,1790],{},[226,1729,1730,1733],{},[244,1731,1732],{},"Wall-clock time for all scripts of one phase",[244,1734,1735],{},"5,000 ms",[226,1737,1738,1741],{},[244,1739,1740],{},"JavaScript heap",[244,1742,1743],{},"64 MiB",[226,1745,1746,1749],{},[244,1747,1748],{},"Native stack",[244,1750,1751],{},"1 MiB",[226,1753,1754,1759],{},[244,1755,1756,1758],{},[185,1757,1712],{}," calls per run",[244,1760,1761],{},"10",[226,1763,1764,1767],{},[244,1765,1766],{},"Kept console lines per run",[244,1768,1769],{},"1,000",[226,1771,1772,1775],{},[244,1773,1774],{},"Kept test results per run",[244,1776,1777],{},"1,000; more are ignored and reported as a script failure",[226,1779,1780,1787],{},[244,1781,1782,1783,1786],{},"Modules loaded with ",[185,1784,1785],{},"require"," per run",[244,1788,1789],{},"64",[226,1791,1792,1795],{},[244,1793,1794],{},"Size of one module",[244,1796,1797],{},"8 MiB, UTF-8 text",[178,1799,1800],{},"A run that hits the time or memory limit stops with a failure message that names the limit. A pre-request run that does so sends nothing.",[451,1802,1804,1806],{"id":1803},"require-and-assets",[185,1805,1785],{}," and assets",[178,1808,1809,1811,1812,1815,1816,197],{},[185,1810,1785],{}," loads CommonJS modules from the collection's ",[185,1813,1814],{},"Assets"," folder. Paths are relative to the folder root, for example ",[185,1817,1818],{},"require('.\u002Flib\u002Fhelpers.js')",[467,1820,1821,1844,1861,1864],{},[324,1822,1823,1824,257,1827,257,1830,209,1833,1836,1837,1839,1840,1843],{},"The virtual ",[185,1825,1826],{},"fs",[185,1828,1829],{},"path",[185,1831,1832],{},"buffer",[185,1834,1835],{},"crypto"," shims read the same folder. ",[185,1838,1835],{}," offers ",[185,1841,1842],{},"randomUUID",". Every write function throws an explanatory error.",[324,1845,1846,1839,1849,257,1852,257,1855,209,1858,197],{},[185,1847,1848],{},"pg.assets",[185,1850,1851],{},"text",[185,1853,1854],{},"base64",[185,1856,1857],{},"exists",[185,1859,1860],{},"list",[324,1862,1863],{},"npm packages cannot be loaded.",[324,1865,1866,257,1869,209,1872,1875],{},[185,1867,1868],{},"bru.sleep",[185,1870,1871],{},"bru.cwd",[185,1873,1874],{},"bru.runRequest"," are refused with an error.",[178,1877,1878,1879,1882,1883,1885],{},"See ",[194,1880,45],{"href":1881},"\u002Fguide\u002Fcollections#assets"," for managing assets, and the ",[194,1884,115],{"href":116}," for the exact surface.",[215,1887,1889],{"id":1888},"turn-scripts-off","Turn scripts off",[178,1891,1892,1895],{},[185,1893,1894],{},"Settings › General › Disable scripts"," skips pre-request and post-response scripts, and the Tests tab, for every request and collection run.",[178,1897,1898,1899,1902,1903,197],{},"The send then carries a warning: ",[185,1900,1901],{},"scripts are disabled in Settings; pre-request and post-response scripts were skipped",". See ",[194,1904,89],{"href":90},[215,1906,1908],{"id":1907},"headless","Headless",[1910,1911,1912,1955],"tip",{"title":1908},[467,1913,1914,1920,1926,1939],{},[324,1915,1916,1919],{},[185,1917,1918],{},"request_send"," runs the whole pipeline, scripts and tests included, and returns the script report with the result.",[324,1921,1922,1925],{},[185,1923,1924],{},"collection_run"," runs scripts and tests across a collection.",[324,1927,1928,1931,1932,209,1935,1938],{},[185,1929,1930],{},"runtime_variables"," reads (and optionally clears) the ",[185,1933,1934],{},"pg.setVar",[185,1936,1937],{},"bru.setVar"," values of a collection.",[324,1940,1941,1944,1945,209,1948,1951,1952,197],{},[185,1942,1943],{},"request_update"," edits a request's ",[185,1946,1947],{},"scripts",[185,1949,1950],{},"tests"," through its ",[185,1953,1954],{},"definition",[178,1956,1878,1957,1959,1960,197],{},[194,1958,111],{"href":112}," and the ",[194,1961,1962],{"href":108},"CLI",[1964,1965,1966],"style",{},"html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}",{"title":528,"searchDepth":573,"depth":573,"links":1968},[1969,1970,1971,1974,1975,1978,1982,1983],{"id":217,"depth":573,"text":218},{"id":315,"depth":573,"text":316},{"id":371,"depth":573,"text":372,"children":1972},[1973],{"id":453,"depth":612,"text":454},{"id":514,"depth":573,"text":515},{"id":1172,"depth":573,"text":1173,"children":1976},[1977],{"id":1258,"depth":612,"text":1259},{"id":1705,"depth":573,"text":1706,"children":1979},[1980],{"id":1803,"depth":612,"text":1981},"require and assets",{"id":1888,"depth":573,"text":1889},{"id":1907,"depth":573,"text":1908},"Pre-request and post-response scripts, the Tests tab with 28 assertion operators, execution order and sandbox limits.","md",null,{},{"title":61,"description":1984},"DYI2r08wsjvAkNE1h-hAz_5EMtlqyDhx850EwDbcUvs",[1991,1993],{"title":57,"path":58,"stem":59,"description":1992,"children":-1},"Set auth on a request, folder or collection. Auth kinds, inheritance and OAuth 2.0 flows.",{"title":65,"path":66,"stem":67,"description":1994,"children":-1},"Run a collection or folder in sequence with iterations, data files and reports. Use the Runner tab or postguy-cli run.",1793179613009]