WAVE Server REST API Tests.postman_collection.json (294561B)
1 { 2 "info": { 3 "_postman_id": "ccd6117a-6d61-4617-a6a1-7115db4d4d92", 4 "name": "WAVE Server REST API Tests", 5 "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 6 }, 7 "item": [ 8 { 9 "name": "Read Available Tests", 10 "item": [ 11 { 12 "name": "Read Available Tests", 13 "event": [ 14 { 15 "listen": "test", 16 "script": { 17 "id": "051bef94-5544-4ddb-9d85-167677ebecb2", 18 "exec": [ 19 "pm.test(\"Status code is 200\", function () {", 20 " pm.response.to.have.status(200);", 21 "});", 22 "", 23 "var availableTests = pm.response.json();", 24 "", 25 "pm.test(\"JSON structure is as expected\", function () {", 26 " pm.expect(typeof availableTests).to.equal(\"object\");", 27 " for (var api of Object.keys(availableTests)) {", 28 " pm.expect(availableTests[api]).to.be.an.instanceof(Array);", 29 " var apiRegExp = new RegExp(\"^/\" + api, \"i\");", 30 " for (var test of availableTests[api]) {", 31 " pm.expect(test).to.match(apiRegExp);", 32 " }", 33 " }", 34 "});", 35 "", 36 "var includedTests = [];", 37 "var excludedTests = [];", 38 "var specialTimeoutTest = \"\";", 39 "", 40 "var apis = Object.keys(availableTests);", 41 "for(var api of apis) {", 42 " if (availableTests[api].length > 50) {", 43 " var subDirs = availableTests[api].map(test => test.split(\"/\").filter(part => !!part).join(\"/\").split(\"/\")[1]).reduce((acc, curr) => acc.indexOf(curr) === -1 ? acc.concat([curr]) : acc, []);", 44 " if (subDirs.length > 2) {", 45 " includedTests.push(\"/\" + api);", 46 " excludedTests.push(\"/\" + api + \"/\" + subDirs[0]);", 47 " specialTimeoutTest = availableTests[api][availableTests[api].length - 1];", 48 " break;", 49 " }", 50 " ", 51 " }", 52 "}", 53 "", 54 "pm.globals.set(\"available_tests\", JSON.stringify(availableTests));", 55 "pm.globals.set(\"included_tests\", JSON.stringify(includedTests));", 56 "pm.globals.set(\"excluded_tests\", JSON.stringify(excludedTests));", 57 "pm.globals.set(\"special_timeout_test\", specialTimeoutTest.replace(\".\", \"\"));" 58 ], 59 "type": "text/javascript" 60 } 61 } 62 ], 63 "request": { 64 "method": "GET", 65 "header": [], 66 "url": { 67 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests", 68 "protocol": "{{protocol}}", 69 "host": [ 70 "{{host}}" 71 ], 72 "port": "{{port}}", 73 "path": [ 74 "{{web_root}}", 75 "api", 76 "tests" 77 ] 78 } 79 }, 80 "response": [] 81 } 82 ], 83 "protocolProfileBehavior": {} 84 }, 85 { 86 "name": "Create and Read Sessions", 87 "item": [ 88 { 89 "name": "Start expiring session remove expiration date", 90 "item": [ 91 { 92 "name": "Create Session With Expiration", 93 "event": [ 94 { 95 "listen": "test", 96 "script": { 97 "id": "a8bf3e41-a7df-4c6b-8a20-3a1e6d8a51d9", 98 "exec": [ 99 "pm.test(\"Status code is 200\", function () {", 100 " pm.response.to.have.status(200);", 101 "});", 102 "", 103 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 104 "", 105 "pm.test(\"Responds with token in JSON format\", function () {", 106 " var jsonData = pm.response.json();", 107 " pm.expect(jsonData).to.have.property(\"token\");", 108 " pm.expect(jsonData.token).to.match(tokenRegex);", 109 "});", 110 "", 111 "", 112 "const response = pm.response.json();", 113 "const token = response.token;", 114 "pm.globals.set(\"session_token\", token);" 115 ], 116 "type": "text/javascript" 117 } 118 }, 119 { 120 "listen": "prerequest", 121 "script": { 122 "id": "4370546f-b08c-4f77-9bd9-1cd14400665e", 123 "exec": [ 124 "var expirationDate = Date.now() + 10000;", 125 "pm.globals.set(\"expiration_date\", expirationDate);" 126 ], 127 "type": "text/javascript" 128 } 129 } 130 ], 131 "request": { 132 "method": "POST", 133 "header": [ 134 { 135 "key": "Content-Type", 136 "name": "Content-Type", 137 "type": "text", 138 "value": "application/json" 139 } 140 ], 141 "body": { 142 "mode": "raw", 143 "raw": "{\n\t\"expiration_date\": {{expiration_date}}\n}" 144 }, 145 "url": { 146 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 147 "protocol": "{{protocol}}", 148 "host": [ 149 "{{host}}" 150 ], 151 "port": "{{port}}", 152 "path": [ 153 "{{web_root}}", 154 "api", 155 "sessions" 156 ] 157 } 158 }, 159 "response": [] 160 }, 161 { 162 "name": "Read Session Status", 163 "event": [ 164 { 165 "listen": "test", 166 "script": { 167 "id": "3dcb5b6c-9151-49f7-a1a6-74475927b304", 168 "exec": [ 169 "pm.test(\"Status code is 200\", function () {", 170 " pm.response.to.have.status(200);", 171 "});", 172 "", 173 "var jsonData = pm.response.json();", 174 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 175 "", 176 "pm.test(\"JSON structure contains expiration date\", function () {", 177 " pm.expect(jsonData).to.have.property(\"expiration_date\");", 178 "});", 179 "", 180 "var expirationDate = pm.globals.get(\"expiration_date\");", 181 "", 182 "pm.test(\"Expiration date is as specified\", function () {", 183 " pm.expect(Date.parse(jsonData.expiration_date)).to.equal(expirationDate);", 184 "});" 185 ], 186 "type": "text/javascript" 187 } 188 } 189 ], 190 "request": { 191 "method": "GET", 192 "header": [], 193 "url": { 194 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 195 "protocol": "{{protocol}}", 196 "host": [ 197 "{{host}}" 198 ], 199 "port": "{{port}}", 200 "path": [ 201 "{{web_root}}", 202 "api", 203 "sessions", 204 "{{session_token}}", 205 "status" 206 ] 207 } 208 }, 209 "response": [] 210 }, 211 { 212 "name": "Start Session", 213 "event": [ 214 { 215 "listen": "test", 216 "script": { 217 "id": "8d05578a-e2d6-41e9-a2a4-aa7d92bfbbce", 218 "exec": [ 219 "pm.test(\"Status code is 200\", function () {", 220 " pm.response.to.have.status(200);", 221 "});" 222 ], 223 "type": "text/javascript" 224 } 225 } 226 ], 227 "request": { 228 "method": "POST", 229 "header": [], 230 "url": { 231 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 232 "protocol": "{{protocol}}", 233 "host": [ 234 "{{host}}" 235 ], 236 "port": "{{port}}", 237 "path": [ 238 "{{web_root}}", 239 "api", 240 "sessions", 241 "{{session_token}}", 242 "start" 243 ] 244 } 245 }, 246 "response": [] 247 }, 248 { 249 "name": "Read Session Status", 250 "event": [ 251 { 252 "listen": "test", 253 "script": { 254 "id": "4c5e3ba4-e27b-4341-8cf8-74ed047a8747", 255 "exec": [ 256 "pm.test(\"Status code is 200\", function () {", 257 " pm.response.to.have.status(200);", 258 "});", 259 "", 260 "var jsonData = pm.response.json();", 261 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 262 "", 263 "pm.test(\"JSON structure contains expiration date\", function () {", 264 " pm.expect(jsonData).to.have.property(\"expiration_date\");", 265 "});", 266 "", 267 "pm.test(\"Expiration date is null\", function () {", 268 " pm.expect(jsonData.expiration_date).to.be.null;", 269 "});" 270 ], 271 "type": "text/javascript" 272 } 273 } 274 ], 275 "request": { 276 "method": "GET", 277 "header": [], 278 "url": { 279 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 280 "protocol": "{{protocol}}", 281 "host": [ 282 "{{host}}" 283 ], 284 "port": "{{port}}", 285 "path": [ 286 "{{web_root}}", 287 "api", 288 "sessions", 289 "{{session_token}}", 290 "status" 291 ] 292 } 293 }, 294 "response": [] 295 }, 296 { 297 "name": "Clean Up", 298 "request": { 299 "method": "DELETE", 300 "header": [], 301 "url": { 302 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 303 "protocol": "{{protocol}}", 304 "host": [ 305 "{{host}}" 306 ], 307 "port": "{{port}}", 308 "path": [ 309 "{{web_root}}", 310 "api", 311 "sessions", 312 "{{session_token}}" 313 ] 314 } 315 }, 316 "response": [] 317 } 318 ], 319 "protocolProfileBehavior": {}, 320 "_postman_isSubFolder": true 321 } 322 ], 323 "protocolProfileBehavior": {} 324 }, 325 { 326 "name": "Read Public Sessions", 327 "item": [ 328 { 329 "name": "Read Public Sessions", 330 "event": [ 331 { 332 "listen": "test", 333 "script": { 334 "id": "1081afd8-a772-4565-b03d-b58f773cbb65", 335 "exec": [ 336 "pm.test(\"Status code is 200\", function () {", 337 " pm.response.to.have.status(200);", 338 "});", 339 "", 340 "pm.test(\"Response is JSON Array\", function () {", 341 " var jsonData = pm.response.json();", 342 " pm.expect(jsonData).to.be.an.instanceof(Array);", 343 "});" 344 ], 345 "type": "text/javascript" 346 } 347 } 348 ], 349 "request": { 350 "method": "GET", 351 "header": [], 352 "url": { 353 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/public", 354 "protocol": "{{protocol}}", 355 "host": [ 356 "{{host}}" 357 ], 358 "port": "{{port}}", 359 "path": [ 360 "{{web_root}}", 361 "api", 362 "sessions", 363 "public" 364 ] 365 } 366 }, 367 "response": [] 368 } 369 ], 370 "protocolProfileBehavior": {} 371 }, 372 { 373 "name": "Find Session", 374 "item": [ 375 { 376 "name": "Create Session No Configuration", 377 "event": [ 378 { 379 "listen": "test", 380 "script": { 381 "id": "268e8a31-87bb-4ec5-81d5-87dc74096828", 382 "exec": [ 383 "pm.test(\"Status code is 200\", function () {", 384 " pm.response.to.have.status(200);", 385 "});", 386 "", 387 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 388 "", 389 "pm.test(\"Responds with token in JSON format\", function () {", 390 " var jsonData = pm.response.json();", 391 " pm.expect(jsonData).to.have.property(\"token\");", 392 " pm.expect(jsonData.token).to.match(tokenRegex);", 393 "});", 394 "", 395 "", 396 "const response = pm.response.json();", 397 "const token = response.token;", 398 "pm.globals.set(\"session_token\", token);" 399 ], 400 "type": "text/javascript" 401 } 402 } 403 ], 404 "request": { 405 "method": "POST", 406 "header": [ 407 { 408 "key": "Content-Type", 409 "name": "Content-Type", 410 "type": "text", 411 "value": "application/json" 412 } 413 ], 414 "body": { 415 "mode": "raw", 416 "raw": "" 417 }, 418 "url": { 419 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 420 "protocol": "{{protocol}}", 421 "host": [ 422 "{{host}}" 423 ], 424 "port": "{{port}}", 425 "path": [ 426 "{{web_root}}", 427 "api", 428 "sessions" 429 ] 430 } 431 }, 432 "response": [] 433 }, 434 { 435 "name": "Find Session Token", 436 "event": [ 437 { 438 "listen": "prerequest", 439 "script": { 440 "id": "625fcc2a-f7b1-403c-b5c5-56db7c5bcee5", 441 "exec": [ 442 "const token = pm.globals.get(\"session_token\");", 443 "pm.globals.set(\"session_token_fragment\", token.split(\"-\").shift());" 444 ], 445 "type": "text/javascript" 446 } 447 }, 448 { 449 "listen": "test", 450 "script": { 451 "id": "8e04212f-e259-413f-98ee-e366cd3adfdd", 452 "exec": [ 453 "pm.test(\"Status code is 200\", function () {", 454 " pm.response.to.have.status(200);", 455 "});", 456 "", 457 "const sessionToken = pm.globals.get(\"session_token\");", 458 "", 459 "pm.test(\"Found token is original token\", function () {", 460 " var jsonData = pm.response.json();", 461 " pm.expect(jsonData.token).to.equal(sessionToken);", 462 "});" 463 ], 464 "type": "text/javascript" 465 } 466 } 467 ], 468 "request": { 469 "method": "GET", 470 "header": [], 471 "url": { 472 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token_fragment}}", 473 "protocol": "{{protocol}}", 474 "host": [ 475 "{{host}}" 476 ], 477 "port": "{{port}}", 478 "path": [ 479 "{{web_root}}", 480 "api", 481 "sessions", 482 "{{session_token_fragment}}" 483 ] 484 } 485 }, 486 "response": [] 487 }, 488 { 489 "name": "Clean Up", 490 "request": { 491 "method": "DELETE", 492 "header": [], 493 "url": { 494 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 495 "protocol": "{{protocol}}", 496 "host": [ 497 "{{host}}" 498 ], 499 "port": "{{port}}", 500 "path": [ 501 "{{web_root}}", 502 "api", 503 "sessions", 504 "{{session_token}}" 505 ] 506 } 507 }, 508 "response": [] 509 }, 510 { 511 "name": "Find Session Too Short Fragment", 512 "event": [ 513 { 514 "listen": "prerequest", 515 "script": { 516 "id": "6f8429e3-9c12-423c-baaf-8f8de0e4ea49", 517 "exec": [ 518 "const token = pm.globals.get(\"session_token\");", 519 "pm.globals.set(\"session_token_fragment\", token.split(\"-\").shift());" 520 ], 521 "type": "text/javascript" 522 } 523 }, 524 { 525 "listen": "test", 526 "script": { 527 "id": "7f6ef567-274e-4f9d-b7fc-50f8240547e9", 528 "exec": [ 529 "pm.test(\"Status code is 404\", function () {", 530 " pm.response.to.have.status(404);", 531 "});" 532 ], 533 "type": "text/javascript" 534 } 535 } 536 ], 537 "request": { 538 "method": "GET", 539 "header": [], 540 "url": { 541 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/1234567", 542 "protocol": "{{protocol}}", 543 "host": [ 544 "{{host}}" 545 ], 546 "port": "{{port}}", 547 "path": [ 548 "{{web_root}}", 549 "api", 550 "sessions", 551 "1234567" 552 ] 553 } 554 }, 555 "response": [] 556 } 557 ], 558 "protocolProfileBehavior": {} 559 }, 560 { 561 "name": "Read Next Test", 562 "item": [ 563 { 564 "name": "Clean Up", 565 "request": { 566 "method": "DELETE", 567 "header": [], 568 "url": { 569 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 570 "protocol": "{{protocol}}", 571 "host": [ 572 "{{host}}" 573 ], 574 "port": "{{port}}", 575 "path": [ 576 "{{web_root}}", 577 "api", 578 "sessions", 579 "{{session_token}}" 580 ] 581 } 582 }, 583 "response": [] 584 }, 585 { 586 "name": "Read Next Test of Invalid Session", 587 "event": [ 588 { 589 "listen": "test", 590 "script": { 591 "id": "11f5c620-dc3b-4a8c-8d2f-f9663025c79f", 592 "exec": [ 593 "pm.test(\"Status code is 404\", function () {", 594 " pm.response.to.have.status(404);", 595 "});" 596 ], 597 "type": "text/javascript" 598 } 599 } 600 ], 601 "request": { 602 "method": "GET", 603 "header": [], 604 "url": { 605 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 606 "protocol": "{{protocol}}", 607 "host": [ 608 "{{host}}" 609 ], 610 "port": "{{port}}", 611 "path": [ 612 "{{web_root}}", 613 "api", 614 "tests", 615 "{{session_token}}", 616 "next" 617 ] 618 } 619 }, 620 "response": [] 621 }, 622 { 623 "name": "Create Session \\w Configuration", 624 "event": [ 625 { 626 "listen": "test", 627 "script": { 628 "id": "c67cde7e-7237-479c-a0c6-b84a533c3b1e", 629 "exec": [ 630 "const response = pm.response.json();", 631 "const token = response.token;", 632 "pm.globals.set(\"session_token\", token);" 633 ], 634 "type": "text/javascript" 635 } 636 }, 637 { 638 "listen": "prerequest", 639 "script": { 640 "id": "24b38d64-5c24-415f-b6f6-f8d252d69ac8", 641 "exec": [ 642 "var automaticTimeout = 120000;", 643 "var manualTimeout = 1000000;", 644 "var specialTimeout = 2000;", 645 "", 646 "pm.globals.set(\"automatic_timeout\", automaticTimeout);", 647 "pm.globals.set(\"manual_timeout\", manualTimeout);", 648 "pm.globals.set(\"special_timeout\", specialTimeout);", 649 "", 650 "const availableTests = JSON.parse(pm.globals.get(\"available_tests\"));", 651 "const test1 = availableTests[Object.keys(availableTests)[0]][0];", 652 "", 653 "pm.globals.set(\"single_test_1\", test1);" 654 ], 655 "type": "text/javascript" 656 } 657 } 658 ], 659 "request": { 660 "method": "POST", 661 "header": [ 662 { 663 "key": "Content-Type", 664 "name": "Content-Type", 665 "type": "text", 666 "value": "application/json" 667 } 668 ], 669 "body": { 670 "mode": "raw", 671 "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test_1}}\"]\n },\n \"types\": [\n \"automatic\",\n \"manual\"\n ]\n}" 672 }, 673 "url": { 674 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 675 "protocol": "{{protocol}}", 676 "host": [ 677 "{{host}}" 678 ], 679 "port": "{{port}}", 680 "path": [ 681 "{{web_root}}", 682 "api", 683 "sessions" 684 ] 685 } 686 }, 687 "response": [] 688 }, 689 { 690 "name": "Read Next Test of Pending Session", 691 "event": [ 692 { 693 "listen": "test", 694 "script": { 695 "id": "0806e4e0-bd1b-40ba-a7d5-74d41473a141", 696 "exec": [ 697 "pm.test(\"Status code is 200\", function () {", 698 " pm.response.to.have.status(200);", 699 "});", 700 "", 701 "var jsonData = pm.response.json();", 702 "const nextTest = jsonData.next_test;", 703 "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 704 "", 705 "const web_root = pm.environment.get(\"web_root\");", 706 "", 707 "pm.test(\"Returned test is new session page\", function () {", 708 " pm.expect(test).to.equal(\"/\" + web_root + \"/newsession.html\");", 709 "});" 710 ], 711 "type": "text/javascript" 712 } 713 } 714 ], 715 "request": { 716 "method": "GET", 717 "header": [], 718 "url": { 719 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 720 "protocol": "{{protocol}}", 721 "host": [ 722 "{{host}}" 723 ], 724 "port": "{{port}}", 725 "path": [ 726 "{{web_root}}", 727 "api", 728 "tests", 729 "{{session_token}}", 730 "next" 731 ] 732 } 733 }, 734 "response": [] 735 }, 736 { 737 "name": "Start Session", 738 "event": [ 739 { 740 "listen": "test", 741 "script": { 742 "id": "9b1f2dec-9949-49ff-b466-f602b11dde5d", 743 "exec": [ 744 "pm.test(\"Status code is 200\", function () {", 745 " pm.response.to.have.status(200);", 746 "});" 747 ], 748 "type": "text/javascript" 749 } 750 } 751 ], 752 "request": { 753 "method": "POST", 754 "header": [], 755 "url": { 756 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 757 "protocol": "{{protocol}}", 758 "host": [ 759 "{{host}}" 760 ], 761 "port": "{{port}}", 762 "path": [ 763 "{{web_root}}", 764 "api", 765 "sessions", 766 "{{session_token}}", 767 "start" 768 ] 769 } 770 }, 771 "response": [] 772 }, 773 { 774 "name": "Read Next Test of Running Session", 775 "event": [ 776 { 777 "listen": "test", 778 "script": { 779 "id": "7fea2977-5ccb-49ee-8f07-79a7f2245f9c", 780 "exec": [ 781 "pm.test(\"Status code is 200\", function () {", 782 " pm.response.to.have.status(200);", 783 "});", 784 "", 785 "var jsonData = pm.response.json();", 786 "const nextTest = jsonData.next_test;", 787 "const parameters = nextTest.split(\"?\")[1].split(\"&\");", 788 "let test = parameters.find(parameter => parameter.split(\"=\")[0] === \"test_url\").split(\"=\")[1];", 789 "test = decodeURIComponent(test);", 790 "test = \"/\" + test.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 791 "const api = test.split(\"/\").filter(part => !!part)[0]", 792 "const availableTests = JSON.parse(pm.globals.get(\"available_tests\"));", 793 "", 794 "pm.test(\"Returned test is valid test\", function () {", 795 " pm.expect(availableTests).to.have.property(api);", 796 " pm.expect(availableTests[api]).to.contain(test)", 797 "});", 798 "", 799 "", 800 "setTimeout(function () {}, 1000);" 801 ], 802 "type": "text/javascript" 803 } 804 } 805 ], 806 "request": { 807 "method": "GET", 808 "header": [], 809 "url": { 810 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 811 "protocol": "{{protocol}}", 812 "host": [ 813 "{{host}}" 814 ], 815 "port": "{{port}}", 816 "path": [ 817 "{{web_root}}", 818 "api", 819 "tests", 820 "{{session_token}}", 821 "next" 822 ] 823 } 824 }, 825 "response": [] 826 }, 827 { 828 "name": "Create Result", 829 "event": [ 830 { 831 "listen": "test", 832 "script": { 833 "id": "7cc27ee8-2f06-4e25-98fb-9872c6cf0d93", 834 "exec": [ 835 "pm.test(\"Status code is 200\", function () {", 836 " pm.response.to.have.status(200);", 837 "});" 838 ], 839 "type": "text/javascript" 840 } 841 } 842 ], 843 "request": { 844 "method": "POST", 845 "header": [ 846 { 847 "key": "Content-Type", 848 "name": "Content-Type", 849 "value": "application/json", 850 "type": "text" 851 } 852 ], 853 "body": { 854 "mode": "raw", 855 "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" 856 }, 857 "url": { 858 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 859 "protocol": "{{protocol}}", 860 "host": [ 861 "{{host}}" 862 ], 863 "port": "{{port}}", 864 "path": [ 865 "{{web_root}}", 866 "api", 867 "results", 868 "{{session_token}}" 869 ] 870 } 871 }, 872 "response": [] 873 }, 874 { 875 "name": "Read Next Test of Completed Session", 876 "event": [ 877 { 878 "listen": "test", 879 "script": { 880 "id": "0a73a5eb-3edb-4d15-924d-260dd22bd831", 881 "exec": [ 882 "pm.test(\"Status code is 200\", function () {", 883 " pm.response.to.have.status(200);", 884 "});", 885 "", 886 "var jsonData = pm.response.json();", 887 "const nextTest = jsonData.next_test;", 888 "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 889 "", 890 "const web_root = pm.environment.get(\"web_root\");", 891 "", 892 "pm.test(\"Returned test is new session page\", function () {", 893 " pm.expect(test).to.equal(\"/\" + web_root + \"/finish.html\");", 894 "});" 895 ], 896 "type": "text/javascript" 897 } 898 } 899 ], 900 "request": { 901 "method": "GET", 902 "header": [], 903 "url": { 904 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 905 "protocol": "{{protocol}}", 906 "host": [ 907 "{{host}}" 908 ], 909 "port": "{{port}}", 910 "path": [ 911 "{{web_root}}", 912 "api", 913 "tests", 914 "{{session_token}}", 915 "next" 916 ] 917 } 918 }, 919 "response": [] 920 }, 921 { 922 "name": "Clean Up", 923 "request": { 924 "method": "DELETE", 925 "header": [], 926 "url": { 927 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 928 "protocol": "{{protocol}}", 929 "host": [ 930 "{{host}}" 931 ], 932 "port": "{{port}}", 933 "path": [ 934 "{{web_root}}", 935 "api", 936 "sessions", 937 "{{session_token}}" 938 ] 939 } 940 }, 941 "response": [] 942 }, 943 { 944 "name": "Create Session \\w Configuration Copy", 945 "event": [ 946 { 947 "listen": "test", 948 "script": { 949 "id": "94877ec6-70ea-4c78-acb5-20060a535653", 950 "exec": [ 951 "const response = pm.response.json();", 952 "const token = response.token;", 953 "pm.globals.set(\"session_token\", token);" 954 ], 955 "type": "text/javascript" 956 } 957 }, 958 { 959 "listen": "prerequest", 960 "script": { 961 "id": "dcc29092-b7a1-40fc-8359-ecc655dba482", 962 "exec": [ 963 "var automaticTimeout = 120000;", 964 "var manualTimeout = 1000000;", 965 "var specialTimeout = 2000;", 966 "", 967 "pm.globals.set(\"automatic_timeout\", automaticTimeout);", 968 "pm.globals.set(\"manual_timeout\", manualTimeout);", 969 "pm.globals.set(\"special_timeout\", specialTimeout);" 970 ], 971 "type": "text/javascript" 972 } 973 } 974 ], 975 "request": { 976 "method": "POST", 977 "header": [ 978 { 979 "key": "Content-Type", 980 "name": "Content-Type", 981 "type": "text", 982 "value": "application/json" 983 } 984 ], 985 "body": { 986 "mode": "raw", 987 "raw": "{\n \"tests\": {\n \"include\": {{included_tests}},\n \"exclude\": {{excluded_tests}}\n },\n \"types\": [\n \"automatic\",\n \"manual\"\n ],\n \"timeouts\": {\n \"automatic\": 1000\n },\n \"labels\": [\"label1\", \"label2\"]\n}" 988 }, 989 "url": { 990 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 991 "protocol": "{{protocol}}", 992 "host": [ 993 "{{host}}" 994 ], 995 "port": "{{port}}", 996 "path": [ 997 "{{web_root}}", 998 "api", 999 "sessions" 1000 ] 1001 } 1002 }, 1003 "response": [] 1004 }, 1005 { 1006 "name": "Start Session", 1007 "event": [ 1008 { 1009 "listen": "test", 1010 "script": { 1011 "id": "8f6e2bf2-6c1e-434e-83c5-9bcc57880692", 1012 "exec": [ 1013 "pm.test(\"Status code is 200\", function () {", 1014 " pm.response.to.have.status(200);", 1015 "});" 1016 ], 1017 "type": "text/javascript" 1018 } 1019 } 1020 ], 1021 "request": { 1022 "method": "POST", 1023 "header": [], 1024 "url": { 1025 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 1026 "protocol": "{{protocol}}", 1027 "host": [ 1028 "{{host}}" 1029 ], 1030 "port": "{{port}}", 1031 "path": [ 1032 "{{web_root}}", 1033 "api", 1034 "sessions", 1035 "{{session_token}}", 1036 "start" 1037 ] 1038 } 1039 }, 1040 "response": [] 1041 }, 1042 { 1043 "name": "Pause Session", 1044 "event": [ 1045 { 1046 "listen": "test", 1047 "script": { 1048 "id": "a0a80c05-a2ca-430a-8bed-46ad7978c684", 1049 "exec": [ 1050 "pm.test(\"Status code is 200\", function () {", 1051 " pm.response.to.have.status(200);", 1052 "});" 1053 ], 1054 "type": "text/javascript" 1055 } 1056 } 1057 ], 1058 "request": { 1059 "method": "POST", 1060 "header": [], 1061 "url": { 1062 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", 1063 "protocol": "{{protocol}}", 1064 "host": [ 1065 "{{host}}" 1066 ], 1067 "port": "{{port}}", 1068 "path": [ 1069 "{{web_root}}", 1070 "api", 1071 "sessions", 1072 "{{session_token}}", 1073 "pause" 1074 ] 1075 } 1076 }, 1077 "response": [] 1078 }, 1079 { 1080 "name": "Read Next Test of Aborted Session", 1081 "event": [ 1082 { 1083 "listen": "test", 1084 "script": { 1085 "id": "00d823e0-2059-4cab-81d6-8d1de9e5b62a", 1086 "exec": [ 1087 "pm.test(\"Status code is 200\", function () {", 1088 " pm.response.to.have.status(200);", 1089 "});", 1090 "", 1091 "var jsonData = pm.response.json();", 1092 "const nextTest = jsonData.next_test;", 1093 "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 1094 "", 1095 "const web_root = pm.environment.get(\"web_root\");", 1096 "", 1097 "pm.test(\"Returned test is new session page\", function () {", 1098 " pm.expect(test).to.equal(\"/\" + web_root + \"/pause.html\");", 1099 "});" 1100 ], 1101 "type": "text/javascript" 1102 } 1103 } 1104 ], 1105 "request": { 1106 "method": "GET", 1107 "header": [], 1108 "url": { 1109 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 1110 "protocol": "{{protocol}}", 1111 "host": [ 1112 "{{host}}" 1113 ], 1114 "port": "{{port}}", 1115 "path": [ 1116 "{{web_root}}", 1117 "api", 1118 "tests", 1119 "{{session_token}}", 1120 "next" 1121 ] 1122 } 1123 }, 1124 "response": [] 1125 }, 1126 { 1127 "name": "Stop Session", 1128 "event": [ 1129 { 1130 "listen": "test", 1131 "script": { 1132 "id": "b8211c13-667d-4970-aedc-6398c25cc40c", 1133 "exec": [ 1134 "pm.test(\"Status code is 200\", function () {", 1135 " pm.response.to.have.status(200);", 1136 "});" 1137 ], 1138 "type": "text/javascript" 1139 } 1140 } 1141 ], 1142 "request": { 1143 "method": "POST", 1144 "header": [], 1145 "url": { 1146 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", 1147 "protocol": "{{protocol}}", 1148 "host": [ 1149 "{{host}}" 1150 ], 1151 "port": "{{port}}", 1152 "path": [ 1153 "{{web_root}}", 1154 "api", 1155 "sessions", 1156 "{{session_token}}", 1157 "stop" 1158 ] 1159 } 1160 }, 1161 "response": [] 1162 }, 1163 { 1164 "name": "Read Next Test of Aborted Session", 1165 "event": [ 1166 { 1167 "listen": "test", 1168 "script": { 1169 "id": "8aad813d-53fe-49fd-bdfc-f16ce2233ae2", 1170 "exec": [ 1171 "pm.test(\"Status code is 200\", function () {", 1172 " pm.response.to.have.status(200);", 1173 "});", 1174 "", 1175 "var jsonData = pm.response.json();", 1176 "const nextTest = jsonData.next_test;", 1177 "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 1178 "", 1179 "const web_root = pm.environment.get(\"web_root\");", 1180 "", 1181 "pm.test(\"Returned test is new session page\", function () {", 1182 " pm.expect(test).to.equal(\"/\" + web_root + \"/finish.html\");", 1183 "});" 1184 ], 1185 "type": "text/javascript" 1186 } 1187 } 1188 ], 1189 "request": { 1190 "method": "GET", 1191 "header": [], 1192 "url": { 1193 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 1194 "protocol": "{{protocol}}", 1195 "host": [ 1196 "{{host}}" 1197 ], 1198 "port": "{{port}}", 1199 "path": [ 1200 "{{web_root}}", 1201 "api", 1202 "tests", 1203 "{{session_token}}", 1204 "next" 1205 ] 1206 } 1207 }, 1208 "response": [] 1209 }, 1210 { 1211 "name": "Clean Up", 1212 "request": { 1213 "method": "DELETE", 1214 "header": [], 1215 "url": { 1216 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 1217 "protocol": "{{protocol}}", 1218 "host": [ 1219 "{{host}}" 1220 ], 1221 "port": "{{port}}", 1222 "path": [ 1223 "{{web_root}}", 1224 "api", 1225 "sessions", 1226 "{{session_token}}" 1227 ] 1228 } 1229 }, 1230 "response": [] 1231 } 1232 ], 1233 "protocolProfileBehavior": {} 1234 }, 1235 { 1236 "name": "Control Session", 1237 "item": [ 1238 { 1239 "name": "Setup", 1240 "item": [ 1241 { 1242 "name": "Create Session No Configuration", 1243 "event": [ 1244 { 1245 "listen": "test", 1246 "script": { 1247 "id": "305cb915-8496-4577-b17a-e8189d66c3d1", 1248 "exec": [ 1249 "pm.test(\"Status code is 200\", function () {", 1250 " pm.response.to.have.status(200);", 1251 "});", 1252 "", 1253 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 1254 "", 1255 "pm.test(\"Responds with token in JSON format\", function () {", 1256 " var jsonData = pm.response.json();", 1257 " pm.expect(jsonData).to.have.property(\"token\");", 1258 " pm.expect(jsonData.token).to.match(tokenRegex);", 1259 "});", 1260 "", 1261 "", 1262 "const response = pm.response.json();", 1263 "const token = response.token;", 1264 "pm.globals.set(\"session_token\", token);" 1265 ], 1266 "type": "text/javascript" 1267 } 1268 } 1269 ], 1270 "request": { 1271 "method": "POST", 1272 "header": [ 1273 { 1274 "key": "Content-Type", 1275 "name": "Content-Type", 1276 "type": "text", 1277 "value": "application/json" 1278 } 1279 ], 1280 "body": { 1281 "mode": "raw", 1282 "raw": "" 1283 }, 1284 "url": { 1285 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 1286 "protocol": "{{protocol}}", 1287 "host": [ 1288 "{{host}}" 1289 ], 1290 "port": "{{port}}", 1291 "path": [ 1292 "{{web_root}}", 1293 "api", 1294 "sessions" 1295 ] 1296 } 1297 }, 1298 "response": [] 1299 } 1300 ], 1301 "protocolProfileBehavior": {}, 1302 "_postman_isSubFolder": true 1303 }, 1304 { 1305 "name": "Pause Pending Session", 1306 "item": [ 1307 { 1308 "name": "Pause Session", 1309 "event": [ 1310 { 1311 "listen": "test", 1312 "script": { 1313 "id": "9d903165-9667-43b0-b210-a950d0fa1fa2", 1314 "exec": [ 1315 "pm.test(\"Status code is 200\", function () {", 1316 " pm.response.to.have.status(200);", 1317 "});" 1318 ], 1319 "type": "text/javascript" 1320 } 1321 } 1322 ], 1323 "request": { 1324 "method": "POST", 1325 "header": [], 1326 "url": { 1327 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", 1328 "protocol": "{{protocol}}", 1329 "host": [ 1330 "{{host}}" 1331 ], 1332 "port": "{{port}}", 1333 "path": [ 1334 "{{web_root}}", 1335 "api", 1336 "sessions", 1337 "{{session_token}}", 1338 "pause" 1339 ] 1340 } 1341 }, 1342 "response": [] 1343 }, 1344 { 1345 "name": "Read Session Status", 1346 "event": [ 1347 { 1348 "listen": "test", 1349 "script": { 1350 "id": "0307919b-6630-48ff-ac18-10c0a47ea254", 1351 "exec": [ 1352 "pm.test(\"Status code is 200\", function () {", 1353 " pm.response.to.have.status(200);", 1354 "});", 1355 "", 1356 "pm.test(\"Status is pending\", function () {", 1357 " var jsonData = pm.response.json();", 1358 " pm.expect(jsonData.status).to.equal(\"pending\");", 1359 "});" 1360 ], 1361 "type": "text/javascript" 1362 } 1363 } 1364 ], 1365 "request": { 1366 "method": "GET", 1367 "header": [], 1368 "url": { 1369 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 1370 "protocol": "{{protocol}}", 1371 "host": [ 1372 "{{host}}" 1373 ], 1374 "port": "{{port}}", 1375 "path": [ 1376 "{{web_root}}", 1377 "api", 1378 "sessions", 1379 "{{session_token}}", 1380 "status" 1381 ] 1382 } 1383 }, 1384 "response": [] 1385 } 1386 ], 1387 "protocolProfileBehavior": {}, 1388 "_postman_isSubFolder": true 1389 }, 1390 { 1391 "name": "Start Pending Session", 1392 "item": [ 1393 { 1394 "name": "Start Session", 1395 "event": [ 1396 { 1397 "listen": "test", 1398 "script": { 1399 "id": "f66408d5-5438-4d4f-9bfc-6d24b15e5a90", 1400 "exec": [ 1401 "pm.test(\"Status code is 200\", function () {", 1402 " pm.response.to.have.status(200);", 1403 "});" 1404 ], 1405 "type": "text/javascript" 1406 } 1407 } 1408 ], 1409 "request": { 1410 "method": "POST", 1411 "header": [], 1412 "url": { 1413 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 1414 "protocol": "{{protocol}}", 1415 "host": [ 1416 "{{host}}" 1417 ], 1418 "port": "{{port}}", 1419 "path": [ 1420 "{{web_root}}", 1421 "api", 1422 "sessions", 1423 "{{session_token}}", 1424 "start" 1425 ] 1426 } 1427 }, 1428 "response": [] 1429 }, 1430 { 1431 "name": "Read Session Status", 1432 "event": [ 1433 { 1434 "listen": "test", 1435 "script": { 1436 "id": "bae5542d-446b-4064-88ff-cc355a8f4f62", 1437 "exec": [ 1438 "pm.test(\"Status code is 200\", function () {", 1439 " pm.response.to.have.status(200);", 1440 "});", 1441 "", 1442 "var jsonData = pm.response.json();", 1443 "pm.test(\"Status is running\", function () {", 1444 " pm.expect(jsonData.status).to.equal(\"running\");", 1445 "});", 1446 "", 1447 "pm.test(\"Start date is set\", function () {", 1448 " pm.expect(Date.parse(jsonData.date_started)).to.be.below(Date.now());", 1449 "});" 1450 ], 1451 "type": "text/javascript" 1452 } 1453 } 1454 ], 1455 "request": { 1456 "method": "GET", 1457 "header": [], 1458 "url": { 1459 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 1460 "protocol": "{{protocol}}", 1461 "host": [ 1462 "{{host}}" 1463 ], 1464 "port": "{{port}}", 1465 "path": [ 1466 "{{web_root}}", 1467 "api", 1468 "sessions", 1469 "{{session_token}}", 1470 "status" 1471 ] 1472 } 1473 }, 1474 "response": [] 1475 } 1476 ], 1477 "protocolProfileBehavior": {}, 1478 "_postman_isSubFolder": true 1479 }, 1480 { 1481 "name": "Start Running Session", 1482 "item": [ 1483 { 1484 "name": "Start Session", 1485 "event": [ 1486 { 1487 "listen": "test", 1488 "script": { 1489 "id": "3b386952-8a37-471a-9192-f28974d975a3", 1490 "exec": [ 1491 "pm.test(\"Status code is 200\", function () {", 1492 " pm.response.to.have.status(200);", 1493 "});" 1494 ], 1495 "type": "text/javascript" 1496 } 1497 } 1498 ], 1499 "request": { 1500 "method": "POST", 1501 "header": [], 1502 "url": { 1503 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 1504 "protocol": "{{protocol}}", 1505 "host": [ 1506 "{{host}}" 1507 ], 1508 "port": "{{port}}", 1509 "path": [ 1510 "{{web_root}}", 1511 "api", 1512 "sessions", 1513 "{{session_token}}", 1514 "start" 1515 ] 1516 } 1517 }, 1518 "response": [] 1519 }, 1520 { 1521 "name": "Read Session Status", 1522 "event": [ 1523 { 1524 "listen": "test", 1525 "script": { 1526 "id": "8e56d842-325b-4356-ae1a-2465e9efe188", 1527 "exec": [ 1528 "pm.test(\"Status code is 200\", function () {", 1529 " pm.response.to.have.status(200);", 1530 "});", 1531 "", 1532 "pm.test(\"Status is running\", function () {", 1533 " var jsonData = pm.response.json();", 1534 " pm.expect(jsonData.status).to.equal(\"running\");", 1535 "});" 1536 ], 1537 "type": "text/javascript" 1538 } 1539 } 1540 ], 1541 "request": { 1542 "method": "GET", 1543 "header": [], 1544 "url": { 1545 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 1546 "protocol": "{{protocol}}", 1547 "host": [ 1548 "{{host}}" 1549 ], 1550 "port": "{{port}}", 1551 "path": [ 1552 "{{web_root}}", 1553 "api", 1554 "sessions", 1555 "{{session_token}}", 1556 "status" 1557 ] 1558 } 1559 }, 1560 "response": [] 1561 } 1562 ], 1563 "protocolProfileBehavior": {}, 1564 "_postman_isSubFolder": true 1565 }, 1566 { 1567 "name": "Pause Running Session", 1568 "item": [ 1569 { 1570 "name": "Pause Session", 1571 "event": [ 1572 { 1573 "listen": "test", 1574 "script": { 1575 "id": "a183cb0b-31f0-48f6-9c20-605a16488d7d", 1576 "exec": [ 1577 "pm.test(\"Status code is 200\", function () {", 1578 " pm.response.to.have.status(200);", 1579 "});" 1580 ], 1581 "type": "text/javascript" 1582 } 1583 } 1584 ], 1585 "request": { 1586 "method": "POST", 1587 "header": [], 1588 "url": { 1589 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", 1590 "protocol": "{{protocol}}", 1591 "host": [ 1592 "{{host}}" 1593 ], 1594 "port": "{{port}}", 1595 "path": [ 1596 "{{web_root}}", 1597 "api", 1598 "sessions", 1599 "{{session_token}}", 1600 "pause" 1601 ] 1602 } 1603 }, 1604 "response": [] 1605 }, 1606 { 1607 "name": "Read Session Status", 1608 "event": [ 1609 { 1610 "listen": "test", 1611 "script": { 1612 "id": "f2610594-813a-4079-afae-1510486efab4", 1613 "exec": [ 1614 "pm.test(\"Status code is 200\", function () {", 1615 " pm.response.to.have.status(200);", 1616 "});", 1617 "", 1618 "pm.test(\"Status is paused\", function () {", 1619 " var jsonData = pm.response.json();", 1620 " pm.expect(jsonData.status).to.equal(\"paused\");", 1621 "});" 1622 ], 1623 "type": "text/javascript" 1624 } 1625 } 1626 ], 1627 "request": { 1628 "method": "GET", 1629 "header": [], 1630 "url": { 1631 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 1632 "protocol": "{{protocol}}", 1633 "host": [ 1634 "{{host}}" 1635 ], 1636 "port": "{{port}}", 1637 "path": [ 1638 "{{web_root}}", 1639 "api", 1640 "sessions", 1641 "{{session_token}}", 1642 "status" 1643 ] 1644 } 1645 }, 1646 "response": [] 1647 } 1648 ], 1649 "protocolProfileBehavior": {}, 1650 "_postman_isSubFolder": true 1651 }, 1652 { 1653 "name": "Pause Paused Session", 1654 "item": [ 1655 { 1656 "name": "Pause Session", 1657 "event": [ 1658 { 1659 "listen": "test", 1660 "script": { 1661 "id": "6b8ec98a-ad91-4d5c-aa07-6b3cc1255902", 1662 "exec": [ 1663 "pm.test(\"Status code is 200\", function () {", 1664 " pm.response.to.have.status(200);", 1665 "});" 1666 ], 1667 "type": "text/javascript" 1668 } 1669 } 1670 ], 1671 "request": { 1672 "method": "POST", 1673 "header": [], 1674 "url": { 1675 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", 1676 "protocol": "{{protocol}}", 1677 "host": [ 1678 "{{host}}" 1679 ], 1680 "port": "{{port}}", 1681 "path": [ 1682 "{{web_root}}", 1683 "api", 1684 "sessions", 1685 "{{session_token}}", 1686 "pause" 1687 ] 1688 } 1689 }, 1690 "response": [] 1691 }, 1692 { 1693 "name": "Read Session Status", 1694 "event": [ 1695 { 1696 "listen": "test", 1697 "script": { 1698 "id": "91a38eb8-a501-457f-a9f4-b63221c957f6", 1699 "exec": [ 1700 "pm.test(\"Status code is 200\", function () {", 1701 " pm.response.to.have.status(200);", 1702 "});", 1703 "", 1704 "pm.test(\"Status is paused\", function () {", 1705 " var jsonData = pm.response.json();", 1706 " pm.expect(jsonData.status).to.equal(\"paused\");", 1707 "});" 1708 ], 1709 "type": "text/javascript" 1710 } 1711 } 1712 ], 1713 "request": { 1714 "method": "GET", 1715 "header": [], 1716 "url": { 1717 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 1718 "protocol": "{{protocol}}", 1719 "host": [ 1720 "{{host}}" 1721 ], 1722 "port": "{{port}}", 1723 "path": [ 1724 "{{web_root}}", 1725 "api", 1726 "sessions", 1727 "{{session_token}}", 1728 "status" 1729 ] 1730 } 1731 }, 1732 "response": [] 1733 } 1734 ], 1735 "protocolProfileBehavior": {}, 1736 "_postman_isSubFolder": true 1737 }, 1738 { 1739 "name": "Start Paused Session", 1740 "item": [ 1741 { 1742 "name": "Start Session", 1743 "event": [ 1744 { 1745 "listen": "test", 1746 "script": { 1747 "id": "6e3a8c64-04cb-4c4f-b23d-64655f6e4d22", 1748 "exec": [ 1749 "pm.test(\"Status code is 200\", function () {", 1750 " pm.response.to.have.status(200);", 1751 "});" 1752 ], 1753 "type": "text/javascript" 1754 } 1755 } 1756 ], 1757 "request": { 1758 "method": "POST", 1759 "header": [], 1760 "url": { 1761 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 1762 "protocol": "{{protocol}}", 1763 "host": [ 1764 "{{host}}" 1765 ], 1766 "port": "{{port}}", 1767 "path": [ 1768 "{{web_root}}", 1769 "api", 1770 "sessions", 1771 "{{session_token}}", 1772 "start" 1773 ] 1774 } 1775 }, 1776 "response": [] 1777 }, 1778 { 1779 "name": "Read Session Status", 1780 "event": [ 1781 { 1782 "listen": "test", 1783 "script": { 1784 "id": "dcf7f6f4-6eef-4a90-a63d-df70446eb209", 1785 "exec": [ 1786 "pm.test(\"Status code is 200\", function () {", 1787 " pm.response.to.have.status(200);", 1788 "});", 1789 "", 1790 "pm.test(\"Status is running\", function () {", 1791 " var jsonData = pm.response.json();", 1792 " pm.expect(jsonData.status).to.equal(\"running\");", 1793 "});" 1794 ], 1795 "type": "text/javascript" 1796 } 1797 } 1798 ], 1799 "request": { 1800 "method": "GET", 1801 "header": [], 1802 "url": { 1803 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 1804 "protocol": "{{protocol}}", 1805 "host": [ 1806 "{{host}}" 1807 ], 1808 "port": "{{port}}", 1809 "path": [ 1810 "{{web_root}}", 1811 "api", 1812 "sessions", 1813 "{{session_token}}", 1814 "status" 1815 ] 1816 } 1817 }, 1818 "response": [] 1819 } 1820 ], 1821 "protocolProfileBehavior": {}, 1822 "_postman_isSubFolder": true 1823 }, 1824 { 1825 "name": "Stop Running Session", 1826 "item": [ 1827 { 1828 "name": "Stop Session", 1829 "event": [ 1830 { 1831 "listen": "test", 1832 "script": { 1833 "id": "bee7a70d-af1f-4ad1-9c40-7abdbcc983ae", 1834 "exec": [ 1835 "pm.test(\"Status code is 200\", function () {", 1836 " pm.response.to.have.status(200);", 1837 "});" 1838 ], 1839 "type": "text/javascript" 1840 } 1841 } 1842 ], 1843 "request": { 1844 "method": "POST", 1845 "header": [], 1846 "url": { 1847 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", 1848 "protocol": "{{protocol}}", 1849 "host": [ 1850 "{{host}}" 1851 ], 1852 "port": "{{port}}", 1853 "path": [ 1854 "{{web_root}}", 1855 "api", 1856 "sessions", 1857 "{{session_token}}", 1858 "stop" 1859 ] 1860 } 1861 }, 1862 "response": [] 1863 }, 1864 { 1865 "name": "Read Session Status", 1866 "event": [ 1867 { 1868 "listen": "test", 1869 "script": { 1870 "id": "217ed267-1ddb-496a-a7c5-6e29bad97c60", 1871 "exec": [ 1872 "pm.test(\"Status code is 200\", function () {", 1873 " pm.response.to.have.status(200);", 1874 "});", 1875 "", 1876 "var jsonData = pm.response.json();", 1877 "pm.test(\"Status is aborted\", function () {", 1878 " pm.expect(jsonData.status).to.equal(\"aborted\");", 1879 "});", 1880 "", 1881 "pm.test(\"Finish date is set\", function () {", 1882 " pm.expect(Date.parse(jsonData.date_finished)).to.be.below(Date.now());", 1883 "});" 1884 ], 1885 "type": "text/javascript" 1886 } 1887 } 1888 ], 1889 "request": { 1890 "method": "GET", 1891 "header": [], 1892 "url": { 1893 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 1894 "protocol": "{{protocol}}", 1895 "host": [ 1896 "{{host}}" 1897 ], 1898 "port": "{{port}}", 1899 "path": [ 1900 "{{web_root}}", 1901 "api", 1902 "sessions", 1903 "{{session_token}}", 1904 "status" 1905 ] 1906 } 1907 }, 1908 "response": [] 1909 } 1910 ], 1911 "protocolProfileBehavior": {}, 1912 "_postman_isSubFolder": true 1913 }, 1914 { 1915 "name": "Stop Aborted Session", 1916 "item": [ 1917 { 1918 "name": "Stop Session", 1919 "event": [ 1920 { 1921 "listen": "test", 1922 "script": { 1923 "id": "a255ea61-5c5a-4f0d-8a67-c244510a608c", 1924 "exec": [ 1925 "pm.test(\"Status code is 200\", function () {", 1926 " pm.response.to.have.status(200);", 1927 "});" 1928 ], 1929 "type": "text/javascript" 1930 } 1931 } 1932 ], 1933 "request": { 1934 "method": "POST", 1935 "header": [], 1936 "url": { 1937 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", 1938 "protocol": "{{protocol}}", 1939 "host": [ 1940 "{{host}}" 1941 ], 1942 "port": "{{port}}", 1943 "path": [ 1944 "{{web_root}}", 1945 "api", 1946 "sessions", 1947 "{{session_token}}", 1948 "stop" 1949 ] 1950 } 1951 }, 1952 "response": [] 1953 }, 1954 { 1955 "name": "Read Session Status", 1956 "event": [ 1957 { 1958 "listen": "test", 1959 "script": { 1960 "id": "9cc7599b-d378-4b04-bada-9d76f6ca610f", 1961 "exec": [ 1962 "pm.test(\"Status code is 200\", function () {", 1963 " pm.response.to.have.status(200);", 1964 "});", 1965 "", 1966 "pm.test(\"Status is aborted\", function () {", 1967 " var jsonData = pm.response.json();", 1968 " pm.expect(jsonData.status).to.equal(\"aborted\");", 1969 "});" 1970 ], 1971 "type": "text/javascript" 1972 } 1973 } 1974 ], 1975 "request": { 1976 "method": "GET", 1977 "header": [], 1978 "url": { 1979 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 1980 "protocol": "{{protocol}}", 1981 "host": [ 1982 "{{host}}" 1983 ], 1984 "port": "{{port}}", 1985 "path": [ 1986 "{{web_root}}", 1987 "api", 1988 "sessions", 1989 "{{session_token}}", 1990 "status" 1991 ] 1992 } 1993 }, 1994 "response": [] 1995 } 1996 ], 1997 "event": [ 1998 { 1999 "listen": "prerequest", 2000 "script": { 2001 "id": "81e44e3f-5d91-42a7-b0ab-4704eb121868", 2002 "type": "text/javascript", 2003 "exec": [ 2004 "" 2005 ] 2006 } 2007 }, 2008 { 2009 "listen": "test", 2010 "script": { 2011 "id": "a44180cb-3b13-421b-b146-82901f2b45bd", 2012 "type": "text/javascript", 2013 "exec": [ 2014 "" 2015 ] 2016 } 2017 } 2018 ], 2019 "protocolProfileBehavior": {}, 2020 "_postman_isSubFolder": true 2021 }, 2022 { 2023 "name": "Start Aborted Session", 2024 "item": [ 2025 { 2026 "name": "Start Session", 2027 "event": [ 2028 { 2029 "listen": "test", 2030 "script": { 2031 "id": "47fb1fa9-4849-4ea9-b36e-fcec8decf62e", 2032 "exec": [ 2033 "pm.test(\"Status code is 200\", function () {", 2034 " pm.response.to.have.status(200);", 2035 "});" 2036 ], 2037 "type": "text/javascript" 2038 } 2039 } 2040 ], 2041 "request": { 2042 "method": "POST", 2043 "header": [], 2044 "url": { 2045 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 2046 "protocol": "{{protocol}}", 2047 "host": [ 2048 "{{host}}" 2049 ], 2050 "port": "{{port}}", 2051 "path": [ 2052 "{{web_root}}", 2053 "api", 2054 "sessions", 2055 "{{session_token}}", 2056 "start" 2057 ] 2058 } 2059 }, 2060 "response": [] 2061 }, 2062 { 2063 "name": "Read Session Status", 2064 "event": [ 2065 { 2066 "listen": "test", 2067 "script": { 2068 "id": "1923ced4-4361-4a4a-bf7c-4fcdf3df50f6", 2069 "exec": [ 2070 "pm.test(\"Status code is 200\", function () {", 2071 " pm.response.to.have.status(200);", 2072 "});", 2073 "", 2074 "pm.test(\"Status is aborted\", function () {", 2075 " var jsonData = pm.response.json();", 2076 " pm.expect(jsonData.status).to.equal(\"aborted\");", 2077 "});" 2078 ], 2079 "type": "text/javascript" 2080 } 2081 } 2082 ], 2083 "request": { 2084 "method": "GET", 2085 "header": [], 2086 "url": { 2087 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 2088 "protocol": "{{protocol}}", 2089 "host": [ 2090 "{{host}}" 2091 ], 2092 "port": "{{port}}", 2093 "path": [ 2094 "{{web_root}}", 2095 "api", 2096 "sessions", 2097 "{{session_token}}", 2098 "status" 2099 ] 2100 } 2101 }, 2102 "response": [] 2103 } 2104 ], 2105 "event": [ 2106 { 2107 "listen": "prerequest", 2108 "script": { 2109 "id": "226043e5-1a81-4d36-aa7f-67b10bf407af", 2110 "type": "text/javascript", 2111 "exec": [ 2112 "" 2113 ] 2114 } 2115 }, 2116 { 2117 "listen": "test", 2118 "script": { 2119 "id": "840bf970-0984-452e-9076-b6f66d0b4511", 2120 "type": "text/javascript", 2121 "exec": [ 2122 "" 2123 ] 2124 } 2125 } 2126 ], 2127 "protocolProfileBehavior": {}, 2128 "_postman_isSubFolder": true 2129 }, 2130 { 2131 "name": "Pause Aborted Session", 2132 "item": [ 2133 { 2134 "name": "Pause Session", 2135 "event": [ 2136 { 2137 "listen": "test", 2138 "script": { 2139 "id": "88c4072f-538b-4d68-9d61-f0fb017e544c", 2140 "exec": [ 2141 "pm.test(\"Status code is 200\", function () {", 2142 " pm.response.to.have.status(200);", 2143 "});" 2144 ], 2145 "type": "text/javascript" 2146 } 2147 } 2148 ], 2149 "request": { 2150 "method": "POST", 2151 "header": [], 2152 "url": { 2153 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", 2154 "protocol": "{{protocol}}", 2155 "host": [ 2156 "{{host}}" 2157 ], 2158 "port": "{{port}}", 2159 "path": [ 2160 "{{web_root}}", 2161 "api", 2162 "sessions", 2163 "{{session_token}}", 2164 "pause" 2165 ] 2166 } 2167 }, 2168 "response": [] 2169 }, 2170 { 2171 "name": "Read Session Status", 2172 "event": [ 2173 { 2174 "listen": "test", 2175 "script": { 2176 "id": "2ae00eb3-49e8-4487-b27f-e7c7955fe4f4", 2177 "exec": [ 2178 "pm.test(\"Status code is 200\", function () {", 2179 " pm.response.to.have.status(200);", 2180 "});", 2181 "", 2182 "pm.test(\"Status is aborted\", function () {", 2183 " var jsonData = pm.response.json();", 2184 " pm.expect(jsonData.status).to.equal(\"aborted\");", 2185 "});" 2186 ], 2187 "type": "text/javascript" 2188 } 2189 } 2190 ], 2191 "request": { 2192 "method": "GET", 2193 "header": [], 2194 "url": { 2195 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 2196 "protocol": "{{protocol}}", 2197 "host": [ 2198 "{{host}}" 2199 ], 2200 "port": "{{port}}", 2201 "path": [ 2202 "{{web_root}}", 2203 "api", 2204 "sessions", 2205 "{{session_token}}", 2206 "status" 2207 ] 2208 } 2209 }, 2210 "response": [] 2211 } 2212 ], 2213 "event": [ 2214 { 2215 "listen": "prerequest", 2216 "script": { 2217 "id": "70e0c783-c405-481c-b9c8-5c8bee392f97", 2218 "type": "text/javascript", 2219 "exec": [ 2220 "" 2221 ] 2222 } 2223 }, 2224 { 2225 "listen": "test", 2226 "script": { 2227 "id": "85c45e3b-fae6-4a90-afd0-97678769e32c", 2228 "type": "text/javascript", 2229 "exec": [ 2230 "" 2231 ] 2232 } 2233 } 2234 ], 2235 "protocolProfileBehavior": {}, 2236 "_postman_isSubFolder": true 2237 }, 2238 { 2239 "name": "Setup", 2240 "item": [ 2241 { 2242 "name": "Clean Up", 2243 "request": { 2244 "method": "DELETE", 2245 "header": [], 2246 "url": { 2247 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 2248 "protocol": "{{protocol}}", 2249 "host": [ 2250 "{{host}}" 2251 ], 2252 "port": "{{port}}", 2253 "path": [ 2254 "{{web_root}}", 2255 "api", 2256 "sessions", 2257 "{{session_token}}" 2258 ] 2259 } 2260 }, 2261 "response": [] 2262 }, 2263 { 2264 "name": "Create Session No Configuration", 2265 "event": [ 2266 { 2267 "listen": "test", 2268 "script": { 2269 "id": "df4a00d1-d4f8-4b0b-892d-21528165a2cf", 2270 "exec": [ 2271 "pm.test(\"Status code is 200\", function () {", 2272 " pm.response.to.have.status(200);", 2273 "});", 2274 "", 2275 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 2276 "", 2277 "pm.test(\"Responds with token in JSON format\", function () {", 2278 " var jsonData = pm.response.json();", 2279 " pm.expect(jsonData).to.have.property(\"token\");", 2280 " pm.expect(jsonData.token).to.match(tokenRegex);", 2281 "});", 2282 "", 2283 "", 2284 "const response = pm.response.json();", 2285 "const token = response.token;", 2286 "pm.globals.set(\"session_token\", token);" 2287 ], 2288 "type": "text/javascript" 2289 } 2290 } 2291 ], 2292 "request": { 2293 "method": "POST", 2294 "header": [ 2295 { 2296 "key": "Content-Type", 2297 "name": "Content-Type", 2298 "type": "text", 2299 "value": "application/json" 2300 } 2301 ], 2302 "body": { 2303 "mode": "raw", 2304 "raw": "" 2305 }, 2306 "url": { 2307 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 2308 "protocol": "{{protocol}}", 2309 "host": [ 2310 "{{host}}" 2311 ], 2312 "port": "{{port}}", 2313 "path": [ 2314 "{{web_root}}", 2315 "api", 2316 "sessions" 2317 ] 2318 } 2319 }, 2320 "response": [] 2321 } 2322 ], 2323 "event": [ 2324 { 2325 "listen": "prerequest", 2326 "script": { 2327 "id": "4fa59617-c922-4826-abc6-6d910e918ea4", 2328 "type": "text/javascript", 2329 "exec": [ 2330 "" 2331 ] 2332 } 2333 }, 2334 { 2335 "listen": "test", 2336 "script": { 2337 "id": "d83f449d-4a2e-41c8-b2cd-5cf0cd1c404e", 2338 "type": "text/javascript", 2339 "exec": [ 2340 "" 2341 ] 2342 } 2343 } 2344 ], 2345 "protocolProfileBehavior": {}, 2346 "_postman_isSubFolder": true 2347 }, 2348 { 2349 "name": "Stop Pending Session", 2350 "item": [ 2351 { 2352 "name": "Stop Session", 2353 "event": [ 2354 { 2355 "listen": "test", 2356 "script": { 2357 "id": "98da2b86-4f9f-47dd-afc9-22ce96e73e84", 2358 "exec": [ 2359 "pm.test(\"Status code is 200\", function () {", 2360 " pm.response.to.have.status(200);", 2361 "});" 2362 ], 2363 "type": "text/javascript" 2364 } 2365 } 2366 ], 2367 "request": { 2368 "method": "POST", 2369 "header": [], 2370 "url": { 2371 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", 2372 "protocol": "{{protocol}}", 2373 "host": [ 2374 "{{host}}" 2375 ], 2376 "port": "{{port}}", 2377 "path": [ 2378 "{{web_root}}", 2379 "api", 2380 "sessions", 2381 "{{session_token}}", 2382 "stop" 2383 ] 2384 } 2385 }, 2386 "response": [] 2387 }, 2388 { 2389 "name": "Read Session Status", 2390 "event": [ 2391 { 2392 "listen": "test", 2393 "script": { 2394 "id": "6d8a8202-c85d-4ada-b443-45108a372aea", 2395 "exec": [ 2396 "pm.test(\"Status code is 200\", function () {", 2397 " pm.response.to.have.status(200);", 2398 "});", 2399 "", 2400 "pm.test(\"Status is aborted\", function () {", 2401 " var jsonData = pm.response.json();", 2402 " pm.expect(jsonData.status).to.equal(\"aborted\");", 2403 "});" 2404 ], 2405 "type": "text/javascript" 2406 } 2407 } 2408 ], 2409 "request": { 2410 "method": "GET", 2411 "header": [], 2412 "url": { 2413 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 2414 "protocol": "{{protocol}}", 2415 "host": [ 2416 "{{host}}" 2417 ], 2418 "port": "{{port}}", 2419 "path": [ 2420 "{{web_root}}", 2421 "api", 2422 "sessions", 2423 "{{session_token}}", 2424 "status" 2425 ] 2426 } 2427 }, 2428 "response": [] 2429 } 2430 ], 2431 "protocolProfileBehavior": {}, 2432 "_postman_isSubFolder": true 2433 }, 2434 { 2435 "name": "Setup", 2436 "item": [ 2437 { 2438 "name": "Clean Up", 2439 "request": { 2440 "method": "DELETE", 2441 "header": [], 2442 "url": { 2443 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 2444 "protocol": "{{protocol}}", 2445 "host": [ 2446 "{{host}}" 2447 ], 2448 "port": "{{port}}", 2449 "path": [ 2450 "{{web_root}}", 2451 "api", 2452 "sessions", 2453 "{{session_token}}" 2454 ] 2455 } 2456 }, 2457 "response": [] 2458 }, 2459 { 2460 "name": "Create Session No Configuration", 2461 "event": [ 2462 { 2463 "listen": "test", 2464 "script": { 2465 "id": "0f9df486-91cd-46fc-a711-5cf9bebb2706", 2466 "exec": [ 2467 "pm.test(\"Status code is 200\", function () {", 2468 " pm.response.to.have.status(200);", 2469 "});", 2470 "", 2471 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 2472 "", 2473 "pm.test(\"Responds with token in JSON format\", function () {", 2474 " var jsonData = pm.response.json();", 2475 " pm.expect(jsonData).to.have.property(\"token\");", 2476 " pm.expect(jsonData.token).to.match(tokenRegex);", 2477 "});", 2478 "", 2479 "", 2480 "const response = pm.response.json();", 2481 "const token = response.token;", 2482 "pm.globals.set(\"session_token\", token);" 2483 ], 2484 "type": "text/javascript" 2485 } 2486 } 2487 ], 2488 "request": { 2489 "method": "POST", 2490 "header": [ 2491 { 2492 "key": "Content-Type", 2493 "name": "Content-Type", 2494 "type": "text", 2495 "value": "application/json" 2496 } 2497 ], 2498 "body": { 2499 "mode": "raw", 2500 "raw": "" 2501 }, 2502 "url": { 2503 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 2504 "protocol": "{{protocol}}", 2505 "host": [ 2506 "{{host}}" 2507 ], 2508 "port": "{{port}}", 2509 "path": [ 2510 "{{web_root}}", 2511 "api", 2512 "sessions" 2513 ] 2514 } 2515 }, 2516 "response": [] 2517 }, 2518 { 2519 "name": "Start Session", 2520 "event": [ 2521 { 2522 "listen": "test", 2523 "script": { 2524 "id": "80ee91fd-98ca-4b8e-83b6-32bf3e55a295", 2525 "exec": [ 2526 "" 2527 ], 2528 "type": "text/javascript" 2529 } 2530 } 2531 ], 2532 "request": { 2533 "method": "POST", 2534 "header": [], 2535 "url": { 2536 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 2537 "protocol": "{{protocol}}", 2538 "host": [ 2539 "{{host}}" 2540 ], 2541 "port": "{{port}}", 2542 "path": [ 2543 "{{web_root}}", 2544 "api", 2545 "sessions", 2546 "{{session_token}}", 2547 "start" 2548 ] 2549 } 2550 }, 2551 "response": [] 2552 }, 2553 { 2554 "name": "Pause Session", 2555 "event": [ 2556 { 2557 "listen": "test", 2558 "script": { 2559 "id": "47f4d26a-84c2-4980-984d-dac0e95503e1", 2560 "exec": [ 2561 "" 2562 ], 2563 "type": "text/javascript" 2564 } 2565 } 2566 ], 2567 "request": { 2568 "method": "POST", 2569 "header": [], 2570 "url": { 2571 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", 2572 "protocol": "{{protocol}}", 2573 "host": [ 2574 "{{host}}" 2575 ], 2576 "port": "{{port}}", 2577 "path": [ 2578 "{{web_root}}", 2579 "api", 2580 "sessions", 2581 "{{session_token}}", 2582 "pause" 2583 ] 2584 } 2585 }, 2586 "response": [] 2587 } 2588 ], 2589 "event": [ 2590 { 2591 "listen": "prerequest", 2592 "script": { 2593 "id": "6bd9e85f-eb73-47be-83b0-01be77868899", 2594 "type": "text/javascript", 2595 "exec": [ 2596 "" 2597 ] 2598 } 2599 }, 2600 { 2601 "listen": "test", 2602 "script": { 2603 "id": "43ebfadb-dc68-4c41-b34e-462e427dc2ef", 2604 "type": "text/javascript", 2605 "exec": [ 2606 "" 2607 ] 2608 } 2609 } 2610 ], 2611 "protocolProfileBehavior": {}, 2612 "_postman_isSubFolder": true 2613 }, 2614 { 2615 "name": "Stop Paused Session Copy", 2616 "item": [ 2617 { 2618 "name": "Stop Session", 2619 "event": [ 2620 { 2621 "listen": "test", 2622 "script": { 2623 "id": "029ec84b-e41b-4744-8745-58c50e52bb11", 2624 "exec": [ 2625 "pm.test(\"Status code is 200\", function () {", 2626 " pm.response.to.have.status(200);", 2627 "});" 2628 ], 2629 "type": "text/javascript" 2630 } 2631 } 2632 ], 2633 "request": { 2634 "method": "POST", 2635 "header": [], 2636 "url": { 2637 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", 2638 "protocol": "{{protocol}}", 2639 "host": [ 2640 "{{host}}" 2641 ], 2642 "port": "{{port}}", 2643 "path": [ 2644 "{{web_root}}", 2645 "api", 2646 "sessions", 2647 "{{session_token}}", 2648 "stop" 2649 ] 2650 } 2651 }, 2652 "response": [] 2653 }, 2654 { 2655 "name": "Read Session Status", 2656 "event": [ 2657 { 2658 "listen": "test", 2659 "script": { 2660 "id": "071d757c-41aa-4b52-9ab4-6c2afd6ed2af", 2661 "exec": [ 2662 "pm.test(\"Status code is 200\", function () {", 2663 " pm.response.to.have.status(200);", 2664 "});", 2665 "", 2666 "pm.test(\"Status is aborted\", function () {", 2667 " var jsonData = pm.response.json();", 2668 " pm.expect(jsonData.status).to.equal(\"aborted\");", 2669 "});" 2670 ], 2671 "type": "text/javascript" 2672 } 2673 } 2674 ], 2675 "request": { 2676 "method": "GET", 2677 "header": [], 2678 "url": { 2679 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 2680 "protocol": "{{protocol}}", 2681 "host": [ 2682 "{{host}}" 2683 ], 2684 "port": "{{port}}", 2685 "path": [ 2686 "{{web_root}}", 2687 "api", 2688 "sessions", 2689 "{{session_token}}", 2690 "status" 2691 ] 2692 } 2693 }, 2694 "response": [] 2695 } 2696 ], 2697 "event": [ 2698 { 2699 "listen": "prerequest", 2700 "script": { 2701 "id": "305720a0-2c84-43d3-8fe5-55f8fdf511d8", 2702 "type": "text/javascript", 2703 "exec": [ 2704 "" 2705 ] 2706 } 2707 }, 2708 { 2709 "listen": "test", 2710 "script": { 2711 "id": "84e4ab04-5acc-4428-a81a-c0b0c53b5fd9", 2712 "type": "text/javascript", 2713 "exec": [ 2714 "" 2715 ] 2716 } 2717 } 2718 ], 2719 "protocolProfileBehavior": {}, 2720 "_postman_isSubFolder": true 2721 }, 2722 { 2723 "name": "Setup", 2724 "item": [ 2725 { 2726 "name": "Clean Up", 2727 "request": { 2728 "method": "DELETE", 2729 "header": [], 2730 "url": { 2731 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 2732 "protocol": "{{protocol}}", 2733 "host": [ 2734 "{{host}}" 2735 ], 2736 "port": "{{port}}", 2737 "path": [ 2738 "{{web_root}}", 2739 "api", 2740 "sessions", 2741 "{{session_token}}" 2742 ] 2743 } 2744 }, 2745 "response": [] 2746 }, 2747 { 2748 "name": "Create Session One Test", 2749 "event": [ 2750 { 2751 "listen": "test", 2752 "script": { 2753 "id": "b7a9d459-9b39-40b2-abdc-fd8fe8b21d61", 2754 "exec": [ 2755 "pm.test(\"Status code is 200\", function () {", 2756 " pm.response.to.have.status(200);", 2757 "});", 2758 "", 2759 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 2760 "", 2761 "pm.test(\"Responds with token in JSON format\", function () {", 2762 " var jsonData = pm.response.json();", 2763 " pm.expect(jsonData).to.have.property(\"token\");", 2764 " pm.expect(jsonData.token).to.match(tokenRegex);", 2765 "});", 2766 "", 2767 "", 2768 "const response = pm.response.json();", 2769 "const token = response.token;", 2770 "pm.globals.set(\"session_token\", token);" 2771 ], 2772 "type": "text/javascript" 2773 } 2774 }, 2775 { 2776 "listen": "prerequest", 2777 "script": { 2778 "id": "fcbfb0e3-a10d-4ff8-afed-f5f3c9d52090", 2779 "exec": [ 2780 "const availableTests = JSON.parse(pm.globals.get(\"available_tests\"));", 2781 "const test = availableTests[Object.keys(availableTests)[0]][0]", 2782 "", 2783 "pm.globals.set(\"single_test\", test);" 2784 ], 2785 "type": "text/javascript" 2786 } 2787 } 2788 ], 2789 "request": { 2790 "method": "POST", 2791 "header": [ 2792 { 2793 "key": "Content-Type", 2794 "name": "Content-Type", 2795 "type": "text", 2796 "value": "application/json" 2797 } 2798 ], 2799 "body": { 2800 "mode": "raw", 2801 "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test}}\"]\n }\n}" 2802 }, 2803 "url": { 2804 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 2805 "protocol": "{{protocol}}", 2806 "host": [ 2807 "{{host}}" 2808 ], 2809 "port": "{{port}}", 2810 "path": [ 2811 "{{web_root}}", 2812 "api", 2813 "sessions" 2814 ] 2815 } 2816 }, 2817 "response": [] 2818 }, 2819 { 2820 "name": "Start Session", 2821 "event": [ 2822 { 2823 "listen": "test", 2824 "script": { 2825 "id": "937ef61d-d6d6-4e24-bc3a-696a23cc95d6", 2826 "exec": [ 2827 "" 2828 ], 2829 "type": "text/javascript" 2830 } 2831 } 2832 ], 2833 "request": { 2834 "method": "POST", 2835 "header": [], 2836 "url": { 2837 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 2838 "protocol": "{{protocol}}", 2839 "host": [ 2840 "{{host}}" 2841 ], 2842 "port": "{{port}}", 2843 "path": [ 2844 "{{web_root}}", 2845 "api", 2846 "sessions", 2847 "{{session_token}}", 2848 "start" 2849 ] 2850 } 2851 }, 2852 "response": [] 2853 }, 2854 { 2855 "name": "Read Next Test of Session", 2856 "event": [ 2857 { 2858 "listen": "test", 2859 "script": { 2860 "id": "29f0554b-66f5-4e26-80ff-39b3faba920a", 2861 "exec": [ 2862 "const response = pm.response.json();", 2863 "const nextTest = response.next_test;", 2864 "pm.globals.set(\"current_test_url\", nextTest);", 2865 "if (!nextTest) return;", 2866 "const parameters = nextTest.split(\"?\")[1].split(\"&\");", 2867 "let test = parameters.find(parameter => parameter.split(\"=\")[0] === \"test_url\").split(\"=\")[1];", 2868 "test = decodeURIComponent(test);", 2869 "test = \"/\" + test.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 2870 "pm.globals.set(\"current_test\", test);" 2871 ], 2872 "type": "text/javascript" 2873 } 2874 } 2875 ], 2876 "request": { 2877 "method": "GET", 2878 "header": [], 2879 "url": { 2880 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 2881 "protocol": "{{protocol}}", 2882 "host": [ 2883 "{{host}}" 2884 ], 2885 "port": "{{port}}", 2886 "path": [ 2887 "{{web_root}}", 2888 "api", 2889 "tests", 2890 "{{session_token}}", 2891 "next" 2892 ] 2893 } 2894 }, 2895 "response": [] 2896 }, 2897 { 2898 "name": "Create Result", 2899 "request": { 2900 "method": "POST", 2901 "header": [ 2902 { 2903 "key": "Content-Type", 2904 "name": "Content-Type", 2905 "value": "application/json", 2906 "type": "text" 2907 } 2908 ], 2909 "body": { 2910 "mode": "raw", 2911 "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" 2912 }, 2913 "url": { 2914 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 2915 "protocol": "{{protocol}}", 2916 "host": [ 2917 "{{host}}" 2918 ], 2919 "port": "{{port}}", 2920 "path": [ 2921 "{{web_root}}", 2922 "api", 2923 "results", 2924 "{{session_token}}" 2925 ] 2926 } 2927 }, 2928 "response": [] 2929 } 2930 ], 2931 "event": [ 2932 { 2933 "listen": "prerequest", 2934 "script": { 2935 "id": "9bf66427-6f39-4f0a-b065-1849d679eee6", 2936 "type": "text/javascript", 2937 "exec": [ 2938 "" 2939 ] 2940 } 2941 }, 2942 { 2943 "listen": "test", 2944 "script": { 2945 "id": "8d1f3837-1f05-47e4-897c-b7c74da9bd43", 2946 "type": "text/javascript", 2947 "exec": [ 2948 "" 2949 ] 2950 } 2951 } 2952 ], 2953 "protocolProfileBehavior": {}, 2954 "_postman_isSubFolder": true 2955 }, 2956 { 2957 "name": "Start Completed Session", 2958 "item": [ 2959 { 2960 "name": "Start Session", 2961 "event": [ 2962 { 2963 "listen": "test", 2964 "script": { 2965 "id": "9bf0fb70-24a0-4136-99fe-8e0e488afd1e", 2966 "exec": [ 2967 "pm.test(\"Status code is 200\", function () {", 2968 " pm.response.to.have.status(200);", 2969 "});" 2970 ], 2971 "type": "text/javascript" 2972 } 2973 } 2974 ], 2975 "request": { 2976 "method": "POST", 2977 "header": [], 2978 "url": { 2979 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 2980 "protocol": "{{protocol}}", 2981 "host": [ 2982 "{{host}}" 2983 ], 2984 "port": "{{port}}", 2985 "path": [ 2986 "{{web_root}}", 2987 "api", 2988 "sessions", 2989 "{{session_token}}", 2990 "start" 2991 ] 2992 } 2993 }, 2994 "response": [] 2995 }, 2996 { 2997 "name": "Read Session Status", 2998 "event": [ 2999 { 3000 "listen": "test", 3001 "script": { 3002 "id": "7e3184bf-1741-44c8-8cd3-cff30c2deca1", 3003 "exec": [ 3004 "pm.test(\"Status code is 200\", function () {", 3005 " pm.response.to.have.status(200);", 3006 "});", 3007 "", 3008 "pm.test(\"Status is completed\", function () {", 3009 " var jsonData = pm.response.json();", 3010 " pm.expect(jsonData.status).to.equal(\"completed\");", 3011 "});" 3012 ], 3013 "type": "text/javascript" 3014 } 3015 } 3016 ], 3017 "request": { 3018 "method": "GET", 3019 "header": [], 3020 "url": { 3021 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 3022 "protocol": "{{protocol}}", 3023 "host": [ 3024 "{{host}}" 3025 ], 3026 "port": "{{port}}", 3027 "path": [ 3028 "{{web_root}}", 3029 "api", 3030 "sessions", 3031 "{{session_token}}", 3032 "status" 3033 ] 3034 } 3035 }, 3036 "response": [] 3037 } 3038 ], 3039 "protocolProfileBehavior": {}, 3040 "_postman_isSubFolder": true 3041 }, 3042 { 3043 "name": "Pause Completed Session", 3044 "item": [ 3045 { 3046 "name": "Pause Session", 3047 "event": [ 3048 { 3049 "listen": "test", 3050 "script": { 3051 "id": "e323c6af-d4e5-4a05-b203-09ba67f77d28", 3052 "exec": [ 3053 "pm.test(\"Status code is 200\", function () {", 3054 " pm.response.to.have.status(200);", 3055 "});" 3056 ], 3057 "type": "text/javascript" 3058 } 3059 } 3060 ], 3061 "request": { 3062 "method": "POST", 3063 "header": [], 3064 "url": { 3065 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/pause", 3066 "protocol": "{{protocol}}", 3067 "host": [ 3068 "{{host}}" 3069 ], 3070 "port": "{{port}}", 3071 "path": [ 3072 "{{web_root}}", 3073 "api", 3074 "sessions", 3075 "{{session_token}}", 3076 "pause" 3077 ] 3078 } 3079 }, 3080 "response": [] 3081 }, 3082 { 3083 "name": "Read Session Status", 3084 "event": [ 3085 { 3086 "listen": "test", 3087 "script": { 3088 "id": "40cd04ce-850f-4903-bc24-2e62a4df98fe", 3089 "exec": [ 3090 "pm.test(\"Status code is 200\", function () {", 3091 " pm.response.to.have.status(200);", 3092 "});", 3093 "", 3094 "pm.test(\"Status is completed\", function () {", 3095 " var jsonData = pm.response.json();", 3096 " pm.expect(jsonData.status).to.equal(\"completed\");", 3097 "});" 3098 ], 3099 "type": "text/javascript" 3100 } 3101 } 3102 ], 3103 "request": { 3104 "method": "GET", 3105 "header": [], 3106 "url": { 3107 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 3108 "protocol": "{{protocol}}", 3109 "host": [ 3110 "{{host}}" 3111 ], 3112 "port": "{{port}}", 3113 "path": [ 3114 "{{web_root}}", 3115 "api", 3116 "sessions", 3117 "{{session_token}}", 3118 "status" 3119 ] 3120 } 3121 }, 3122 "response": [] 3123 } 3124 ], 3125 "protocolProfileBehavior": {}, 3126 "_postman_isSubFolder": true 3127 }, 3128 { 3129 "name": "Stop Completed Session", 3130 "item": [ 3131 { 3132 "name": "Stop Session", 3133 "event": [ 3134 { 3135 "listen": "test", 3136 "script": { 3137 "id": "db7d5209-37b2-46bd-88ab-ce4e241401b2", 3138 "exec": [ 3139 "pm.test(\"Status code is 200\", function () {", 3140 " pm.response.to.have.status(200);", 3141 "});" 3142 ], 3143 "type": "text/javascript" 3144 } 3145 } 3146 ], 3147 "request": { 3148 "method": "POST", 3149 "header": [], 3150 "url": { 3151 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/stop", 3152 "protocol": "{{protocol}}", 3153 "host": [ 3154 "{{host}}" 3155 ], 3156 "port": "{{port}}", 3157 "path": [ 3158 "{{web_root}}", 3159 "api", 3160 "sessions", 3161 "{{session_token}}", 3162 "stop" 3163 ] 3164 } 3165 }, 3166 "response": [] 3167 }, 3168 { 3169 "name": "Read Session Status", 3170 "event": [ 3171 { 3172 "listen": "test", 3173 "script": { 3174 "id": "477dc63d-0b43-4226-b86e-163e2de92b67", 3175 "exec": [ 3176 "pm.test(\"Status code is 200\", function () {", 3177 " pm.response.to.have.status(200);", 3178 "});", 3179 "", 3180 "pm.test(\"Status is completed\", function () {", 3181 " var jsonData = pm.response.json();", 3182 " pm.expect(jsonData.status).to.equal(\"completed\");", 3183 "});" 3184 ], 3185 "type": "text/javascript" 3186 } 3187 } 3188 ], 3189 "request": { 3190 "method": "GET", 3191 "header": [], 3192 "url": { 3193 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 3194 "protocol": "{{protocol}}", 3195 "host": [ 3196 "{{host}}" 3197 ], 3198 "port": "{{port}}", 3199 "path": [ 3200 "{{web_root}}", 3201 "api", 3202 "sessions", 3203 "{{session_token}}", 3204 "status" 3205 ] 3206 } 3207 }, 3208 "response": [] 3209 } 3210 ], 3211 "protocolProfileBehavior": {}, 3212 "_postman_isSubFolder": true 3213 }, 3214 { 3215 "name": "Clean Up", 3216 "item": [ 3217 { 3218 "name": "Clean Up", 3219 "request": { 3220 "method": "DELETE", 3221 "header": [], 3222 "url": { 3223 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 3224 "protocol": "{{protocol}}", 3225 "host": [ 3226 "{{host}}" 3227 ], 3228 "port": "{{port}}", 3229 "path": [ 3230 "{{web_root}}", 3231 "api", 3232 "sessions", 3233 "{{session_token}}" 3234 ] 3235 } 3236 }, 3237 "response": [] 3238 } 3239 ], 3240 "protocolProfileBehavior": {}, 3241 "_postman_isSubFolder": true 3242 } 3243 ], 3244 "protocolProfileBehavior": {} 3245 }, 3246 { 3247 "name": "Update and Read Sessions", 3248 "item": [ 3249 { 3250 "name": "Create Default", 3251 "item": [ 3252 { 3253 "name": "Create Session No Configuration", 3254 "event": [ 3255 { 3256 "listen": "test", 3257 "script": { 3258 "id": "b923d95e-a7b4-49d4-ab2a-1f435c454387", 3259 "exec": [ 3260 "pm.test(\"Status code is 200\", function () {", 3261 " pm.response.to.have.status(200);", 3262 "});", 3263 "", 3264 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 3265 "", 3266 "pm.test(\"Responds with token in JSON format\", function () {", 3267 " var jsonData = pm.response.json();", 3268 " pm.expect(jsonData).to.have.property(\"token\");", 3269 " pm.expect(jsonData.token).to.match(tokenRegex);", 3270 "});", 3271 "", 3272 "", 3273 "const response = pm.response.json();", 3274 "const token = response.token;", 3275 "pm.globals.set(\"session_token\", token);" 3276 ], 3277 "type": "text/javascript" 3278 } 3279 } 3280 ], 3281 "request": { 3282 "method": "POST", 3283 "header": [ 3284 { 3285 "key": "Content-Type", 3286 "name": "Content-Type", 3287 "type": "text", 3288 "value": "application/json" 3289 } 3290 ], 3291 "body": { 3292 "mode": "raw", 3293 "raw": "" 3294 }, 3295 "url": { 3296 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 3297 "protocol": "{{protocol}}", 3298 "host": [ 3299 "{{host}}" 3300 ], 3301 "port": "{{port}}", 3302 "path": [ 3303 "{{web_root}}", 3304 "api", 3305 "sessions" 3306 ] 3307 } 3308 }, 3309 "response": [] 3310 }, 3311 { 3312 "name": "Read Session Configuration", 3313 "event": [ 3314 { 3315 "listen": "test", 3316 "script": { 3317 "id": "81f36759-7ae2-42b9-81d2-79f57046b46e", 3318 "exec": [ 3319 "pm.test(\"Status code is 200\", function () {", 3320 " pm.response.to.have.status(200);", 3321 "});", 3322 "", 3323 "var jsonData = pm.response.json();", 3324 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 3325 "", 3326 "pm.test(\"JSON structure is as expected\", function () {", 3327 " pm.expect(jsonData).to.have.property(\"token\");", 3328 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 3329 " pm.expect(jsonData).to.have.property(\"tests\");", 3330 " pm.expect(typeof jsonData.tests).to.equal(\"object\");", 3331 " pm.expect(jsonData.tests).to.have.property(\"include\");", 3332 " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", 3333 " pm.expect(jsonData.tests).to.have.property(\"exclude\");", 3334 " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", 3335 " pm.expect(jsonData).to.have.property(\"types\");", 3336 " pm.expect(jsonData.types).to.be.an.instanceof(Array);", 3337 " pm.expect(jsonData).to.have.property(\"user_agent\");", 3338 " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", 3339 " pm.expect(jsonData).to.have.property(\"timeouts\");", 3340 " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", 3341 " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", 3342 " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", 3343 " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", 3344 " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", 3345 " pm.expect(jsonData).to.have.property(\"browser\");", 3346 " pm.expect(typeof jsonData.browser).to.equal(\"object\");", 3347 " pm.expect(jsonData.browser).to.have.property(\"name\");", 3348 " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", 3349 " pm.expect(jsonData.browser).to.have.property(\"version\");", 3350 " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", 3351 " pm.expect(jsonData).to.have.property(\"reference_tokens\");", 3352 " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", 3353 "});", 3354 "", 3355 "pm.test(\"Configuration is default\", function () {", 3356 " pm.expect(jsonData.token).to.match(tokenRegex);", 3357 " pm.expect(jsonData.tests.include).to.include(\"/\");", 3358 " pm.expect(jsonData.types).to.include(\"automatic\");", 3359 " pm.expect(jsonData.types).to.include(\"manual\");", 3360 " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", 3361 " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", 3362 " pm.expect(jsonData.timeouts.manual).to.equal(300000);", 3363 " pm.expect(jsonData.browser.name).to.equal(\"Other\");", 3364 " pm.expect(jsonData.browser.version).to.equal(\"0\");", 3365 " pm.expect(jsonData.is_public).to.equal(false);", 3366 " pm.expect(jsonData.reference_tokens).to.be.empty;", 3367 "});" 3368 ], 3369 "type": "text/javascript" 3370 } 3371 } 3372 ], 3373 "request": { 3374 "method": "GET", 3375 "header": [], 3376 "url": { 3377 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 3378 "protocol": "{{protocol}}", 3379 "host": [ 3380 "{{host}}" 3381 ], 3382 "port": "{{port}}", 3383 "path": [ 3384 "{{web_root}}", 3385 "api", 3386 "sessions", 3387 "{{session_token}}" 3388 ] 3389 } 3390 }, 3391 "response": [] 3392 }, 3393 { 3394 "name": "Read Session Status", 3395 "event": [ 3396 { 3397 "listen": "test", 3398 "script": { 3399 "id": "2873d554-9816-41f0-9051-fb2cb1272a76", 3400 "exec": [ 3401 "pm.test(\"Status code is 200\", function () {", 3402 " pm.response.to.have.status(200);", 3403 "});", 3404 "", 3405 "", 3406 "var jsonData = pm.response.json();", 3407 "", 3408 "pm.test(\"JSON structure is as expected\", function () {", 3409 " pm.expect(jsonData).to.have.property(\"token\");", 3410 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 3411 " pm.expect(jsonData).to.have.property(\"status\");", 3412 " pm.expect(typeof jsonData.status).to.equal(\"string\");", 3413 " pm.expect(jsonData).to.have.property(\"expiration_date\");", 3414 " pm.expect(jsonData.expiration_date).to.be.null;", 3415 " pm.expect(jsonData).to.have.property(\"date_started\");", 3416 " pm.expect(jsonData.date_started).to.satisfy(value => !value || typeof value === \"number\");", 3417 " pm.expect(jsonData).to.have.property(\"date_finished\");", 3418 " pm.expect(jsonData.date_finished).to.satisfy(value => !value || typeof value === \"number\");", 3419 "});", 3420 "", 3421 "pm.test(\"Session status is pending\", function () {", 3422 " pm.expect(jsonData.status).to.equal(\"pending\");", 3423 "})" 3424 ], 3425 "type": "text/javascript" 3426 } 3427 } 3428 ], 3429 "request": { 3430 "method": "GET", 3431 "header": [], 3432 "url": { 3433 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 3434 "protocol": "{{protocol}}", 3435 "host": [ 3436 "{{host}}" 3437 ], 3438 "port": "{{port}}", 3439 "path": [ 3440 "{{web_root}}", 3441 "api", 3442 "sessions", 3443 "{{session_token}}", 3444 "status" 3445 ] 3446 } 3447 }, 3448 "response": [] 3449 }, 3450 { 3451 "name": "Read Tests of Session", 3452 "event": [ 3453 { 3454 "listen": "test", 3455 "script": { 3456 "id": "53605764-d4f0-4b32-9a30-67e84dd104d9", 3457 "exec": [ 3458 "pm.test(\"Status code is 200\", function () {", 3459 " pm.response.to.have.status(200);", 3460 "});", 3461 "", 3462 "var jsonData = pm.response.json();", 3463 "", 3464 "pm.test(\"JSON structure is as expected\", function () {", 3465 " pm.expect(jsonData).to.have.property(\"token\");", 3466 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 3467 " pm.expect(jsonData).to.have.property(\"pending_tests\");", 3468 " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", 3469 " pm.expect(jsonData).to.have.property(\"running_tests\");", 3470 " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", 3471 "});", 3472 "", 3473 "pm.test(\"All tests are pending tests\", function () {", 3474 " pm.expect(Object.keys(jsonData.pending_tests)).to.not.have.lengthOf(0);", 3475 " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", 3476 "})", 3477 "", 3478 "console.log(pm.globals.get(\"available_tests\"))", 3479 "const availableTests = JSON.parse(pm.globals.get(\"available_tests\"));", 3480 "", 3481 "pm.test(\"All available tests are part of the session\", function () {", 3482 " for (var api of Object.keys(jsonData.pending_tests)) {", 3483 " for (var test of jsonData.pending_tests[api]) {", 3484 " pm.expect(availableTests[api]).to.include(test);", 3485 " }", 3486 " }", 3487 "})" 3488 ], 3489 "type": "text/javascript" 3490 } 3491 } 3492 ], 3493 "request": { 3494 "method": "GET", 3495 "header": [], 3496 "url": { 3497 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 3498 "protocol": "{{protocol}}", 3499 "host": [ 3500 "{{host}}" 3501 ], 3502 "port": "{{port}}", 3503 "path": [ 3504 "{{web_root}}", 3505 "api", 3506 "tests", 3507 "{{session_token}}" 3508 ] 3509 } 3510 }, 3511 "response": [] 3512 } 3513 ], 3514 "event": [ 3515 { 3516 "listen": "prerequest", 3517 "script": { 3518 "id": "cf165ae9-1c44-483c-8fe4-bd7cdaa20710", 3519 "type": "text/javascript", 3520 "exec": [ 3521 "" 3522 ] 3523 } 3524 }, 3525 { 3526 "listen": "test", 3527 "script": { 3528 "id": "6938d456-afd5-431b-a95f-a2c45a3ac479", 3529 "type": "text/javascript", 3530 "exec": [ 3531 "" 3532 ] 3533 } 3534 } 3535 ], 3536 "protocolProfileBehavior": {}, 3537 "_postman_isSubFolder": true 3538 }, 3539 { 3540 "name": "Update With Configuration", 3541 "item": [ 3542 { 3543 "name": "Update Session", 3544 "event": [ 3545 { 3546 "listen": "test", 3547 "script": { 3548 "id": "657be5b3-4a99-4415-a1ef-9dfdcf541e46", 3549 "exec": [ 3550 "pm.test(\"Status code is 200\", function () {", 3551 " pm.response.to.have.status(200);", 3552 "});" 3553 ], 3554 "type": "text/javascript" 3555 } 3556 }, 3557 { 3558 "listen": "prerequest", 3559 "script": { 3560 "id": "093a0019-a84c-44fc-b890-36369d51b7d5", 3561 "exec": [ 3562 "var automaticTimeout = 120000;", 3563 "var manualTimeout = 1000000;", 3564 "var specialTimeout = 2000;", 3565 "", 3566 "pm.globals.set(\"automatic_timeout\", automaticTimeout);", 3567 "pm.globals.set(\"manual_timeout\", manualTimeout);", 3568 "pm.globals.set(\"special_timeout\", specialTimeout);" 3569 ], 3570 "type": "text/javascript" 3571 } 3572 } 3573 ], 3574 "request": { 3575 "method": "PUT", 3576 "header": [ 3577 { 3578 "key": "Content-Type", 3579 "name": "Content-Type", 3580 "type": "text", 3581 "value": "application/json" 3582 } 3583 ], 3584 "body": { 3585 "mode": "raw", 3586 "raw": "{\n \"tests\": {\n \"include\": {{included_tests}},\n \"exclude\": {{excluded_tests}}\n },\n \"types\": [\n \"automatic\",\n \"manual\"\n ],\n \"timeouts\": {\n \"automatic\": {{automatic_timeout}},\n \"manual\": {{manual_timeout}},\n \"{{special_timeout_test}}\": {{special_timeout}}\n }\n}" 3587 }, 3588 "url": { 3589 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 3590 "protocol": "{{protocol}}", 3591 "host": [ 3592 "{{host}}" 3593 ], 3594 "port": "{{port}}", 3595 "path": [ 3596 "{{web_root}}", 3597 "api", 3598 "sessions", 3599 "{{session_token}}" 3600 ] 3601 } 3602 }, 3603 "response": [] 3604 }, 3605 { 3606 "name": "Read Session Configuration", 3607 "event": [ 3608 { 3609 "listen": "test", 3610 "script": { 3611 "id": "4ac55601-9bdf-41f8-9d59-ff1ee20fa471", 3612 "exec": [ 3613 "pm.test(\"Status code is 200\", function () {", 3614 " pm.response.to.have.status(200);", 3615 "});", 3616 "", 3617 "var jsonData = pm.response.json();", 3618 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 3619 "", 3620 "pm.test(\"JSON structure is as expected\", function () {", 3621 " pm.expect(jsonData).to.have.property(\"token\");", 3622 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 3623 " pm.expect(jsonData).to.have.property(\"tests\");", 3624 " pm.expect(typeof jsonData.tests).to.equal(\"object\");", 3625 " pm.expect(jsonData.tests).to.have.property(\"include\");", 3626 " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", 3627 " pm.expect(jsonData.tests).to.have.property(\"exclude\");", 3628 " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", 3629 " pm.expect(jsonData).to.have.property(\"types\");", 3630 " pm.expect(jsonData.types).to.be.an.instanceof(Array);", 3631 " pm.expect(jsonData).to.have.property(\"user_agent\");", 3632 " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", 3633 " pm.expect(jsonData).to.have.property(\"timeouts\");", 3634 " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", 3635 " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", 3636 " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", 3637 " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", 3638 " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", 3639 " pm.expect(jsonData).to.have.property(\"browser\");", 3640 " pm.expect(typeof jsonData.browser).to.equal(\"object\");", 3641 " pm.expect(jsonData.browser).to.have.property(\"name\");", 3642 " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", 3643 " pm.expect(jsonData.browser).to.have.property(\"version\");", 3644 " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", 3645 " pm.expect(jsonData).to.have.property(\"reference_tokens\");", 3646 " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", 3647 "});", 3648 "", 3649 "var includedTests = JSON.parse(pm.globals.get(\"included_tests\"));", 3650 "var excludedTests = JSON.parse(pm.globals.get(\"excluded_tests\"));", 3651 "var automaticTimeout = pm.globals.get(\"automatic_timeout\");", 3652 "var manualTimeout = pm.globals.get(\"manual_timeout\");", 3653 "var specialTimeout = pm.globals.get(\"special_timeout\");", 3654 "var specialTimeoutTest = pm.globals.get(\"special_timeout_test\");", 3655 "", 3656 "pm.test(\"Configuration is as specified\", function () {", 3657 " pm.expect(jsonData.token).to.match(tokenRegex);", 3658 " for (var test of includedTests) {", 3659 " pm.expect(jsonData.tests.include).to.include(test);", 3660 " }", 3661 " for (var test of excludedTests) {", 3662 " pm.expect(jsonData.tests.exclude).to.include(test);", 3663 " }", 3664 " pm.expect(jsonData.types).to.include(\"automatic\");", 3665 " pm.expect(jsonData.types).to.include(\"manual\");", 3666 " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", 3667 " pm.expect(jsonData.timeouts.automatic).to.equal(automaticTimeout);", 3668 " pm.expect(jsonData.timeouts.manual).to.equal(manualTimeout);", 3669 " pm.expect(jsonData.timeouts[specialTimeoutTest]).to.equal(specialTimeout);", 3670 " pm.expect(jsonData.browser.name).to.equal(\"Other\");", 3671 " pm.expect(jsonData.browser.version).to.equal(\"0\");", 3672 " pm.expect(jsonData.is_public).to.equal(false);", 3673 " pm.expect(jsonData.reference_tokens).to.be.empty;", 3674 "});" 3675 ], 3676 "type": "text/javascript" 3677 } 3678 } 3679 ], 3680 "request": { 3681 "method": "GET", 3682 "header": [], 3683 "url": { 3684 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 3685 "protocol": "{{protocol}}", 3686 "host": [ 3687 "{{host}}" 3688 ], 3689 "port": "{{port}}", 3690 "path": [ 3691 "{{web_root}}", 3692 "api", 3693 "sessions", 3694 "{{session_token}}" 3695 ] 3696 } 3697 }, 3698 "response": [] 3699 }, 3700 { 3701 "name": "Read Tests of Session", 3702 "event": [ 3703 { 3704 "listen": "test", 3705 "script": { 3706 "id": "0b49c01b-e943-4879-b441-4093836d05e9", 3707 "exec": [ 3708 "pm.test(\"Status code is 200\", function () {", 3709 " pm.response.to.have.status(200);", 3710 "});", 3711 "", 3712 "var jsonData = pm.response.json();", 3713 "", 3714 "pm.test(\"JSON structure is as expected\", function () {", 3715 " pm.expect(jsonData).to.have.property(\"token\");", 3716 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 3717 " pm.expect(jsonData).to.have.property(\"pending_tests\");", 3718 " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", 3719 " pm.expect(jsonData).to.have.property(\"running_tests\");", 3720 " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", 3721 "});", 3722 "", 3723 "pm.test(\"All tests are pending tests\", function () {", 3724 " pm.expect(Object.keys(jsonData.pending_tests)).to.not.have.lengthOf(0);", 3725 " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", 3726 "})", 3727 "", 3728 "const availableTests = pm.globals.get(\"available_tests\");", 3729 "const includedTests = pm.globals.get(\"included_tests\");", 3730 "const excludedTests = pm.globals.get(\"excluded_tests\");", 3731 "", 3732 "pm.test(\"Selected subset of tests are part of the session\", function () {", 3733 " for (var api of Object.keys(jsonData.pending_tests)) {", 3734 " for (var includedTest of includedTests) {", 3735 " if (includedTest.split(\"/\").find(part => !!part) === api) {", 3736 " var includeRegExp = new RegExp(\"^\" + includedTest, \"i\");", 3737 " for (var test of jsonData.pending_tests[api]) {", 3738 " pm.expect(test).to.match(regex);", 3739 " }", 3740 " break;", 3741 " }", 3742 " }", 3743 " for (var excludedTest of excludedTests) {", 3744 " if (excludedTest.split(\"/\").find(part => !!part) === api) {", 3745 " var excludeRegExp = new RegExp(\"^\" + excludedTest, \"i\");", 3746 " for (var test of jsonData.pending_tests[api]) {", 3747 " pm.expect(test).to.not.match(regex);", 3748 " }", 3749 " break;", 3750 " }", 3751 " }", 3752 " }", 3753 "});", 3754 "", 3755 "const sessionTests = jsonData.pending_tests;", 3756 "", 3757 "pm.globals.set(\"session_tests\", JSON.stringify(sessionTests));" 3758 ], 3759 "type": "text/javascript" 3760 } 3761 } 3762 ], 3763 "request": { 3764 "method": "GET", 3765 "header": [], 3766 "url": { 3767 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 3768 "protocol": "{{protocol}}", 3769 "host": [ 3770 "{{host}}" 3771 ], 3772 "port": "{{port}}", 3773 "path": [ 3774 "{{web_root}}", 3775 "api", 3776 "tests", 3777 "{{session_token}}" 3778 ] 3779 } 3780 }, 3781 "response": [] 3782 }, 3783 { 3784 "name": "Read Session Status", 3785 "event": [ 3786 { 3787 "listen": "test", 3788 "script": { 3789 "id": "b9cba19f-88d2-41f6-940a-a0979da05500", 3790 "exec": [ 3791 "pm.test(\"Status code is 200\", function () {", 3792 " pm.response.to.have.status(200);", 3793 "});", 3794 "", 3795 "", 3796 "var jsonData = pm.response.json();", 3797 "", 3798 "pm.test(\"JSON structure is as expected\", function () {", 3799 " pm.expect(jsonData).to.have.property(\"token\");", 3800 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 3801 " pm.expect(jsonData).to.have.property(\"status\");", 3802 " pm.expect(typeof jsonData.status).to.equal(\"string\");", 3803 " pm.expect(jsonData).to.have.property(\"expiration_date\");", 3804 " pm.expect(jsonData.expiration_date).to.be.null;", 3805 " pm.expect(jsonData).to.have.property(\"date_started\");", 3806 " pm.expect(jsonData.date_started).to.satisfy(value => !value || typeof value === \"number\");", 3807 " pm.expect(jsonData).to.have.property(\"date_finished\");", 3808 " pm.expect(jsonData.date_finished).to.satisfy(value => !value || typeof value === \"number\");", 3809 "});", 3810 "", 3811 "pm.test(\"Session status is pending\", function () {", 3812 " pm.expect(jsonData.status).to.equal(\"pending\");", 3813 "})", 3814 "", 3815 "pm.test(\"Start and Finish date not set\", function () {", 3816 " pm.expect(jsonData.date_started).to.be.null;", 3817 " pm.expect(jsonData.date_finished).to.be.null;", 3818 "});" 3819 ], 3820 "type": "text/javascript" 3821 } 3822 } 3823 ], 3824 "request": { 3825 "method": "GET", 3826 "header": [], 3827 "url": { 3828 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 3829 "protocol": "{{protocol}}", 3830 "host": [ 3831 "{{host}}" 3832 ], 3833 "port": "{{port}}", 3834 "path": [ 3835 "{{web_root}}", 3836 "api", 3837 "sessions", 3838 "{{session_token}}", 3839 "status" 3840 ] 3841 } 3842 }, 3843 "response": [] 3844 }, 3845 { 3846 "name": "Clean Up", 3847 "request": { 3848 "method": "DELETE", 3849 "header": [], 3850 "url": { 3851 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 3852 "protocol": "{{protocol}}", 3853 "host": [ 3854 "{{host}}" 3855 ], 3856 "port": "{{port}}", 3857 "path": [ 3858 "{{web_root}}", 3859 "api", 3860 "sessions", 3861 "{{session_token}}" 3862 ] 3863 } 3864 }, 3865 "response": [] 3866 } 3867 ], 3868 "event": [ 3869 { 3870 "listen": "prerequest", 3871 "script": { 3872 "id": "3669c70a-88bc-4854-abac-5cb80a21c392", 3873 "type": "text/javascript", 3874 "exec": [ 3875 "" 3876 ] 3877 } 3878 }, 3879 { 3880 "listen": "test", 3881 "script": { 3882 "id": "1a81f5c5-28d8-4935-b8ae-822e33c23da9", 3883 "type": "text/javascript", 3884 "exec": [ 3885 "" 3886 ] 3887 } 3888 } 3889 ], 3890 "protocolProfileBehavior": {}, 3891 "_postman_isSubFolder": true 3892 } 3893 ], 3894 "protocolProfileBehavior": {} 3895 }, 3896 { 3897 "name": "Update Session Labels", 3898 "item": [ 3899 { 3900 "name": "Create Session \\w Configuration Copy", 3901 "event": [ 3902 { 3903 "listen": "test", 3904 "script": { 3905 "id": "9de9321c-ae78-4abd-a740-6634e2cbb9b9", 3906 "exec": [ 3907 "pm.test(\"Status code is 200\", function () {", 3908 " pm.response.to.have.status(200);", 3909 "});", 3910 "", 3911 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 3912 "", 3913 "pm.test(\"Responds with token in JSON format\", function () {", 3914 " var jsonData = pm.response.json();", 3915 " pm.expect(jsonData).to.have.property(\"token\");", 3916 " pm.expect(jsonData.token).to.match(tokenRegex);", 3917 "});", 3918 "", 3919 "", 3920 "const response = pm.response.json();", 3921 "const token = response.token;", 3922 "pm.globals.set(\"session_token\", token);" 3923 ], 3924 "type": "text/javascript" 3925 } 3926 }, 3927 { 3928 "listen": "prerequest", 3929 "script": { 3930 "id": "739284e7-17ac-4c34-baa1-933353eb7ecc", 3931 "exec": [ 3932 "" 3933 ], 3934 "type": "text/javascript" 3935 } 3936 } 3937 ], 3938 "request": { 3939 "method": "POST", 3940 "header": [ 3941 { 3942 "key": "Content-Type", 3943 "name": "Content-Type", 3944 "type": "text", 3945 "value": "application/json" 3946 } 3947 ], 3948 "body": { 3949 "mode": "raw", 3950 "raw": "{\n \"labels\": [\"label1\", \"label2\"]\n}" 3951 }, 3952 "url": { 3953 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 3954 "protocol": "{{protocol}}", 3955 "host": [ 3956 "{{host}}" 3957 ], 3958 "port": "{{port}}", 3959 "path": [ 3960 "{{web_root}}", 3961 "api", 3962 "sessions" 3963 ] 3964 } 3965 }, 3966 "response": [] 3967 }, 3968 { 3969 "name": "Read Session Configuration", 3970 "event": [ 3971 { 3972 "listen": "test", 3973 "script": { 3974 "id": "5b15f338-c773-4f48-8f78-1d7c926beb81", 3975 "exec": [ 3976 "pm.test(\"Status code is 200\", function () {", 3977 " pm.response.to.have.status(200);", 3978 "});", 3979 "", 3980 "var jsonData = pm.response.json();", 3981 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 3982 "", 3983 "pm.test(\"JSON structure is as expected\", function () {", 3984 " pm.expect(jsonData).to.have.property(\"token\");", 3985 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 3986 " pm.expect(jsonData).to.have.property(\"tests\");", 3987 " pm.expect(typeof jsonData.tests).to.equal(\"object\");", 3988 " pm.expect(jsonData.tests).to.have.property(\"include\");", 3989 " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", 3990 " pm.expect(jsonData.tests).to.have.property(\"exclude\");", 3991 " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", 3992 " pm.expect(jsonData).to.have.property(\"types\");", 3993 " pm.expect(jsonData.types).to.be.an.instanceof(Array);", 3994 " pm.expect(jsonData).to.have.property(\"user_agent\");", 3995 " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", 3996 " pm.expect(jsonData).to.have.property(\"timeouts\");", 3997 " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", 3998 " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", 3999 " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", 4000 " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", 4001 " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", 4002 " pm.expect(jsonData).to.have.property(\"browser\");", 4003 " pm.expect(typeof jsonData.browser).to.equal(\"object\");", 4004 " pm.expect(jsonData.browser).to.have.property(\"name\");", 4005 " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", 4006 " pm.expect(jsonData.browser).to.have.property(\"version\");", 4007 " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", 4008 " pm.expect(jsonData).to.have.property(\"reference_tokens\");", 4009 " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", 4010 " pm.expect(jsonData).to.have.property(\"labels\");", 4011 " pm.expect(jsonData.labels).to.be.an.instanceof(Array);", 4012 "});", 4013 "", 4014 "pm.test(\"Configuration is default\", function () {", 4015 " pm.expect(jsonData.token).to.match(tokenRegex);", 4016 " pm.expect(jsonData.tests.include).to.include(\"/\");", 4017 " pm.expect(jsonData.types).to.include(\"automatic\");", 4018 " pm.expect(jsonData.types).to.include(\"manual\");", 4019 " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", 4020 " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", 4021 " pm.expect(jsonData.timeouts.manual).to.equal(300000);", 4022 " pm.expect(jsonData.browser.name).to.equal(\"Other\");", 4023 " pm.expect(jsonData.browser.version).to.equal(\"0\");", 4024 " pm.expect(jsonData.is_public).to.equal(false);", 4025 " pm.expect(jsonData.reference_tokens).to.be.empty;", 4026 " pm.expect(jsonData.labels).to.include(\"label1\");", 4027 " pm.expect(jsonData.labels).to.include(\"label2\");", 4028 "});" 4029 ], 4030 "type": "text/javascript" 4031 } 4032 } 4033 ], 4034 "request": { 4035 "method": "GET", 4036 "header": [], 4037 "url": { 4038 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 4039 "protocol": "{{protocol}}", 4040 "host": [ 4041 "{{host}}" 4042 ], 4043 "port": "{{port}}", 4044 "path": [ 4045 "{{web_root}}", 4046 "api", 4047 "sessions", 4048 "{{session_token}}" 4049 ] 4050 } 4051 }, 4052 "response": [] 4053 }, 4054 { 4055 "name": "Update Labels Copy", 4056 "event": [ 4057 { 4058 "listen": "test", 4059 "script": { 4060 "id": "e69b7188-b3c9-4f66-8c6c-3f3348f84f6a", 4061 "exec": [ 4062 "pm.test(\"Status code is 200\", function () {", 4063 " pm.response.to.have.status(200);", 4064 "});" 4065 ], 4066 "type": "text/javascript" 4067 } 4068 } 4069 ], 4070 "request": { 4071 "method": "PUT", 4072 "header": [ 4073 { 4074 "key": "Content-Type", 4075 "name": "Content-Type", 4076 "value": "application/json", 4077 "type": "text" 4078 } 4079 ], 4080 "body": { 4081 "mode": "raw", 4082 "raw": "{\n\t\"labels\": [\"new\", \"labels\"]\n}" 4083 }, 4084 "url": { 4085 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/labels", 4086 "protocol": "{{protocol}}", 4087 "host": [ 4088 "{{host}}" 4089 ], 4090 "port": "{{port}}", 4091 "path": [ 4092 "{{web_root}}", 4093 "api", 4094 "sessions", 4095 "{{session_token}}", 4096 "labels" 4097 ] 4098 } 4099 }, 4100 "response": [] 4101 }, 4102 { 4103 "name": "Read Session Configuration", 4104 "event": [ 4105 { 4106 "listen": "test", 4107 "script": { 4108 "id": "86e20c4d-5797-4b6e-a8cc-14e284e7c491", 4109 "exec": [ 4110 "pm.test(\"Status code is 200\", function () {", 4111 " pm.response.to.have.status(200);", 4112 "});", 4113 "", 4114 "var jsonData = pm.response.json();", 4115 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 4116 "", 4117 "pm.test(\"JSON structure is as expected\", function () {", 4118 " pm.expect(jsonData).to.have.property(\"token\");", 4119 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 4120 " pm.expect(jsonData).to.have.property(\"tests\");", 4121 " pm.expect(typeof jsonData.tests).to.equal(\"object\");", 4122 " pm.expect(jsonData.tests).to.have.property(\"include\");", 4123 " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", 4124 " pm.expect(jsonData.tests).to.have.property(\"exclude\");", 4125 " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", 4126 " pm.expect(jsonData).to.have.property(\"types\");", 4127 " pm.expect(jsonData.types).to.be.an.instanceof(Array);", 4128 " pm.expect(jsonData).to.have.property(\"user_agent\");", 4129 " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", 4130 " pm.expect(jsonData).to.have.property(\"timeouts\");", 4131 " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", 4132 " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", 4133 " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", 4134 " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", 4135 " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", 4136 " pm.expect(jsonData).to.have.property(\"browser\");", 4137 " pm.expect(typeof jsonData.browser).to.equal(\"object\");", 4138 " pm.expect(jsonData.browser).to.have.property(\"name\");", 4139 " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", 4140 " pm.expect(jsonData.browser).to.have.property(\"version\");", 4141 " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", 4142 " pm.expect(jsonData).to.have.property(\"reference_tokens\");", 4143 " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", 4144 " pm.expect(jsonData).to.have.property(\"labels\");", 4145 " pm.expect(jsonData.labels).to.be.an.instanceof(Array);", 4146 "});", 4147 "", 4148 "pm.test(\"Configuration is default\", function () {", 4149 " pm.expect(jsonData.token).to.match(tokenRegex);", 4150 " pm.expect(jsonData.tests.include).to.include(\"/\");", 4151 " pm.expect(jsonData.types).to.include(\"automatic\");", 4152 " pm.expect(jsonData.types).to.include(\"manual\");", 4153 " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", 4154 " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", 4155 " pm.expect(jsonData.timeouts.manual).to.equal(300000);", 4156 " pm.expect(jsonData.browser.name).to.equal(\"Other\");", 4157 " pm.expect(jsonData.browser.version).to.equal(\"0\");", 4158 " pm.expect(jsonData.is_public).to.equal(false);", 4159 " pm.expect(jsonData.reference_tokens).to.be.empty;", 4160 " pm.expect(jsonData.labels).to.include(\"new\");", 4161 " pm.expect(jsonData.labels).to.include(\"labels\");", 4162 "});" 4163 ], 4164 "type": "text/javascript" 4165 } 4166 } 4167 ], 4168 "request": { 4169 "method": "GET", 4170 "header": [], 4171 "url": { 4172 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 4173 "protocol": "{{protocol}}", 4174 "host": [ 4175 "{{host}}" 4176 ], 4177 "port": "{{port}}", 4178 "path": [ 4179 "{{web_root}}", 4180 "api", 4181 "sessions", 4182 "{{session_token}}" 4183 ] 4184 } 4185 }, 4186 "response": [] 4187 }, 4188 { 4189 "name": "Clean Up", 4190 "request": { 4191 "method": "DELETE", 4192 "header": [], 4193 "url": { 4194 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 4195 "protocol": "{{protocol}}", 4196 "host": [ 4197 "{{host}}" 4198 ], 4199 "port": "{{port}}", 4200 "path": [ 4201 "{{web_root}}", 4202 "api", 4203 "sessions", 4204 "{{session_token}}" 4205 ] 4206 } 4207 }, 4208 "response": [] 4209 } 4210 ], 4211 "protocolProfileBehavior": {} 4212 }, 4213 { 4214 "name": "Delete Session", 4215 "item": [ 4216 { 4217 "name": "Setup", 4218 "item": [ 4219 { 4220 "name": "Create Session No Configuration", 4221 "event": [ 4222 { 4223 "listen": "test", 4224 "script": { 4225 "id": "e85fd539-4598-47a9-8768-656656f29fec", 4226 "exec": [ 4227 "pm.test(\"Status code is 200\", function () {", 4228 " pm.response.to.have.status(200);", 4229 "});", 4230 "", 4231 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 4232 "", 4233 "pm.test(\"Responds with token in JSON format\", function () {", 4234 " var jsonData = pm.response.json();", 4235 " pm.expect(jsonData).to.have.property(\"token\");", 4236 " pm.expect(jsonData.token).to.match(tokenRegex);", 4237 "});", 4238 "", 4239 "", 4240 "const response = pm.response.json();", 4241 "const token = response.token;", 4242 "pm.globals.set(\"session_token\", token);" 4243 ], 4244 "type": "text/javascript" 4245 } 4246 } 4247 ], 4248 "request": { 4249 "method": "POST", 4250 "header": [ 4251 { 4252 "key": "Content-Type", 4253 "name": "Content-Type", 4254 "type": "text", 4255 "value": "application/json" 4256 } 4257 ], 4258 "body": { 4259 "mode": "raw", 4260 "raw": "" 4261 }, 4262 "url": { 4263 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 4264 "protocol": "{{protocol}}", 4265 "host": [ 4266 "{{host}}" 4267 ], 4268 "port": "{{port}}", 4269 "path": [ 4270 "{{web_root}}", 4271 "api", 4272 "sessions" 4273 ] 4274 } 4275 }, 4276 "response": [] 4277 } 4278 ], 4279 "protocolProfileBehavior": {}, 4280 "_postman_isSubFolder": true 4281 }, 4282 { 4283 "name": "Delete Session", 4284 "event": [ 4285 { 4286 "listen": "test", 4287 "script": { 4288 "id": "8e9fe4af-0d50-49eb-8a4a-00e13021b4a6", 4289 "exec": [ 4290 "pm.test(\"Status code is 200\", function () {", 4291 " pm.response.to.have.status(200);", 4292 "});" 4293 ], 4294 "type": "text/javascript" 4295 } 4296 } 4297 ], 4298 "request": { 4299 "method": "DELETE", 4300 "header": [], 4301 "url": { 4302 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 4303 "protocol": "{{protocol}}", 4304 "host": [ 4305 "{{host}}" 4306 ], 4307 "port": "{{port}}", 4308 "path": [ 4309 "{{web_root}}", 4310 "api", 4311 "sessions", 4312 "{{session_token}}" 4313 ] 4314 } 4315 }, 4316 "response": [] 4317 }, 4318 { 4319 "name": "Read Session Configuration", 4320 "event": [ 4321 { 4322 "listen": "test", 4323 "script": { 4324 "id": "9418112a-03f6-4641-893e-076c8922c0af", 4325 "exec": [ 4326 "pm.test(\"Status code is 404\", function () {", 4327 " pm.response.to.have.status(404);", 4328 "});" 4329 ], 4330 "type": "text/javascript" 4331 } 4332 } 4333 ], 4334 "request": { 4335 "method": "GET", 4336 "header": [], 4337 "url": { 4338 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 4339 "protocol": "{{protocol}}", 4340 "host": [ 4341 "{{host}}" 4342 ], 4343 "port": "{{port}}", 4344 "path": [ 4345 "{{web_root}}", 4346 "api", 4347 "sessions", 4348 "{{session_token}}" 4349 ] 4350 } 4351 }, 4352 "response": [] 4353 } 4354 ], 4355 "protocolProfileBehavior": {} 4356 }, 4357 { 4358 "name": "Create and Read Results", 4359 "item": [ 4360 { 4361 "name": "Create Session", 4362 "item": [ 4363 { 4364 "name": "Create Session Two Tests", 4365 "event": [ 4366 { 4367 "listen": "test", 4368 "script": { 4369 "id": "a6995ff1-d626-4f4f-a1e0-567f3429bf52", 4370 "exec": [ 4371 "pm.test(\"Status code is 200\", function () {", 4372 " pm.response.to.have.status(200);", 4373 "});", 4374 "", 4375 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 4376 "", 4377 "pm.test(\"Responds with token in JSON format\", function () {", 4378 " var jsonData = pm.response.json();", 4379 " pm.expect(jsonData).to.have.property(\"token\");", 4380 " pm.expect(jsonData.token).to.match(tokenRegex);", 4381 "});", 4382 "", 4383 "", 4384 "const response = pm.response.json();", 4385 "const token = response.token;", 4386 "pm.globals.set(\"session_token\", token);" 4387 ], 4388 "type": "text/javascript" 4389 } 4390 }, 4391 { 4392 "listen": "prerequest", 4393 "script": { 4394 "id": "85c7ad8d-5fc9-403d-8715-c65d5ff1323e", 4395 "exec": [ 4396 "const availableTests = JSON.parse(pm.globals.get(\"available_tests\"));", 4397 "const keys = Object.keys(availableTests).sort();", 4398 "const test1 = availableTests[keys[0]][0];", 4399 "const test2 = availableTests[keys[1]][0];", 4400 "", 4401 "console.log(test1, test2)", 4402 "", 4403 "pm.globals.set(\"single_test_1\", test1);", 4404 "pm.globals.set(\"single_test_2\", test2);" 4405 ], 4406 "type": "text/javascript" 4407 } 4408 } 4409 ], 4410 "request": { 4411 "method": "POST", 4412 "header": [ 4413 { 4414 "key": "Content-Type", 4415 "name": "Content-Type", 4416 "type": "text", 4417 "value": "application/json" 4418 } 4419 ], 4420 "body": { 4421 "mode": "raw", 4422 "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test_1}}\", \"{{single_test_2}}\"]\n }\n}" 4423 }, 4424 "url": { 4425 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 4426 "protocol": "{{protocol}}", 4427 "host": [ 4428 "{{host}}" 4429 ], 4430 "port": "{{port}}", 4431 "path": [ 4432 "{{web_root}}", 4433 "api", 4434 "sessions" 4435 ] 4436 } 4437 }, 4438 "response": [] 4439 }, 4440 { 4441 "name": "Start Session", 4442 "event": [ 4443 { 4444 "listen": "test", 4445 "script": { 4446 "id": "35cf4745-0301-4c9c-b6b3-40945299533f", 4447 "exec": [ 4448 "pm.test(\"Status code is 200\", function () {", 4449 " pm.response.to.have.status(200);", 4450 "});" 4451 ], 4452 "type": "text/javascript" 4453 } 4454 } 4455 ], 4456 "request": { 4457 "method": "POST", 4458 "header": [], 4459 "url": { 4460 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 4461 "protocol": "{{protocol}}", 4462 "host": [ 4463 "{{host}}" 4464 ], 4465 "port": "{{port}}", 4466 "path": [ 4467 "{{web_root}}", 4468 "api", 4469 "sessions", 4470 "{{session_token}}", 4471 "start" 4472 ] 4473 } 4474 }, 4475 "response": [] 4476 }, 4477 { 4478 "name": "Read Results", 4479 "event": [ 4480 { 4481 "listen": "test", 4482 "script": { 4483 "id": "6dc082ef-80ff-407a-a562-e25e37476eee", 4484 "exec": [ 4485 "pm.test(\"Status code is 200\", function () {", 4486 " pm.response.to.have.status(200);", 4487 "});", 4488 "", 4489 "pm.test(\"Responds with no results\", function () {", 4490 " var jsonData = pm.response.json();", 4491 " pm.expect(typeof jsonData).to.equal(\"object\");", 4492 " pm.expect(Object.keys(jsonData)).to.be.empty;", 4493 "});" 4494 ], 4495 "type": "text/javascript" 4496 } 4497 } 4498 ], 4499 "request": { 4500 "method": "GET", 4501 "header": [], 4502 "url": { 4503 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 4504 "protocol": "{{protocol}}", 4505 "host": [ 4506 "{{host}}" 4507 ], 4508 "port": "{{port}}", 4509 "path": [ 4510 "{{web_root}}", 4511 "api", 4512 "results", 4513 "{{session_token}}" 4514 ], 4515 "query": [ 4516 { 4517 "key": "path", 4518 "value": "/2dcontext/drawing-images-to-the-canvas", 4519 "disabled": true 4520 }, 4521 { 4522 "key": "path", 4523 "value": "/2dcontext/conformance-requirements", 4524 "disabled": true 4525 }, 4526 { 4527 "key": "path", 4528 "value": "/2dcontext/conformance-requirements/2d.missingargs.html", 4529 "disabled": true 4530 } 4531 ] 4532 } 4533 }, 4534 "response": [] 4535 }, 4536 { 4537 "name": "Read Results Compact", 4538 "event": [ 4539 { 4540 "listen": "test", 4541 "script": { 4542 "id": "fcade663-dbd8-42c9-8344-53ae1feb6fcb", 4543 "exec": [ 4544 "pm.test(\"Status code is 200\", function () {", 4545 " pm.response.to.have.status(200);", 4546 "});", 4547 "", 4548 "var singleTest1 = pm.globals.get(\"single_test_1\");", 4549 "var singleTest2 = pm.globals.get(\"single_test_2\");", 4550 "", 4551 "var api1 = singleTest1.split(\"/\").find(part => !!part);", 4552 "var api2 = singleTest2.split(\"/\").find(part => !!part);", 4553 "", 4554 "pm.test(\"Responds with no results\", function () {", 4555 " var jsonData = pm.response.json();", 4556 " pm.expect(typeof jsonData).to.equal(\"object\");", 4557 " pm.expect(jsonData).to.have.property(api1);", 4558 " pm.expect(jsonData).to.have.property(api2);", 4559 " pm.expect(jsonData[api1].complete).to.equal(0);", 4560 " pm.expect(jsonData[api2].complete).to.equal(0);", 4561 "});" 4562 ], 4563 "type": "text/javascript" 4564 } 4565 } 4566 ], 4567 "request": { 4568 "method": "GET", 4569 "header": [], 4570 "url": { 4571 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/compact", 4572 "protocol": "{{protocol}}", 4573 "host": [ 4574 "{{host}}" 4575 ], 4576 "port": "{{port}}", 4577 "path": [ 4578 "{{web_root}}", 4579 "api", 4580 "results", 4581 "{{session_token}}", 4582 "compact" 4583 ] 4584 } 4585 }, 4586 "response": [] 4587 }, 4588 { 4589 "name": "Read Last Completed Tests of Session", 4590 "event": [ 4591 { 4592 "listen": "test", 4593 "script": { 4594 "id": "36d70d08-3caa-4312-9bbd-aed15fd238dd", 4595 "exec": [ 4596 "pm.test(\"Status code is 200\", function () {", 4597 " pm.response.to.have.status(200);", 4598 "});", 4599 "", 4600 "var jsonData = pm.response.json();", 4601 " ", 4602 "pm.test(\"JSON format is as expected\", function () {", 4603 " pm.expect(Object.keys(jsonData)).to.have.lengthOf(3);", 4604 " pm.expect(jsonData).to.have.property(\"pass\");", 4605 " pm.expect(jsonData).to.have.property(\"fail\");", 4606 " pm.expect(jsonData).to.have.property(\"timeout\");", 4607 " for (var key of Object.keys(jsonData)) {", 4608 " pm.expect(jsonData[key]).to.be.an.instanceof(Array);", 4609 " }", 4610 "});", 4611 "", 4612 "pm.test(\"Responds with no last completed tests\", function () {", 4613 " for (var key of Object.keys(jsonData)) {", 4614 " pm.expect(jsonData[key]).to.be.empty;", 4615 " }", 4616 "});" 4617 ], 4618 "type": "text/javascript" 4619 } 4620 } 4621 ], 4622 "request": { 4623 "method": "GET", 4624 "header": [], 4625 "url": { 4626 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/last_completed", 4627 "protocol": "{{protocol}}", 4628 "host": [ 4629 "{{host}}" 4630 ], 4631 "port": "{{port}}", 4632 "path": [ 4633 "{{web_root}}", 4634 "api", 4635 "tests", 4636 "{{session_token}}", 4637 "last_completed" 4638 ] 4639 } 4640 }, 4641 "response": [] 4642 }, 4643 { 4644 "name": "Read Tests of Session", 4645 "event": [ 4646 { 4647 "listen": "test", 4648 "script": { 4649 "id": "211adcf7-d71a-4b0f-94ab-d285fc8367df", 4650 "exec": [ 4651 "pm.test(\"Status code is 200\", function () {", 4652 " pm.response.to.have.status(200);", 4653 "});", 4654 "", 4655 "var jsonData = pm.response.json();", 4656 "", 4657 "pm.test(\"JSON structure is as expected\", function () {", 4658 " pm.expect(jsonData).to.have.property(\"token\");", 4659 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 4660 " pm.expect(jsonData).to.have.property(\"pending_tests\");", 4661 " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", 4662 " pm.expect(jsonData).to.have.property(\"running_tests\");", 4663 " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", 4664 "});", 4665 "", 4666 "const sessionTests = jsonData.pending_tests;", 4667 "", 4668 "pm.globals.set(\"session_tests\", JSON.stringify(sessionTests));" 4669 ], 4670 "type": "text/javascript" 4671 } 4672 } 4673 ], 4674 "request": { 4675 "method": "GET", 4676 "header": [], 4677 "url": { 4678 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 4679 "protocol": "{{protocol}}", 4680 "host": [ 4681 "{{host}}" 4682 ], 4683 "port": "{{port}}", 4684 "path": [ 4685 "{{web_root}}", 4686 "api", 4687 "tests", 4688 "{{session_token}}" 4689 ] 4690 } 4691 }, 4692 "response": [] 4693 } 4694 ], 4695 "protocolProfileBehavior": {}, 4696 "_postman_isSubFolder": true 4697 }, 4698 { 4699 "name": "Create First Result", 4700 "item": [ 4701 { 4702 "name": "Read Next Test of Session", 4703 "event": [ 4704 { 4705 "listen": "test", 4706 "script": { 4707 "id": "5410c9c2-ebbe-4bc1-ac12-e2602d8ade57", 4708 "exec": [ 4709 "pm.test(\"Status code is 200\", function () {", 4710 " pm.response.to.have.status(200);", 4711 "});", 4712 "", 4713 "const response = pm.response.json();", 4714 "", 4715 "pm.test(\"JSON structure is as expected\", function () {", 4716 " pm.expect(Object.keys(response)).to.have.lengthOf(1);", 4717 " pm.expect(response).to.have.property(\"next_test\");", 4718 " pm.expect(typeof response.next_test).to.equal(\"string\");", 4719 "});", 4720 "", 4721 "const nextTest = response.next_test;", 4722 "pm.globals.set(\"current_test_url\", nextTest);", 4723 "if (!nextTest) return;", 4724 "", 4725 "const parameters = nextTest.split(\"?\")[1].split(\"&\");", 4726 "let test = parameters.find(parameter => parameter.split(\"=\")[0] === \"test_url\").split(\"=\")[1];", 4727 "test = decodeURIComponent(test);", 4728 "test = \"/\" + test.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 4729 "", 4730 "pm.globals.set(\"current_test\", test);", 4731 "", 4732 "const test1 = pm.globals.get(\"single_test_1\");", 4733 "", 4734 "pm.test(\"Returned test is first of two specified tests\", function () {", 4735 " console.log(test);", 4736 " console.log(test1);", 4737 " console.log(pm.globals.get(\"single_test_2\"))", 4738 " pm.expect(test).to.equal(test1);", 4739 "});" 4740 ], 4741 "type": "text/javascript" 4742 } 4743 } 4744 ], 4745 "request": { 4746 "method": "GET", 4747 "header": [], 4748 "url": { 4749 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 4750 "protocol": "{{protocol}}", 4751 "host": [ 4752 "{{host}}" 4753 ], 4754 "port": "{{port}}", 4755 "path": [ 4756 "{{web_root}}", 4757 "api", 4758 "tests", 4759 "{{session_token}}", 4760 "next" 4761 ] 4762 } 4763 }, 4764 "response": [] 4765 }, 4766 { 4767 "name": "Read Tests of Session", 4768 "event": [ 4769 { 4770 "listen": "test", 4771 "script": { 4772 "id": "e4f9a03f-c731-4192-a9a9-aa9e315c3c44", 4773 "exec": [ 4774 "pm.test(\"Status code is 200\", function () {", 4775 " pm.response.to.have.status(200);", 4776 "});", 4777 "", 4778 "var jsonData = pm.response.json();", 4779 "", 4780 "pm.test(\"JSON structure is as expected\", function () {", 4781 " pm.expect(jsonData).to.have.property(\"token\");", 4782 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 4783 " pm.expect(jsonData).to.have.property(\"pending_tests\");", 4784 " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", 4785 " pm.expect(jsonData).to.have.property(\"running_tests\");", 4786 " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", 4787 "});", 4788 "", 4789 "const test1 = pm.globals.get(\"single_test_1\");", 4790 "const test2 = pm.globals.get(\"single_test_2\");", 4791 "", 4792 "pm.test(\"One test is pending, one test is running\", function () {", 4793 " pm.expect(Object.keys(jsonData.pending_tests)).to.have.lengthOf(1);", 4794 " var api = Object.keys(jsonData.pending_tests)[0];", 4795 " pm.expect(jsonData.pending_tests[api]).to.have.lengthOf(1);", 4796 " pm.expect(jsonData.pending_tests[api]).to.include(test2);", 4797 " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(1);", 4798 " api = Object.keys(jsonData.running_tests)[0];", 4799 " pm.expect(jsonData.running_tests[api]).to.have.lengthOf(1);", 4800 " pm.expect(jsonData.running_tests[api]).to.include(test1);", 4801 "})" 4802 ], 4803 "type": "text/javascript" 4804 } 4805 } 4806 ], 4807 "request": { 4808 "method": "GET", 4809 "header": [], 4810 "url": { 4811 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 4812 "protocol": "{{protocol}}", 4813 "host": [ 4814 "{{host}}" 4815 ], 4816 "port": "{{port}}", 4817 "path": [ 4818 "{{web_root}}", 4819 "api", 4820 "tests", 4821 "{{session_token}}" 4822 ] 4823 } 4824 }, 4825 "response": [] 4826 }, 4827 { 4828 "name": "Create Result", 4829 "event": [ 4830 { 4831 "listen": "test", 4832 "script": { 4833 "id": "9f684f77-4ed0-4cd2-99a4-b1c134432e9f", 4834 "exec": [ 4835 "pm.test(\"Status code is 200\", function () {", 4836 " pm.response.to.have.status(200);", 4837 "});" 4838 ], 4839 "type": "text/javascript" 4840 } 4841 } 4842 ], 4843 "request": { 4844 "method": "POST", 4845 "header": [ 4846 { 4847 "key": "Content-Type", 4848 "name": "Content-Type", 4849 "value": "application/json", 4850 "type": "text" 4851 } 4852 ], 4853 "body": { 4854 "mode": "raw", 4855 "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" 4856 }, 4857 "url": { 4858 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 4859 "protocol": "{{protocol}}", 4860 "host": [ 4861 "{{host}}" 4862 ], 4863 "port": "{{port}}", 4864 "path": [ 4865 "{{web_root}}", 4866 "api", 4867 "results", 4868 "{{session_token}}" 4869 ] 4870 } 4871 }, 4872 "response": [] 4873 }, 4874 { 4875 "name": "Read Tests of Session", 4876 "event": [ 4877 { 4878 "listen": "test", 4879 "script": { 4880 "id": "33601dd0-6786-4c8a-a6b5-7f1386129de7", 4881 "exec": [ 4882 "pm.test(\"Status code is 200\", function () {", 4883 " pm.response.to.have.status(200);", 4884 "});", 4885 "", 4886 "var jsonData = pm.response.json();", 4887 "", 4888 "pm.test(\"JSON structure is as expected\", function () {", 4889 " pm.expect(jsonData).to.have.property(\"token\");", 4890 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 4891 " pm.expect(jsonData).to.have.property(\"pending_tests\");", 4892 " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", 4893 " pm.expect(jsonData).to.have.property(\"running_tests\");", 4894 " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", 4895 "});", 4896 "", 4897 "", 4898 "const test1 = pm.globals.get(\"single_test_1\");", 4899 "const test2 = pm.globals.get(\"single_test_2\");", 4900 "", 4901 "pm.test(\"One test is pending, one test is completed\", function () {", 4902 " pm.expect(Object.keys(jsonData.pending_tests)).to.have.lengthOf(1);", 4903 " var api = Object.keys(jsonData.pending_tests)[0];", 4904 " pm.expect(jsonData.pending_tests[api]).to.have.lengthOf(1);", 4905 " pm.expect(jsonData.pending_tests[api]).to.include(test2);", 4906 " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", 4907 "})" 4908 ], 4909 "type": "text/javascript" 4910 } 4911 } 4912 ], 4913 "request": { 4914 "method": "GET", 4915 "header": [], 4916 "url": { 4917 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 4918 "protocol": "{{protocol}}", 4919 "host": [ 4920 "{{host}}" 4921 ], 4922 "port": "{{port}}", 4923 "path": [ 4924 "{{web_root}}", 4925 "api", 4926 "tests", 4927 "{{session_token}}" 4928 ] 4929 } 4930 }, 4931 "response": [] 4932 }, 4933 { 4934 "name": "Read Session Status", 4935 "event": [ 4936 { 4937 "listen": "test", 4938 "script": { 4939 "id": "97be92f1-a8d1-41ea-b41d-0ca08113e6e1", 4940 "exec": [ 4941 "pm.test(\"Status code is 200\", function () {", 4942 " pm.response.to.have.status(200);", 4943 "});", 4944 "", 4945 "", 4946 "var jsonData = pm.response.json();", 4947 "", 4948 "pm.test(\"JSON structure is as expected\", function () {", 4949 " pm.expect(jsonData).to.have.property(\"token\");", 4950 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 4951 " pm.expect(jsonData).to.have.property(\"status\");", 4952 " pm.expect(typeof jsonData.status).to.equal(\"string\");", 4953 " pm.expect(jsonData).to.have.property(\"expiration_date\");", 4954 " pm.expect(jsonData.expiration_date).to.be.null;", 4955 " pm.expect(jsonData).to.have.property(\"date_started\");", 4956 " pm.expect(jsonData).to.have.property(\"date_finished\");", 4957 "});", 4958 "", 4959 "pm.test(\"Session status is running\", function () {", 4960 " pm.expect(jsonData.status).to.equal(\"running\");", 4961 "})" 4962 ], 4963 "type": "text/javascript" 4964 } 4965 } 4966 ], 4967 "request": { 4968 "method": "GET", 4969 "header": [], 4970 "url": { 4971 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 4972 "protocol": "{{protocol}}", 4973 "host": [ 4974 "{{host}}" 4975 ], 4976 "port": "{{port}}", 4977 "path": [ 4978 "{{web_root}}", 4979 "api", 4980 "sessions", 4981 "{{session_token}}", 4982 "status" 4983 ] 4984 } 4985 }, 4986 "response": [] 4987 }, 4988 { 4989 "name": "Read Last Completed Tests of Session", 4990 "event": [ 4991 { 4992 "listen": "test", 4993 "script": { 4994 "id": "24ec2b79-c266-473f-8579-7b694079d640", 4995 "exec": [ 4996 "pm.test(\"Status code is 200\", function () {", 4997 " pm.response.to.have.status(200);", 4998 "});", 4999 "", 5000 "var jsonData = pm.response.json();", 5001 " ", 5002 "pm.test(\"JSON format is as expected\", function () {", 5003 " pm.expect(Object.keys(jsonData)).to.have.lengthOf(3);", 5004 " pm.expect(jsonData).to.have.property(\"pass\");", 5005 " pm.expect(jsonData).to.have.property(\"fail\");", 5006 " pm.expect(jsonData).to.have.property(\"timeout\");", 5007 " for (var key of Object.keys(jsonData)) {", 5008 " pm.expect(jsonData[key]).to.be.an.instanceof(Array);", 5009 " }", 5010 "});", 5011 "", 5012 "const test1 = pm.globals.get(\"single_test_1\");", 5013 "", 5014 "pm.test(\"Responds with one last completed tests as failed\", function () {", 5015 " pm.expect(jsonData[\"pass\"]).to.be.empty;", 5016 " pm.expect(jsonData[\"fail\"]).to.have.lengthOf(1);", 5017 " pm.expect(jsonData[\"fail\"][0]).to.equal(test1);", 5018 " pm.expect(jsonData[\"timeout\"]).to.be.empty;", 5019 "});" 5020 ], 5021 "type": "text/javascript" 5022 } 5023 } 5024 ], 5025 "request": { 5026 "method": "GET", 5027 "header": [], 5028 "url": { 5029 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/last_completed", 5030 "protocol": "{{protocol}}", 5031 "host": [ 5032 "{{host}}" 5033 ], 5034 "port": "{{port}}", 5035 "path": [ 5036 "{{web_root}}", 5037 "api", 5038 "tests", 5039 "{{session_token}}", 5040 "last_completed" 5041 ] 5042 } 5043 }, 5044 "response": [] 5045 }, 5046 { 5047 "name": "Read Results", 5048 "event": [ 5049 { 5050 "listen": "test", 5051 "script": { 5052 "id": "1f47b39f-727f-43b4-934d-c7f62b268baa", 5053 "exec": [ 5054 "pm.test(\"Status code is 200\", function () {", 5055 " pm.response.to.have.status(200);", 5056 "});", 5057 "", 5058 "var jsonData = pm.response.json();", 5059 "", 5060 "pm.test(\"JSON format is as expected\", function () {", 5061 " for (var api of Object.keys(jsonData)) {", 5062 " pm.expect(jsonData[api]).to.be.an.instanceof(Array);", 5063 " for (var result of jsonData[api]) {", 5064 " pm.expect(typeof result).to.equal(\"object\");", 5065 " pm.expect(Object.keys(result)).to.have.lengthOf(4);", 5066 " pm.expect(result).to.have.property(\"test\");", 5067 " pm.expect(typeof result.test).to.equal(\"string\");", 5068 " pm.expect(result).to.have.property(\"status\");", 5069 " pm.expect(typeof result.status).to.equal(\"string\");", 5070 " pm.expect(result).to.have.property(\"message\");", 5071 " pm.expect(result.message).to.satisfy(message => !message || typeof message === \"string\");", 5072 " pm.expect(result).to.have.property(\"subtests\");", 5073 " pm.expect(result.subtests).to.be.an.instanceof(Array);", 5074 " for (var subtest of result.subtests) {", 5075 " pm.expect(typeof subtest).to.equal(\"object\");", 5076 " pm.expect(Object.keys(subtest)).to.have.lengthOf(3);", 5077 " pm.expect(subtest).to.have.property(\"name\");", 5078 " pm.expect(typeof subtest.name).to.equal(\"string\");", 5079 " pm.expect(subtest).to.have.property(\"status\");", 5080 " pm.expect(typeof subtest.status).to.equal(\"string\");", 5081 " pm.expect(subtest).to.have.property(\"message\");", 5082 " pm.expect(subtest.message).to.satisfy(message => !message || typeof message === \"string\");", 5083 " }", 5084 " }", 5085 " }", 5086 "});", 5087 "", 5088 "const test1 = pm.globals.get(\"single_test_1\");", 5089 "", 5090 "pm.test(\"Test is first test, successful run and failed\", function () {", 5091 " var api = Object.keys(jsonData)[0];", 5092 " pm.expect(api).to.equal(test1.split(\"/\").find(part => !!part))", 5093 " var result = jsonData[api][0];", 5094 " pm.expect(result.test).to.equal(test1);", 5095 " pm.expect(result.status).to.equal(\"OK\");", 5096 " pm.expect(result.message).to.be.null;", 5097 " var subtest = result.subtests[0];", 5098 " pm.expect(subtest.status).to.equal(\"FAIL\");", 5099 "})" 5100 ], 5101 "type": "text/javascript" 5102 } 5103 } 5104 ], 5105 "request": { 5106 "method": "GET", 5107 "header": [], 5108 "url": { 5109 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 5110 "protocol": "{{protocol}}", 5111 "host": [ 5112 "{{host}}" 5113 ], 5114 "port": "{{port}}", 5115 "path": [ 5116 "{{web_root}}", 5117 "api", 5118 "results", 5119 "{{session_token}}" 5120 ], 5121 "query": [ 5122 { 5123 "key": "path", 5124 "value": "/2dcontext/drawing-images-to-the-canvas", 5125 "disabled": true 5126 }, 5127 { 5128 "key": "path", 5129 "value": "/2dcontext/conformance-requirements", 5130 "disabled": true 5131 }, 5132 { 5133 "key": "path", 5134 "value": "/2dcontext/conformance-requirements/2d.missingargs.html", 5135 "disabled": true 5136 } 5137 ] 5138 } 5139 }, 5140 "response": [] 5141 }, 5142 { 5143 "name": "Read Results Compact", 5144 "event": [ 5145 { 5146 "listen": "test", 5147 "script": { 5148 "id": "e734f074-a0c2-4e54-b427-2827fa732843", 5149 "exec": [ 5150 "pm.test(\"Status code is 200\", function () {", 5151 " pm.response.to.have.status(200);", 5152 "});", 5153 "", 5154 "var jsonData = pm.response.json();", 5155 "var test = pm.globals.get(\"single_test_1\");", 5156 "", 5157 "pm.test(\"JSON structure is as expected\", function () {", 5158 " pm.expect(typeof jsonData).to.equal(\"object\");", 5159 " for (var api of Object.keys(jsonData)) {", 5160 " pm.expect(jsonData[api]).to.have.property(\"pass\");", 5161 " pm.expect(typeof jsonData[api].pass).to.equal(\"number\");", 5162 " pm.expect(jsonData[api]).to.have.property(\"fail\");", 5163 " pm.expect(typeof jsonData[api].fail).to.equal(\"number\");", 5164 " pm.expect(jsonData[api]).to.have.property(\"timeout\");", 5165 " pm.expect(typeof jsonData[api].timeout).to.equal(\"number\");", 5166 " pm.expect(jsonData[api]).to.have.property(\"not_run\");", 5167 " pm.expect(typeof jsonData[api].not_run).to.equal(\"number\");", 5168 " }", 5169 "})", 5170 "", 5171 "pm.test(\"Responds with one test failed\", function () {", 5172 " var api = test.split(\"/\").find(part => !!part);", 5173 " pm.expect(jsonData[api].pass).to.equal(0);", 5174 " pm.expect(jsonData[api].fail).to.equal(1);", 5175 " pm.expect(jsonData[api].timeout).to.equal(0);", 5176 " pm.expect(jsonData[api].not_run).to.equal(0);", 5177 "});" 5178 ], 5179 "type": "text/javascript" 5180 } 5181 } 5182 ], 5183 "request": { 5184 "method": "GET", 5185 "header": [], 5186 "url": { 5187 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/compact", 5188 "protocol": "{{protocol}}", 5189 "host": [ 5190 "{{host}}" 5191 ], 5192 "port": "{{port}}", 5193 "path": [ 5194 "{{web_root}}", 5195 "api", 5196 "results", 5197 "{{session_token}}", 5198 "compact" 5199 ] 5200 } 5201 }, 5202 "response": [] 5203 } 5204 ], 5205 "protocolProfileBehavior": {}, 5206 "_postman_isSubFolder": true 5207 }, 5208 { 5209 "name": "Create Last Result", 5210 "item": [ 5211 { 5212 "name": "Read Next Test of Session", 5213 "event": [ 5214 { 5215 "listen": "test", 5216 "script": { 5217 "id": "fd2c11ee-5eca-43f3-89a7-133602c8034a", 5218 "exec": [ 5219 "pm.test(\"Status code is 200\", function () {", 5220 " pm.response.to.have.status(200);", 5221 "});", 5222 "", 5223 "const response = pm.response.json();", 5224 "", 5225 "pm.test(\"JSON structure is as expected\", function () {", 5226 " pm.expect(Object.keys(response)).to.have.lengthOf(1);", 5227 " pm.expect(response).to.have.property(\"next_test\");", 5228 " pm.expect(typeof response.next_test).to.equal(\"string\");", 5229 "});", 5230 "", 5231 "const nextTest = response.next_test;", 5232 "pm.globals.set(\"current_test_url\", nextTest);", 5233 "if (!nextTest) return;", 5234 "", 5235 "const parameters = nextTest.split(\"?\")[1].split(\"&\");", 5236 "let test = parameters.find(parameter => parameter.split(\"=\")[0] === \"test_url\").split(\"=\")[1];", 5237 "test = decodeURIComponent(test);", 5238 "test = \"/\" + test.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 5239 "", 5240 "pm.globals.set(\"current_test\", test);", 5241 "", 5242 "const test2 = pm.globals.get(\"single_test_2\");", 5243 "", 5244 "pm.test(\"Returned test is second of two specified tests\", function () {", 5245 " pm.expect(test).to.equal(test2);", 5246 "});" 5247 ], 5248 "type": "text/javascript" 5249 } 5250 } 5251 ], 5252 "request": { 5253 "method": "GET", 5254 "header": [], 5255 "url": { 5256 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 5257 "protocol": "{{protocol}}", 5258 "host": [ 5259 "{{host}}" 5260 ], 5261 "port": "{{port}}", 5262 "path": [ 5263 "{{web_root}}", 5264 "api", 5265 "tests", 5266 "{{session_token}}", 5267 "next" 5268 ] 5269 } 5270 }, 5271 "response": [] 5272 }, 5273 { 5274 "name": "Read Tests of Session", 5275 "event": [ 5276 { 5277 "listen": "test", 5278 "script": { 5279 "id": "112ee3d5-d4e0-4838-879e-f74c38d0218c", 5280 "exec": [ 5281 "pm.test(\"Status code is 200\", function () {", 5282 " pm.response.to.have.status(200);", 5283 "});", 5284 "", 5285 "var jsonData = pm.response.json();", 5286 "", 5287 "pm.test(\"JSON structure is as expected\", function () {", 5288 " pm.expect(jsonData).to.have.property(\"token\");", 5289 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 5290 " pm.expect(jsonData).to.have.property(\"pending_tests\");", 5291 " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", 5292 " pm.expect(jsonData).to.have.property(\"running_tests\");", 5293 " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", 5294 "});", 5295 "", 5296 "const test1 = pm.globals.get(\"single_test_1\");", 5297 "const test2 = pm.globals.get(\"single_test_2\");", 5298 "", 5299 "pm.test(\"One test is running\", function () {", 5300 " pm.expect(Object.keys(jsonData.pending_tests)).to.have.lengthOf(0);", 5301 " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(1);", 5302 " var api = Object.keys(jsonData.running_tests)[0];", 5303 " pm.expect(jsonData.running_tests[api]).to.have.lengthOf(1);", 5304 " pm.expect(jsonData.running_tests[api]).to.include(test2);", 5305 "})" 5306 ], 5307 "type": "text/javascript" 5308 } 5309 } 5310 ], 5311 "request": { 5312 "method": "GET", 5313 "header": [], 5314 "url": { 5315 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 5316 "protocol": "{{protocol}}", 5317 "host": [ 5318 "{{host}}" 5319 ], 5320 "port": "{{port}}", 5321 "path": [ 5322 "{{web_root}}", 5323 "api", 5324 "tests", 5325 "{{session_token}}" 5326 ] 5327 } 5328 }, 5329 "response": [] 5330 }, 5331 { 5332 "name": "Create Result", 5333 "event": [ 5334 { 5335 "listen": "test", 5336 "script": { 5337 "id": "79a84ed9-bb07-493d-ab34-8e7693b3ebbd", 5338 "exec": [ 5339 "pm.test(\"Status code is 200\", function () {", 5340 " pm.response.to.have.status(200);", 5341 "});" 5342 ], 5343 "type": "text/javascript" 5344 } 5345 } 5346 ], 5347 "request": { 5348 "method": "POST", 5349 "header": [ 5350 { 5351 "key": "Content-Type", 5352 "name": "Content-Type", 5353 "type": "text", 5354 "value": "application/json" 5355 } 5356 ], 5357 "body": { 5358 "mode": "raw", 5359 "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"PASS\",\n \"message\": \"Error message\"\n }\n ]\n}" 5360 }, 5361 "url": { 5362 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 5363 "protocol": "{{protocol}}", 5364 "host": [ 5365 "{{host}}" 5366 ], 5367 "port": "{{port}}", 5368 "path": [ 5369 "{{web_root}}", 5370 "api", 5371 "results", 5372 "{{session_token}}" 5373 ] 5374 } 5375 }, 5376 "response": [] 5377 }, 5378 { 5379 "name": "Read Session Status", 5380 "event": [ 5381 { 5382 "listen": "test", 5383 "script": { 5384 "id": "c1829043-18dd-4cc1-8091-41981349f4e3", 5385 "exec": [ 5386 "pm.test(\"Status code is 200\", function () {", 5387 " pm.response.to.have.status(200);", 5388 "});", 5389 "", 5390 "", 5391 "var jsonData = pm.response.json();", 5392 "", 5393 "pm.test(\"JSON structure is as expected\", function () {", 5394 " pm.expect(jsonData).to.have.property(\"token\");", 5395 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 5396 " pm.expect(jsonData).to.have.property(\"status\");", 5397 " pm.expect(typeof jsonData.status).to.equal(\"string\");", 5398 " pm.expect(jsonData).to.have.property(\"expiration_date\");", 5399 " pm.expect(jsonData.expiration_date).to.be.null;", 5400 " pm.expect(jsonData).to.have.property(\"date_started\");", 5401 " pm.expect(jsonData).to.have.property(\"date_finished\");", 5402 "});", 5403 "", 5404 "pm.test(\"Session status is completed\", function () {", 5405 " pm.expect(jsonData.status).to.equal(\"completed\");", 5406 "})", 5407 "", 5408 "pm.test(\"Finish date is set\", function () {", 5409 " pm.expect(Date.parse(jsonData.date_finished)).to.be.below(Date.now());", 5410 "});" 5411 ], 5412 "type": "text/javascript" 5413 } 5414 } 5415 ], 5416 "request": { 5417 "method": "GET", 5418 "header": [], 5419 "url": { 5420 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 5421 "protocol": "{{protocol}}", 5422 "host": [ 5423 "{{host}}" 5424 ], 5425 "port": "{{port}}", 5426 "path": [ 5427 "{{web_root}}", 5428 "api", 5429 "sessions", 5430 "{{session_token}}", 5431 "status" 5432 ] 5433 } 5434 }, 5435 "response": [] 5436 }, 5437 { 5438 "name": "Read Tests of Session", 5439 "event": [ 5440 { 5441 "listen": "test", 5442 "script": { 5443 "id": "59fee9df-9945-4fdf-a102-9c1b92d915c1", 5444 "exec": [ 5445 "pm.test(\"Status code is 200\", function () {", 5446 " pm.response.to.have.status(200);", 5447 "});", 5448 "", 5449 "var jsonData = pm.response.json();", 5450 "", 5451 "pm.test(\"JSON structure is as expected\", function () {", 5452 " pm.expect(jsonData).to.have.property(\"token\");", 5453 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 5454 " pm.expect(jsonData).to.have.property(\"pending_tests\");", 5455 " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", 5456 " pm.expect(jsonData).to.have.property(\"running_tests\");", 5457 " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", 5458 "});", 5459 "", 5460 "const test1 = pm.globals.get(\"single_test_1\");", 5461 "const test2 = pm.globals.get(\"single_test_2\");", 5462 "", 5463 "var test1Api = test1.split(\"/\").find(part => !!part);", 5464 "var test2Api = test1.split(\"/\").find(part => !!part);", 5465 "", 5466 "pm.test(\"One test is pending, one test is completed\", function () {", 5467 " pm.expect(Object.keys(jsonData.pending_tests)).to.have.lengthOf(0);", 5468 " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", 5469 "})" 5470 ], 5471 "type": "text/javascript" 5472 } 5473 } 5474 ], 5475 "request": { 5476 "method": "GET", 5477 "header": [], 5478 "url": { 5479 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 5480 "protocol": "{{protocol}}", 5481 "host": [ 5482 "{{host}}" 5483 ], 5484 "port": "{{port}}", 5485 "path": [ 5486 "{{web_root}}", 5487 "api", 5488 "tests", 5489 "{{session_token}}" 5490 ] 5491 } 5492 }, 5493 "response": [] 5494 }, 5495 { 5496 "name": "Read Last Completed Tests of Session", 5497 "event": [ 5498 { 5499 "listen": "test", 5500 "script": { 5501 "id": "91fa38ac-3b06-488a-892e-59458e88a4da", 5502 "exec": [ 5503 "pm.test(\"Status code is 200\", function () {", 5504 " pm.response.to.have.status(200);", 5505 "});", 5506 "", 5507 "var jsonData = pm.response.json();", 5508 " ", 5509 "pm.test(\"JSON format is as expected\", function () {", 5510 " pm.expect(Object.keys(jsonData)).to.have.lengthOf(3);", 5511 " pm.expect(jsonData).to.have.property(\"pass\");", 5512 " pm.expect(jsonData).to.have.property(\"fail\");", 5513 " pm.expect(jsonData).to.have.property(\"timeout\");", 5514 " for (var key of Object.keys(jsonData)) {", 5515 " pm.expect(jsonData[key]).to.be.an.instanceof(Array);", 5516 " }", 5517 "});", 5518 "", 5519 "const test1 = pm.globals.get(\"single_test_1\");", 5520 "const test2 = pm.globals.get(\"single_test_2\");", 5521 "", 5522 "pm.test(\"Responds with one last completed tests as failed and one last completed test as passed\", function () {", 5523 " pm.expect(jsonData[\"pass\"]).to.have.lengthOf(1);", 5524 " pm.expect(jsonData[\"pass\"][0]).to.equal(test2);", 5525 " pm.expect(jsonData[\"fail\"]).to.have.lengthOf(1);", 5526 " pm.expect(jsonData[\"fail\"][0]).to.equal(test1);", 5527 " pm.expect(jsonData[\"timeout\"]).to.be.empty;", 5528 "});" 5529 ], 5530 "type": "text/javascript" 5531 } 5532 } 5533 ], 5534 "request": { 5535 "method": "GET", 5536 "header": [], 5537 "url": { 5538 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/last_completed", 5539 "protocol": "{{protocol}}", 5540 "host": [ 5541 "{{host}}" 5542 ], 5543 "port": "{{port}}", 5544 "path": [ 5545 "{{web_root}}", 5546 "api", 5547 "tests", 5548 "{{session_token}}", 5549 "last_completed" 5550 ] 5551 } 5552 }, 5553 "response": [] 5554 }, 5555 { 5556 "name": "Read Results", 5557 "event": [ 5558 { 5559 "listen": "test", 5560 "script": { 5561 "id": "dca0b42e-9054-4354-87e5-e8d236216050", 5562 "exec": [ 5563 "pm.test(\"Status code is 200\", function () {", 5564 " pm.response.to.have.status(200);", 5565 "});", 5566 "", 5567 "var jsonData = pm.response.json();", 5568 "", 5569 "pm.test(\"JSON format is as expected\", function () {", 5570 " for (var api of Object.keys(jsonData)) {", 5571 " pm.expect(jsonData[api]).to.be.an.instanceof(Array);", 5572 " for (var result of jsonData[api]) {", 5573 " pm.expect(typeof result).to.equal(\"object\");", 5574 " pm.expect(Object.keys(result)).to.have.lengthOf(4);", 5575 " pm.expect(result).to.have.property(\"test\");", 5576 " pm.expect(typeof result.test).to.equal(\"string\");", 5577 " pm.expect(result).to.have.property(\"status\");", 5578 " pm.expect(typeof result.status).to.equal(\"string\");", 5579 " pm.expect(result).to.have.property(\"message\");", 5580 " pm.expect(result.message).to.satisfy(message => !message || typeof message === \"string\");", 5581 " pm.expect(result).to.have.property(\"subtests\");", 5582 " pm.expect(result.subtests).to.be.an.instanceof(Array);", 5583 " for (var subtest of result.subtests) {", 5584 " pm.expect(typeof subtest).to.equal(\"object\");", 5585 " pm.expect(Object.keys(subtest)).to.have.lengthOf(3);", 5586 " pm.expect(subtest).to.have.property(\"name\");", 5587 " pm.expect(typeof subtest.name).to.equal(\"string\");", 5588 " pm.expect(subtest).to.have.property(\"status\");", 5589 " pm.expect(typeof subtest.status).to.equal(\"string\");", 5590 " pm.expect(subtest).to.have.property(\"message\");", 5591 " pm.expect(subtest.message).to.satisfy(message => !message || typeof message === \"string\");", 5592 " }", 5593 " }", 5594 " }", 5595 "});", 5596 "", 5597 "const test1 = pm.globals.get(\"single_test_1\");", 5598 "const test2 = pm.globals.get(\"single_test_2\");", 5599 "", 5600 "pm.test(\"Test is first and second test, successful run and failed, and successful run and passed\", function () {", 5601 " var api = Object.keys(jsonData)[0];", 5602 " for (var result of jsonData[api]) {", 5603 " if (result.test === test1) {", 5604 " pm.expect(result.test).to.equal(test1); ", 5605 " pm.expect(result.status).to.equal(\"OK\");", 5606 " pm.expect(result.message).to.be.null;", 5607 " var subtest = result.subtests[0];", 5608 " pm.expect(subtest.status).to.equal(\"FAIL\");", 5609 " } else {", 5610 " pm.expect(result.test).to.equal(test2); ", 5611 " pm.expect(result.status).to.equal(\"OK\");", 5612 " pm.expect(result.message).to.be.null;", 5613 " subtest = result.subtests[0];", 5614 " pm.expect(subtest.status).to.equal(\"PASS\");", 5615 " }", 5616 " }", 5617 "})" 5618 ], 5619 "type": "text/javascript" 5620 } 5621 } 5622 ], 5623 "request": { 5624 "method": "GET", 5625 "header": [], 5626 "url": { 5627 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 5628 "protocol": "{{protocol}}", 5629 "host": [ 5630 "{{host}}" 5631 ], 5632 "port": "{{port}}", 5633 "path": [ 5634 "{{web_root}}", 5635 "api", 5636 "results", 5637 "{{session_token}}" 5638 ], 5639 "query": [ 5640 { 5641 "key": "path", 5642 "value": "/2dcontext/drawing-images-to-the-canvas", 5643 "disabled": true 5644 }, 5645 { 5646 "key": "path", 5647 "value": "/2dcontext/conformance-requirements", 5648 "disabled": true 5649 }, 5650 { 5651 "key": "path", 5652 "value": "/2dcontext/conformance-requirements/2d.missingargs.html", 5653 "disabled": true 5654 } 5655 ] 5656 } 5657 }, 5658 "response": [] 5659 }, 5660 { 5661 "name": "Read Results Compact", 5662 "event": [ 5663 { 5664 "listen": "test", 5665 "script": { 5666 "id": "14ec9254-5a40-4c86-9a7f-72f43a35a79b", 5667 "exec": [ 5668 "pm.test(\"Status code is 200\", function () {", 5669 " pm.response.to.have.status(200);", 5670 "});", 5671 "", 5672 "var jsonData = pm.response.json();", 5673 "", 5674 "pm.test(\"JSON structure is as expected\", function () {", 5675 " pm.expect(typeof jsonData).to.equal(\"object\");", 5676 " for (var api of Object.keys(jsonData)) {", 5677 " pm.expect(jsonData[api]).to.have.property(\"pass\");", 5678 " pm.expect(typeof jsonData[api].pass).to.equal(\"number\");", 5679 " pm.expect(jsonData[api]).to.have.property(\"fail\");", 5680 " pm.expect(typeof jsonData[api].fail).to.equal(\"number\");", 5681 " pm.expect(jsonData[api]).to.have.property(\"timeout\");", 5682 " pm.expect(typeof jsonData[api].timeout).to.equal(\"number\");", 5683 " pm.expect(jsonData[api]).to.have.property(\"not_run\");", 5684 " pm.expect(typeof jsonData[api].not_run).to.equal(\"number\");", 5685 " }", 5686 "})", 5687 "", 5688 "const test1 = pm.globals.get(\"single_test_1\");", 5689 "const test2 = pm.globals.get(\"single_test_2\");", 5690 "", 5691 "var test1Api = test1.split(\"/\").find(part => !!part);", 5692 "var test2Api = test1.split(\"/\").find(part => !!part);", 5693 "", 5694 "pm.test(\"Responds with one test failed\", function () {", 5695 " pm.expect(Object.keys(jsonData)).to.have.lengthOf(2);", 5696 " var api = Object.keys(jsonData)[0];", 5697 " if (api === test1Api) {", 5698 " pm.expect(jsonData[api].pass).to.equal(0);", 5699 " pm.expect(jsonData[api].fail).to.equal(1);", 5700 " } else {", 5701 " pm.expect(jsonData[api].pass).to.equal(1);", 5702 " pm.expect(jsonData[api].fail).to.equal(0);", 5703 " }", 5704 " pm.expect(jsonData[api].timeout).to.equal(0);", 5705 " pm.expect(jsonData[api].not_run).to.equal(0);", 5706 " api = Object.keys(jsonData)[1];", 5707 " if (api === test1Api) {", 5708 " pm.expect(jsonData[api].pass).to.equal(0);", 5709 " pm.expect(jsonData[api].fail).to.equal(1);", 5710 " } else {", 5711 " pm.expect(jsonData[api].pass).to.equal(1);", 5712 " pm.expect(jsonData[api].fail).to.equal(0);", 5713 " }", 5714 " pm.expect(jsonData[api].timeout).to.equal(0);", 5715 " pm.expect(jsonData[api].not_run).to.equal(0);", 5716 "});" 5717 ], 5718 "type": "text/javascript" 5719 } 5720 } 5721 ], 5722 "request": { 5723 "method": "GET", 5724 "header": [], 5725 "url": { 5726 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/compact", 5727 "protocol": "{{protocol}}", 5728 "host": [ 5729 "{{host}}" 5730 ], 5731 "port": "{{port}}", 5732 "path": [ 5733 "{{web_root}}", 5734 "api", 5735 "results", 5736 "{{session_token}}", 5737 "compact" 5738 ] 5739 } 5740 }, 5741 "response": [] 5742 }, 5743 { 5744 "name": "Read Next Test of Session", 5745 "event": [ 5746 { 5747 "listen": "test", 5748 "script": { 5749 "id": "132574dc-3688-47e3-8f50-3235f18806f7", 5750 "exec": [ 5751 "pm.test(\"Status code is 200\", function () {", 5752 " pm.response.to.have.status(200);", 5753 "});", 5754 "", 5755 "const response = pm.response.json();", 5756 "", 5757 "pm.test(\"JSON structure is as expected\", function () {", 5758 " pm.expect(Object.keys(response)).to.have.lengthOf(1);", 5759 " pm.expect(response).to.have.property(\"next_test\");", 5760 " pm.expect(typeof response.next_test).to.equal(\"string\");", 5761 "});", 5762 "", 5763 "const nextTest = response.next_test;", 5764 "pm.globals.set(\"current_test_url\", nextTest);", 5765 "if (!nextTest) return;", 5766 "const test = \"/\" + nextTest.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 5767 "pm.globals.set(\"current_test\", test);", 5768 "", 5769 "const web_root = pm.environment.get(\"web_root\");", 5770 "", 5771 "pm.test(\"Returned test finish page\", function () {", 5772 " pm.expect(test).to.equal(\"/\" + web_root + \"/finish.html\");", 5773 "});" 5774 ], 5775 "type": "text/javascript" 5776 } 5777 } 5778 ], 5779 "request": { 5780 "method": "GET", 5781 "header": [], 5782 "url": { 5783 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 5784 "protocol": "{{protocol}}", 5785 "host": [ 5786 "{{host}}" 5787 ], 5788 "port": "{{port}}", 5789 "path": [ 5790 "{{web_root}}", 5791 "api", 5792 "tests", 5793 "{{session_token}}", 5794 "next" 5795 ] 5796 } 5797 }, 5798 "response": [] 5799 } 5800 ], 5801 "protocolProfileBehavior": {}, 5802 "_postman_isSubFolder": true 5803 }, 5804 { 5805 "name": "Clean Up", 5806 "item": [ 5807 { 5808 "name": "Delete Session", 5809 "request": { 5810 "method": "DELETE", 5811 "header": [], 5812 "url": { 5813 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 5814 "protocol": "{{protocol}}", 5815 "host": [ 5816 "{{host}}" 5817 ], 5818 "port": "{{port}}", 5819 "path": [ 5820 "{{web_root}}", 5821 "api", 5822 "sessions", 5823 "{{session_token}}" 5824 ] 5825 } 5826 }, 5827 "response": [] 5828 } 5829 ], 5830 "protocolProfileBehavior": {}, 5831 "_postman_isSubFolder": true 5832 } 5833 ], 5834 "protocolProfileBehavior": {} 5835 }, 5836 { 5837 "name": "Viewing and Downloading Reports", 5838 "item": [ 5839 { 5840 "name": "Create Sessions", 5841 "item": [ 5842 { 5843 "name": "First Session", 5844 "item": [ 5845 { 5846 "name": "Create Session One Tests", 5847 "event": [ 5848 { 5849 "listen": "test", 5850 "script": { 5851 "id": "2f233dcf-d934-4479-8908-b1349e6ea54d", 5852 "exec": [ 5853 "pm.test(\"Status code is 200\", function () {", 5854 " pm.response.to.have.status(200);", 5855 "});", 5856 "", 5857 "const response = pm.response.json();", 5858 "const token = response.token;", 5859 "pm.globals.set(\"session_token\", token);" 5860 ], 5861 "type": "text/javascript" 5862 } 5863 }, 5864 { 5865 "listen": "prerequest", 5866 "script": { 5867 "id": "2930a821-2c6e-47b9-89d9-90ebe1cff52a", 5868 "exec": [ 5869 "const availableTests = JSON.parse(pm.globals.get(\"available_tests\"));", 5870 "const keys = Object.keys(availableTests).sort();", 5871 "const test1 = availableTests[keys[0]][0];", 5872 "const test2 = availableTests[keys[1]][0];", 5873 "const apiName = test1.split(\"/\").find(part => !!part);", 5874 "", 5875 "pm.globals.set(\"single_test_1\", test1);", 5876 "pm.globals.set(\"single_test_2\", test2);", 5877 "pm.globals.set(\"api_name\", apiName);" 5878 ], 5879 "type": "text/javascript" 5880 } 5881 } 5882 ], 5883 "request": { 5884 "method": "POST", 5885 "header": [ 5886 { 5887 "key": "Content-Type", 5888 "name": "Content-Type", 5889 "type": "text", 5890 "value": "application/json" 5891 } 5892 ], 5893 "body": { 5894 "mode": "raw", 5895 "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test_1}}\"]\n }\n}" 5896 }, 5897 "url": { 5898 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 5899 "protocol": "{{protocol}}", 5900 "host": [ 5901 "{{host}}" 5902 ], 5903 "port": "{{port}}", 5904 "path": [ 5905 "{{web_root}}", 5906 "api", 5907 "sessions" 5908 ] 5909 } 5910 }, 5911 "response": [] 5912 }, 5913 { 5914 "name": "Start Session", 5915 "event": [ 5916 { 5917 "listen": "test", 5918 "script": { 5919 "id": "12f3616b-707e-4a71-8db8-89fc195c1fcd", 5920 "exec": [ 5921 "pm.test(\"Status code is 200\", function () {", 5922 " pm.response.to.have.status(200);", 5923 "});" 5924 ], 5925 "type": "text/javascript" 5926 } 5927 } 5928 ], 5929 "request": { 5930 "method": "POST", 5931 "header": [], 5932 "url": { 5933 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 5934 "protocol": "{{protocol}}", 5935 "host": [ 5936 "{{host}}" 5937 ], 5938 "port": "{{port}}", 5939 "path": [ 5940 "{{web_root}}", 5941 "api", 5942 "sessions", 5943 "{{session_token}}", 5944 "start" 5945 ] 5946 } 5947 }, 5948 "response": [] 5949 }, 5950 { 5951 "name": "Read Next Test of Session", 5952 "event": [ 5953 { 5954 "listen": "test", 5955 "script": { 5956 "id": "f35f1509-383f-49af-a30e-41e1df4efa04", 5957 "exec": [ 5958 "pm.test(\"Status code is 200\", function () {", 5959 " pm.response.to.have.status(200);", 5960 "});", 5961 "", 5962 "const response = pm.response.json();", 5963 "", 5964 "const nextTest = response.next_test;", 5965 "pm.globals.set(\"current_test_url\", nextTest);", 5966 "if (!nextTest) return;", 5967 "", 5968 "const parameters = nextTest.split(\"?\")[1].split(\"&\");", 5969 "let test = parameters.find(parameter => parameter.split(\"=\")[0] === \"test_url\").split(\"=\")[1];", 5970 "test = decodeURIComponent(test);", 5971 "test = \"/\" + test.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 5972 "", 5973 "pm.globals.set(\"current_test\", test);", 5974 "" 5975 ], 5976 "type": "text/javascript" 5977 } 5978 } 5979 ], 5980 "request": { 5981 "method": "GET", 5982 "header": [], 5983 "url": { 5984 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 5985 "protocol": "{{protocol}}", 5986 "host": [ 5987 "{{host}}" 5988 ], 5989 "port": "{{port}}", 5990 "path": [ 5991 "{{web_root}}", 5992 "api", 5993 "tests", 5994 "{{session_token}}", 5995 "next" 5996 ] 5997 } 5998 }, 5999 "response": [] 6000 }, 6001 { 6002 "name": "Create Result", 6003 "event": [ 6004 { 6005 "listen": "test", 6006 "script": { 6007 "id": "b015f161-e390-4224-9f26-92395f44c772", 6008 "exec": [ 6009 "pm.test(\"Status code is 200\", function () {", 6010 " pm.response.to.have.status(200);", 6011 "});" 6012 ], 6013 "type": "text/javascript" 6014 } 6015 } 6016 ], 6017 "request": { 6018 "method": "POST", 6019 "header": [ 6020 { 6021 "key": "Content-Type", 6022 "name": "Content-Type", 6023 "value": "application/json", 6024 "type": "text" 6025 } 6026 ], 6027 "body": { 6028 "mode": "raw", 6029 "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" 6030 }, 6031 "url": { 6032 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 6033 "protocol": "{{protocol}}", 6034 "host": [ 6035 "{{host}}" 6036 ], 6037 "port": "{{port}}", 6038 "path": [ 6039 "{{web_root}}", 6040 "api", 6041 "results", 6042 "{{session_token}}" 6043 ] 6044 } 6045 }, 6046 "response": [] 6047 } 6048 ], 6049 "protocolProfileBehavior": {}, 6050 "_postman_isSubFolder": true 6051 }, 6052 { 6053 "name": "Second Session", 6054 "item": [ 6055 { 6056 "name": "Create Session One Tests", 6057 "event": [ 6058 { 6059 "listen": "test", 6060 "script": { 6061 "id": "da3d0c17-6b2b-4d61-ad01-dba736425388", 6062 "exec": [ 6063 "pm.test(\"Status code is 200\", function () {", 6064 " pm.response.to.have.status(200);", 6065 "});", 6066 "", 6067 "const response = pm.response.json();", 6068 "const token = response.token;", 6069 "pm.globals.set(\"session_token_comp\", token);" 6070 ], 6071 "type": "text/javascript" 6072 } 6073 }, 6074 { 6075 "listen": "prerequest", 6076 "script": { 6077 "id": "7da81e81-d344-4459-b700-19b93d49d3c9", 6078 "exec": [ 6079 "const availableTests = JSON.parse(pm.globals.get(\"available_tests\"));", 6080 "const keys = Object.keys(availableTests).sort();", 6081 "const test1 = availableTests[keys[0]][0];", 6082 "", 6083 "pm.globals.set(\"single_test_1\", test1);" 6084 ], 6085 "type": "text/javascript" 6086 } 6087 } 6088 ], 6089 "request": { 6090 "method": "POST", 6091 "header": [ 6092 { 6093 "key": "Content-Type", 6094 "name": "Content-Type", 6095 "type": "text", 6096 "value": "application/json" 6097 } 6098 ], 6099 "body": { 6100 "mode": "raw", 6101 "raw": "{\n \"tests\": {\n \"include\": [\"{{single_test_1}}\"]\n }\n}" 6102 }, 6103 "url": { 6104 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 6105 "protocol": "{{protocol}}", 6106 "host": [ 6107 "{{host}}" 6108 ], 6109 "port": "{{port}}", 6110 "path": [ 6111 "{{web_root}}", 6112 "api", 6113 "sessions" 6114 ] 6115 } 6116 }, 6117 "response": [] 6118 }, 6119 { 6120 "name": "Start Session", 6121 "event": [ 6122 { 6123 "listen": "test", 6124 "script": { 6125 "id": "3296c7ba-67a6-405d-a78a-51dd64432301", 6126 "exec": [ 6127 "pm.test(\"Status code is 200\", function () {", 6128 " pm.response.to.have.status(200);", 6129 "});" 6130 ], 6131 "type": "text/javascript" 6132 } 6133 } 6134 ], 6135 "request": { 6136 "method": "POST", 6137 "header": [], 6138 "url": { 6139 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token_comp}}/start", 6140 "protocol": "{{protocol}}", 6141 "host": [ 6142 "{{host}}" 6143 ], 6144 "port": "{{port}}", 6145 "path": [ 6146 "{{web_root}}", 6147 "api", 6148 "sessions", 6149 "{{session_token_comp}}", 6150 "start" 6151 ] 6152 } 6153 }, 6154 "response": [] 6155 }, 6156 { 6157 "name": "Read Next Test of Session", 6158 "event": [ 6159 { 6160 "listen": "test", 6161 "script": { 6162 "id": "72deb55c-4583-4741-9cf8-97713762b894", 6163 "exec": [ 6164 "pm.test(\"Status code is 200\", function () {", 6165 " pm.response.to.have.status(200);", 6166 "});", 6167 "", 6168 "const response = pm.response.json();", 6169 "", 6170 "const nextTest = response.next_test;", 6171 "pm.globals.set(\"current_test_url\", nextTest);", 6172 "if (!nextTest) return;", 6173 "", 6174 "const parameters = nextTest.split(\"?\")[1].split(\"&\");", 6175 "let test = parameters.find(parameter => parameter.split(\"=\")[0] === \"test_url\").split(\"=\")[1];", 6176 "test = decodeURIComponent(test);", 6177 "test = \"/\" + test.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 6178 "", 6179 "pm.globals.set(\"current_test\", test);", 6180 "" 6181 ], 6182 "type": "text/javascript" 6183 } 6184 } 6185 ], 6186 "request": { 6187 "method": "GET", 6188 "header": [], 6189 "url": { 6190 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token_comp}}/next", 6191 "protocol": "{{protocol}}", 6192 "host": [ 6193 "{{host}}" 6194 ], 6195 "port": "{{port}}", 6196 "path": [ 6197 "{{web_root}}", 6198 "api", 6199 "tests", 6200 "{{session_token_comp}}", 6201 "next" 6202 ] 6203 } 6204 }, 6205 "response": [] 6206 }, 6207 { 6208 "name": "Create Result", 6209 "event": [ 6210 { 6211 "listen": "test", 6212 "script": { 6213 "id": "d695f300-a773-4654-b346-95c536cad19e", 6214 "exec": [ 6215 "pm.test(\"Status code is 200\", function () {", 6216 " pm.response.to.have.status(200);", 6217 "});" 6218 ], 6219 "type": "text/javascript" 6220 } 6221 } 6222 ], 6223 "request": { 6224 "method": "POST", 6225 "header": [ 6226 { 6227 "key": "Content-Type", 6228 "name": "Content-Type", 6229 "value": "application/json", 6230 "type": "text" 6231 } 6232 ], 6233 "body": { 6234 "mode": "raw", 6235 "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" 6236 }, 6237 "url": { 6238 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token_comp}}", 6239 "protocol": "{{protocol}}", 6240 "host": [ 6241 "{{host}}" 6242 ], 6243 "port": "{{port}}", 6244 "path": [ 6245 "{{web_root}}", 6246 "api", 6247 "results", 6248 "{{session_token_comp}}" 6249 ] 6250 } 6251 }, 6252 "response": [] 6253 } 6254 ], 6255 "protocolProfileBehavior": {}, 6256 "_postman_isSubFolder": true 6257 } 6258 ], 6259 "protocolProfileBehavior": {}, 6260 "_postman_isSubFolder": true 6261 }, 6262 { 6263 "name": "Download reports", 6264 "item": [ 6265 { 6266 "name": "Download Results Overview", 6267 "event": [ 6268 { 6269 "listen": "test", 6270 "script": { 6271 "id": "6838965f-7a27-48d5-8c27-f55d4756588f", 6272 "exec": [ 6273 "pm.test(\"Status code is 200\", function () {", 6274 " pm.response.to.have.status(200);", 6275 "});" 6276 ], 6277 "type": "text/javascript" 6278 } 6279 } 6280 ], 6281 "request": { 6282 "method": "GET", 6283 "header": [], 6284 "url": { 6285 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/overview", 6286 "protocol": "{{protocol}}", 6287 "host": [ 6288 "{{host}}" 6289 ], 6290 "port": "{{port}}", 6291 "path": [ 6292 "{{web_root}}", 6293 "api", 6294 "results", 6295 "{{session_token}}", 6296 "overview" 6297 ] 6298 } 6299 }, 6300 "response": [] 6301 }, 6302 { 6303 "name": "Download All Apis Json", 6304 "event": [ 6305 { 6306 "listen": "test", 6307 "script": { 6308 "id": "bcc2c8c4-94c0-4227-a627-3e0d5be2e7b8", 6309 "exec": [ 6310 "pm.test(\"Status code is 200\", function () {", 6311 " pm.response.to.have.status(200);", 6312 "});" 6313 ], 6314 "type": "text/javascript" 6315 } 6316 } 6317 ], 6318 "request": { 6319 "method": "GET", 6320 "header": [], 6321 "url": { 6322 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/json", 6323 "protocol": "{{protocol}}", 6324 "host": [ 6325 "{{host}}" 6326 ], 6327 "port": "{{port}}", 6328 "path": [ 6329 "{{web_root}}", 6330 "api", 6331 "results", 6332 "{{session_token}}", 6333 "json" 6334 ] 6335 } 6336 }, 6337 "response": [] 6338 }, 6339 { 6340 "name": "Download WPT Multi Report Url", 6341 "event": [ 6342 { 6343 "listen": "test", 6344 "script": { 6345 "id": "7b370723-0506-4b5e-941a-f31a628a29f6", 6346 "exec": [ 6347 "pm.test(\"Status code is 200\", function () {", 6348 " pm.response.to.have.status(200);", 6349 "});", 6350 "", 6351 "pm.test(\"Uri returned\", function () {", 6352 " var jsonData = pm.response.json();", 6353 " pm.expect(typeof jsonData.uri).to.equal(\"string\");", 6354 "});" 6355 ], 6356 "type": "text/javascript" 6357 } 6358 } 6359 ], 6360 "request": { 6361 "method": "GET", 6362 "header": [], 6363 "url": { 6364 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{api_name}}/reporturl?tokens={{session_token}},{{session_token_comp}}", 6365 "protocol": "{{protocol}}", 6366 "host": [ 6367 "{{host}}" 6368 ], 6369 "port": "{{port}}", 6370 "path": [ 6371 "{{web_root}}", 6372 "api", 6373 "results", 6374 "{{api_name}}", 6375 "reporturl" 6376 ], 6377 "query": [ 6378 { 6379 "key": "tokens", 6380 "value": "{{session_token}},{{session_token_comp}}" 6381 } 6382 ] 6383 } 6384 }, 6385 "response": [] 6386 }, 6387 { 6388 "name": "Download Results Api Json", 6389 "event": [ 6390 { 6391 "listen": "test", 6392 "script": { 6393 "id": "b5243979-b63a-4bbf-bd51-1529da1e1f6d", 6394 "exec": [ 6395 "pm.test(\"Status code is 200\", function () {", 6396 " pm.response.to.have.status(200);", 6397 "});" 6398 ], 6399 "type": "text/javascript" 6400 } 6401 }, 6402 { 6403 "listen": "prerequest", 6404 "script": { 6405 "id": "81f3da29-8a0c-4403-929d-86590b01ef2f", 6406 "exec": [ 6407 "" 6408 ], 6409 "type": "text/javascript" 6410 } 6411 } 6412 ], 6413 "request": { 6414 "method": "GET", 6415 "header": [], 6416 "url": { 6417 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/{{api_name}}/json", 6418 "protocol": "{{protocol}}", 6419 "host": [ 6420 "{{host}}" 6421 ], 6422 "port": "{{port}}", 6423 "path": [ 6424 "{{web_root}}", 6425 "api", 6426 "results", 6427 "{{session_token}}", 6428 "{{api_name}}", 6429 "json" 6430 ] 6431 } 6432 }, 6433 "response": [] 6434 }, 6435 { 6436 "name": "Download WPT Report Copy", 6437 "event": [ 6438 { 6439 "listen": "test", 6440 "script": { 6441 "id": "0168ea3f-9bf7-4ea7-a3ad-745c2704d97e", 6442 "exec": [ 6443 "pm.test(\"Status code is 200\", function () {", 6444 " pm.response.to.have.status(200);", 6445 "});", 6446 "", 6447 "pm.test(\"Uri returned\", function () {", 6448 " var jsonData = pm.response.json();", 6449 " pm.expect(typeof jsonData.uri).to.equal(\"string\");", 6450 "});" 6451 ], 6452 "type": "text/javascript" 6453 } 6454 }, 6455 { 6456 "listen": "prerequest", 6457 "script": { 6458 "id": "e4efdac9-2d00-4853-b145-18a6d44ff139", 6459 "exec": [ 6460 "" 6461 ], 6462 "type": "text/javascript" 6463 } 6464 } 6465 ], 6466 "request": { 6467 "method": "GET", 6468 "header": [], 6469 "url": { 6470 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/{{api_name}}/reporturl", 6471 "protocol": "{{protocol}}", 6472 "host": [ 6473 "{{host}}" 6474 ], 6475 "port": "{{port}}", 6476 "path": [ 6477 "{{web_root}}", 6478 "api", 6479 "results", 6480 "{{session_token}}", 6481 "{{api_name}}", 6482 "reporturl" 6483 ] 6484 } 6485 }, 6486 "response": [] 6487 } 6488 ], 6489 "protocolProfileBehavior": {}, 6490 "_postman_isSubFolder": true 6491 } 6492 ], 6493 "protocolProfileBehavior": {} 6494 }, 6495 { 6496 "name": "Malfunctioning List", 6497 "item": [ 6498 { 6499 "name": "Create Session \\w Configuration Copy", 6500 "event": [ 6501 { 6502 "listen": "test", 6503 "script": { 6504 "id": "e685a989-8ef7-4e8f-a3c7-b579c66430f9", 6505 "exec": [ 6506 "pm.test(\"Status code is 200\", function () {", 6507 " pm.response.to.have.status(200);", 6508 "});", 6509 "", 6510 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 6511 "", 6512 "pm.test(\"Responds with token in JSON format\", function () {", 6513 " var jsonData = pm.response.json();", 6514 " pm.expect(jsonData).to.have.property(\"token\");", 6515 " pm.expect(jsonData.token).to.match(tokenRegex);", 6516 "});", 6517 "", 6518 "", 6519 "const response = pm.response.json();", 6520 "const token = response.token;", 6521 "pm.globals.set(\"session_token\", token);" 6522 ], 6523 "type": "text/javascript" 6524 } 6525 }, 6526 { 6527 "listen": "prerequest", 6528 "script": { 6529 "id": "8517360b-2e66-4ca9-9339-017622c39888", 6530 "exec": [ 6531 "var automaticTimeout = 120000;", 6532 "var manualTimeout = 1000000;", 6533 "var specialTimeout = 2000;", 6534 "", 6535 "pm.globals.set(\"automatic_timeout\", automaticTimeout);", 6536 "pm.globals.set(\"manual_timeout\", manualTimeout);", 6537 "pm.globals.set(\"special_timeout\", specialTimeout);" 6538 ], 6539 "type": "text/javascript" 6540 } 6541 } 6542 ], 6543 "request": { 6544 "method": "POST", 6545 "header": [ 6546 { 6547 "key": "Content-Type", 6548 "name": "Content-Type", 6549 "type": "text", 6550 "value": "application/json" 6551 } 6552 ], 6553 "body": { 6554 "mode": "raw", 6555 "raw": "{\n \"tests\": {\n \"include\": {{included_tests}},\n \"exclude\": {{excluded_tests}}\n },\n \"types\": [\n \"automatic\"\n ],\n \"timeouts\": {\n \"automatic\": {{automatic_timeout}},\n \"manual\": {{manual_timeout}},\n \"{{special_timeout_test}}\": {{special_timeout}}\n },\n \"labels\": [\"label1\", \"label2\"]\n}" 6556 }, 6557 "url": { 6558 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 6559 "protocol": "{{protocol}}", 6560 "host": [ 6561 "{{host}}" 6562 ], 6563 "port": "{{port}}", 6564 "path": [ 6565 "{{web_root}}", 6566 "api", 6567 "sessions" 6568 ] 6569 } 6570 }, 6571 "response": [] 6572 }, 6573 { 6574 "name": "Read Session Malfunctioning Empty", 6575 "event": [ 6576 { 6577 "listen": "test", 6578 "script": { 6579 "id": "4e85ecaf-4364-4681-ab8a-221d40681c44", 6580 "exec": [ 6581 "pm.test(\"Status code is 200\", function () {", 6582 " pm.response.to.have.status(200);", 6583 "});", 6584 "", 6585 "var jsonData = pm.response.json();", 6586 "", 6587 "pm.test(\"Return empty array\", function() {", 6588 " pm.expect(jsonData).to.be.an.instanceof(Array)", 6589 " pm.expect(jsonData).to.have.length(0)", 6590 "})" 6591 ], 6592 "type": "text/javascript" 6593 } 6594 } 6595 ], 6596 "request": { 6597 "method": "GET", 6598 "header": [], 6599 "url": { 6600 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", 6601 "protocol": "{{protocol}}", 6602 "host": [ 6603 "{{host}}" 6604 ], 6605 "port": "{{port}}", 6606 "path": [ 6607 "{{web_root}}", 6608 "api", 6609 "tests", 6610 "{{session_token}}", 6611 "malfunctioning" 6612 ] 6613 } 6614 }, 6615 "response": [] 6616 }, 6617 { 6618 "name": "Update Session Malfunctioning Insert Two", 6619 "event": [ 6620 { 6621 "listen": "test", 6622 "script": { 6623 "id": "a6221560-9eba-4fb4-a7cb-a1570a37425d", 6624 "exec": [ 6625 "pm.test(\"Status code is 200\", function () {", 6626 " pm.response.to.have.status(200);", 6627 "});" 6628 ], 6629 "type": "text/javascript" 6630 } 6631 } 6632 ], 6633 "request": { 6634 "method": "PUT", 6635 "header": [ 6636 { 6637 "key": "Content-Type", 6638 "name": "Content-Type", 6639 "value": "application/json", 6640 "type": "text" 6641 } 6642 ], 6643 "body": { 6644 "mode": "raw", 6645 "raw": "[\n\t\"/test/file/one.html\",\n\t\"/test/file/two.html\"\n]", 6646 "options": { 6647 "raw": { 6648 "language": "json" 6649 } 6650 } 6651 }, 6652 "url": { 6653 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", 6654 "protocol": "{{protocol}}", 6655 "host": [ 6656 "{{host}}" 6657 ], 6658 "port": "{{port}}", 6659 "path": [ 6660 "{{web_root}}", 6661 "api", 6662 "tests", 6663 "{{session_token}}", 6664 "malfunctioning" 6665 ] 6666 } 6667 }, 6668 "response": [] 6669 }, 6670 { 6671 "name": "Read Session Malfunctioning Two Tests", 6672 "event": [ 6673 { 6674 "listen": "test", 6675 "script": { 6676 "id": "77d14567-4600-44fd-98e4-99e113da6781", 6677 "exec": [ 6678 "pm.test(\"Status code is 200\", function () {", 6679 " pm.response.to.have.status(200);", 6680 "});", 6681 "", 6682 "var jsonData = pm.response.json();", 6683 "", 6684 "pm.test(\"Return array with two tests\", function() {", 6685 " pm.expect(jsonData).to.be.an.instanceof(Array)", 6686 " pm.expect(jsonData).to.have.length(2)", 6687 " pm.expect(jsonData).to.include(\"/test/file/one.html\")", 6688 " pm.expect(jsonData).to.include(\"/test/file/two.html\")", 6689 "})" 6690 ], 6691 "type": "text/javascript" 6692 } 6693 } 6694 ], 6695 "request": { 6696 "method": "GET", 6697 "header": [], 6698 "url": { 6699 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", 6700 "protocol": "{{protocol}}", 6701 "host": [ 6702 "{{host}}" 6703 ], 6704 "port": "{{port}}", 6705 "path": [ 6706 "{{web_root}}", 6707 "api", 6708 "tests", 6709 "{{session_token}}", 6710 "malfunctioning" 6711 ] 6712 } 6713 }, 6714 "response": [] 6715 }, 6716 { 6717 "name": "Update Session Malfunctioning Empty Array", 6718 "event": [ 6719 { 6720 "listen": "test", 6721 "script": { 6722 "id": "55b486da-c5ae-49d4-b11a-247387267c9a", 6723 "exec": [ 6724 "pm.test(\"Status code is 200\", function () {", 6725 " pm.response.to.have.status(200);", 6726 "});" 6727 ], 6728 "type": "text/javascript" 6729 } 6730 } 6731 ], 6732 "request": { 6733 "method": "PUT", 6734 "header": [ 6735 { 6736 "key": "Content-Type", 6737 "name": "Content-Type", 6738 "type": "text", 6739 "value": "application/json" 6740 } 6741 ], 6742 "body": { 6743 "mode": "raw", 6744 "raw": "[]", 6745 "options": { 6746 "raw": { 6747 "language": "json" 6748 } 6749 } 6750 }, 6751 "url": { 6752 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", 6753 "protocol": "{{protocol}}", 6754 "host": [ 6755 "{{host}}" 6756 ], 6757 "port": "{{port}}", 6758 "path": [ 6759 "{{web_root}}", 6760 "api", 6761 "tests", 6762 "{{session_token}}", 6763 "malfunctioning" 6764 ] 6765 } 6766 }, 6767 "response": [] 6768 }, 6769 { 6770 "name": "Read Session Malfunctioning Empty", 6771 "event": [ 6772 { 6773 "listen": "test", 6774 "script": { 6775 "id": "953002ec-d8df-477a-a0dc-f4e4a2efd031", 6776 "exec": [ 6777 "pm.test(\"Status code is 200\", function () {", 6778 " pm.response.to.have.status(200);", 6779 "});", 6780 "", 6781 "var jsonData = pm.response.json();", 6782 "", 6783 "pm.test(\"Return empty array\", function() {", 6784 " pm.expect(jsonData).to.be.an.instanceof(Array)", 6785 " pm.expect(jsonData).to.have.length(0)", 6786 "})" 6787 ], 6788 "type": "text/javascript" 6789 } 6790 } 6791 ], 6792 "request": { 6793 "method": "GET", 6794 "header": [], 6795 "url": { 6796 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/malfunctioning", 6797 "protocol": "{{protocol}}", 6798 "host": [ 6799 "{{host}}" 6800 ], 6801 "port": "{{port}}", 6802 "path": [ 6803 "{{web_root}}", 6804 "api", 6805 "tests", 6806 "{{session_token}}", 6807 "malfunctioning" 6808 ] 6809 } 6810 }, 6811 "response": [] 6812 } 6813 ], 6814 "protocolProfileBehavior": {} 6815 }, 6816 { 6817 "name": "Sessions API", 6818 "item": [ 6819 { 6820 "name": "create session", 6821 "item": [ 6822 { 6823 "name": "With Defaults", 6824 "item": [ 6825 { 6826 "name": "Prep: Read Available Tests", 6827 "event": [ 6828 { 6829 "listen": "test", 6830 "script": { 6831 "id": "fc15d329-d132-4abf-90e4-f549eee99b60", 6832 "exec": [ 6833 "pm.test(\"Status code is 200\", function () {", 6834 " pm.response.to.have.status(200);", 6835 "});", 6836 "", 6837 "var availableTests = pm.response.json();", 6838 "", 6839 "pm.test(\"JSON structure is as expected\", function () {", 6840 " pm.expect(typeof availableTests).to.equal(\"object\");", 6841 " for (var api of Object.keys(availableTests)) {", 6842 " pm.expect(availableTests[api]).to.be.an.instanceof(Array);", 6843 " var apiRegExp = new RegExp(\"^/\" + api, \"i\");", 6844 " for (var test of availableTests[api]) {", 6845 " pm.expect(test).to.match(apiRegExp);", 6846 " }", 6847 " }", 6848 "});", 6849 "", 6850 "var includedTests = [];", 6851 "var excludedTests = [];", 6852 "var specialTimeoutTest = \"\";", 6853 "", 6854 "var apis = Object.keys(availableTests);", 6855 "for(var api of apis) {", 6856 " if (availableTests[api].length > 50) {", 6857 " var subDirs = availableTests[api].map(test => test.split(\"/\").filter(part => !!part).join(\"/\").split(\"/\")[1]).reduce((acc, curr) => acc.indexOf(curr) === -1 ? acc.concat([curr]) : acc, []);", 6858 " if (subDirs.length > 2) {", 6859 " includedTests.push(\"/\" + api);", 6860 " excludedTests.push(\"/\" + api + \"/\" + subDirs[0]);", 6861 " specialTimeoutTest = availableTests[api][availableTests[api].length - 1];", 6862 " break;", 6863 " }", 6864 " ", 6865 " }", 6866 "}", 6867 "", 6868 "pm.globals.set(\"available_tests\", availableTests);", 6869 "pm.globals.set(\"included_tests\", JSON.stringify(includedTests));", 6870 "pm.globals.set(\"excluded_tests\", JSON.stringify(excludedTests));", 6871 "pm.globals.set(\"special_timeout_test\", specialTimeoutTest.replace(\".\", \"\"));" 6872 ], 6873 "type": "text/javascript" 6874 } 6875 } 6876 ], 6877 "request": { 6878 "method": "GET", 6879 "header": [], 6880 "url": { 6881 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests", 6882 "protocol": "{{protocol}}", 6883 "host": [ 6884 "{{host}}" 6885 ], 6886 "port": "{{port}}", 6887 "path": [ 6888 "{{web_root}}", 6889 "api", 6890 "tests" 6891 ] 6892 } 6893 }, 6894 "response": [] 6895 }, 6896 { 6897 "name": "Create Session No Configuration", 6898 "event": [ 6899 { 6900 "listen": "test", 6901 "script": { 6902 "id": "ebb192ce-48e5-4aac-b99d-68894378eac8", 6903 "exec": [ 6904 "pm.test(\"Status code is 200\", function () {", 6905 " pm.response.to.have.status(200);", 6906 "});", 6907 "", 6908 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 6909 "", 6910 "pm.test(\"Responds with token in JSON format\", function () {", 6911 " var jsonData = pm.response.json();", 6912 " pm.expect(jsonData).to.have.property(\"token\");", 6913 " pm.expect(jsonData.token).to.match(tokenRegex);", 6914 "});", 6915 "", 6916 "", 6917 "const response = pm.response.json();", 6918 "const token = response.token;", 6919 "pm.globals.set(\"session_token\", token);" 6920 ], 6921 "type": "text/javascript" 6922 } 6923 } 6924 ], 6925 "request": { 6926 "method": "POST", 6927 "header": [ 6928 { 6929 "key": "Content-Type", 6930 "name": "Content-Type", 6931 "type": "text", 6932 "value": "application/json" 6933 } 6934 ], 6935 "body": { 6936 "mode": "raw", 6937 "raw": "" 6938 }, 6939 "url": { 6940 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 6941 "protocol": "{{protocol}}", 6942 "host": [ 6943 "{{host}}" 6944 ], 6945 "port": "{{port}}", 6946 "path": [ 6947 "{{web_root}}", 6948 "api", 6949 "sessions" 6950 ] 6951 } 6952 }, 6953 "response": [] 6954 }, 6955 { 6956 "name": "Read Session Configuration", 6957 "event": [ 6958 { 6959 "listen": "test", 6960 "script": { 6961 "id": "159976cd-de00-4f88-8f9f-47db13ca4a30", 6962 "exec": [ 6963 "pm.test(\"Status code is 200\", function () {", 6964 " pm.response.to.have.status(200);", 6965 "});", 6966 "", 6967 "var jsonData = pm.response.json();", 6968 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 6969 "", 6970 "pm.test(\"Configuration is default\", function () {", 6971 " pm.expect(jsonData.token).to.match(tokenRegex);", 6972 " pm.expect(jsonData.tests.include).to.include(\"/\");", 6973 " pm.expect(jsonData.types).to.include(\"automatic\");", 6974 " pm.expect(jsonData.types).to.include(\"manual\");", 6975 " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", 6976 " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", 6977 " pm.expect(jsonData.timeouts.manual).to.equal(300000);", 6978 " pm.expect(jsonData.browser.name).to.equal(\"Other\");", 6979 " pm.expect(jsonData.browser.version).to.equal(\"0\");", 6980 " pm.expect(jsonData.is_public).to.equal(false);", 6981 " pm.expect(jsonData.reference_tokens).to.be.empty;", 6982 " pm.expect(jsonData.labels).to.be.empty;", 6983 " pm.expect(new Date(jsonData.date_created).getTime()).to.be.below(Date.now());", 6984 "});" 6985 ], 6986 "type": "text/javascript" 6987 } 6988 } 6989 ], 6990 "request": { 6991 "method": "GET", 6992 "header": [], 6993 "url": { 6994 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 6995 "protocol": "{{protocol}}", 6996 "host": [ 6997 "{{host}}" 6998 ], 6999 "port": "{{port}}", 7000 "path": [ 7001 "{{web_root}}", 7002 "api", 7003 "sessions", 7004 "{{session_token}}" 7005 ] 7006 } 7007 }, 7008 "response": [] 7009 }, 7010 { 7011 "name": "Read Session Status", 7012 "event": [ 7013 { 7014 "listen": "test", 7015 "script": { 7016 "id": "5058b07b-5e55-44e0-ad88-5c7b5884fa3c", 7017 "exec": [ 7018 "pm.test(\"Status code is 200\", function () {", 7019 " pm.response.to.have.status(200);", 7020 "});", 7021 "", 7022 "", 7023 "var jsonData = pm.response.json();", 7024 "", 7025 "pm.test(\"Session status is pending\", function () {", 7026 " pm.expect(jsonData.status).to.equal(\"pending\");", 7027 "})", 7028 "", 7029 "pm.test(\"Start, Finish and Expiration date not set\", function () {", 7030 " pm.expect(jsonData.date_started).to.be.null;", 7031 " pm.expect(jsonData.date_finished).to.be.null;", 7032 " pm.expect(jsonData.expiration_date).to.be.null;", 7033 "});" 7034 ], 7035 "type": "text/javascript" 7036 } 7037 } 7038 ], 7039 "request": { 7040 "method": "GET", 7041 "header": [], 7042 "url": { 7043 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 7044 "protocol": "{{protocol}}", 7045 "host": [ 7046 "{{host}}" 7047 ], 7048 "port": "{{port}}", 7049 "path": [ 7050 "{{web_root}}", 7051 "api", 7052 "sessions", 7053 "{{session_token}}", 7054 "status" 7055 ] 7056 } 7057 }, 7058 "response": [] 7059 }, 7060 { 7061 "name": "Read Tests of Session", 7062 "event": [ 7063 { 7064 "listen": "test", 7065 "script": { 7066 "id": "62a8c853-bf0b-47b0-9cee-7611d2b48cde", 7067 "exec": [ 7068 "pm.test(\"Status code is 200\", function () {", 7069 " pm.response.to.have.status(200);", 7070 "});", 7071 "", 7072 "var jsonData = pm.response.json();", 7073 "", 7074 "pm.test(\"JSON structure is as expected\", function () {", 7075 " pm.expect(jsonData).to.have.property(\"token\");", 7076 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 7077 " pm.expect(jsonData).to.have.property(\"pending_tests\");", 7078 " pm.expect(typeof jsonData.pending_tests).to.equal(\"object\");", 7079 " pm.expect(jsonData).to.have.property(\"running_tests\");", 7080 " pm.expect(typeof jsonData.running_tests).to.equal(\"object\");", 7081 "});", 7082 "", 7083 "pm.test(\"All tests are pending tests\", function () {", 7084 " pm.expect(Object.keys(jsonData.pending_tests)).to.not.have.lengthOf(0);", 7085 " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", 7086 "})", 7087 "", 7088 "const availableTests = pm.globals.get(\"available_tests\");", 7089 "", 7090 "pm.test(\"All available tests are part of the session\", function () {", 7091 " for (var api of Object.keys(jsonData.pending_tests)) {", 7092 " for (var test of jsonData.pending_tests[api]) {", 7093 " pm.expect(availableTests[api]).to.include(test);", 7094 " }", 7095 " }", 7096 "})" 7097 ], 7098 "type": "text/javascript" 7099 } 7100 } 7101 ], 7102 "request": { 7103 "method": "GET", 7104 "header": [], 7105 "url": { 7106 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 7107 "protocol": "{{protocol}}", 7108 "host": [ 7109 "{{host}}" 7110 ], 7111 "port": "{{port}}", 7112 "path": [ 7113 "{{web_root}}", 7114 "api", 7115 "tests", 7116 "{{session_token}}" 7117 ] 7118 } 7119 }, 7120 "response": [] 7121 }, 7122 { 7123 "name": "Clean up: Delete session", 7124 "request": { 7125 "method": "DELETE", 7126 "header": [], 7127 "url": { 7128 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 7129 "protocol": "{{protocol}}", 7130 "host": [ 7131 "{{host}}" 7132 ], 7133 "port": "{{port}}", 7134 "path": [ 7135 "{{web_root}}", 7136 "api", 7137 "sessions", 7138 "{{session_token}}" 7139 ] 7140 } 7141 }, 7142 "response": [] 7143 } 7144 ], 7145 "event": [ 7146 { 7147 "listen": "prerequest", 7148 "script": { 7149 "id": "878420c3-575a-4194-9a72-cebe07823674", 7150 "type": "text/javascript", 7151 "exec": [ 7152 "" 7153 ] 7154 } 7155 }, 7156 { 7157 "listen": "test", 7158 "script": { 7159 "id": "6672030f-5a8a-4bea-9792-c24b980392e9", 7160 "type": "text/javascript", 7161 "exec": [ 7162 "" 7163 ] 7164 } 7165 } 7166 ], 7167 "protocolProfileBehavior": {}, 7168 "_postman_isSubFolder": true 7169 }, 7170 { 7171 "name": "With Configuration", 7172 "item": [ 7173 { 7174 "name": "Prep: Read Available Tests", 7175 "event": [ 7176 { 7177 "listen": "test", 7178 "script": { 7179 "id": "504b76ca-6870-443c-8c33-0cccc52cddae", 7180 "exec": [ 7181 "pm.test(\"Status code is 200\", function () {", 7182 " pm.response.to.have.status(200);", 7183 "});", 7184 "", 7185 "var availableTests = pm.response.json();", 7186 "", 7187 "pm.test(\"JSON structure is as expected\", function () {", 7188 " pm.expect(typeof availableTests).to.equal(\"object\");", 7189 " for (var api of Object.keys(availableTests)) {", 7190 " pm.expect(availableTests[api]).to.be.an.instanceof(Array);", 7191 " var apiRegExp = new RegExp(\"^/\" + api, \"i\");", 7192 " for (var test of availableTests[api]) {", 7193 " pm.expect(test).to.match(apiRegExp);", 7194 " }", 7195 " }", 7196 "});", 7197 "", 7198 "var includedTests = [];", 7199 "var excludedTests = [];", 7200 "var specialTimeoutTest = \"\";", 7201 "", 7202 "var apis = Object.keys(availableTests).sort();", 7203 "for(var api of apis) {", 7204 " if (availableTests[api].length > 50) {", 7205 " var subDirs = availableTests[api].map(test => test.split(\"/\").filter(part => !!part).join(\"/\").split(\"/\")[1]).reduce((acc, curr) => acc.indexOf(curr) === -1 ? acc.concat([curr]) : acc, []);", 7206 " if (subDirs.length > 2) {", 7207 " includedTests.push(\"/\" + api);", 7208 " excludedTests.push(\"/\" + api + \"/\" + subDirs[0]);", 7209 " specialTimeoutTest = availableTests[api][availableTests[api].length - 1];", 7210 " break;", 7211 " }", 7212 " ", 7213 " }", 7214 "}", 7215 "", 7216 "pm.globals.set(\"available_tests\", availableTests);", 7217 "pm.globals.set(\"included_tests\", JSON.stringify(includedTests));", 7218 "pm.globals.set(\"excluded_tests\", JSON.stringify(excludedTests));", 7219 "pm.globals.set(\"special_timeout_test\", specialTimeoutTest.replace(\".\", \"\"));" 7220 ], 7221 "type": "text/javascript" 7222 } 7223 } 7224 ], 7225 "request": { 7226 "method": "GET", 7227 "header": [], 7228 "url": { 7229 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests", 7230 "protocol": "{{protocol}}", 7231 "host": [ 7232 "{{host}}" 7233 ], 7234 "port": "{{port}}", 7235 "path": [ 7236 "{{web_root}}", 7237 "api", 7238 "tests" 7239 ] 7240 } 7241 }, 7242 "response": [] 7243 }, 7244 { 7245 "name": "Create Session \\w Configuration", 7246 "event": [ 7247 { 7248 "listen": "test", 7249 "script": { 7250 "id": "fa956871-503a-421c-9822-4e2a11e1cf1c", 7251 "exec": [ 7252 "pm.test(\"Status code is 200\", function () {", 7253 " pm.response.to.have.status(200);", 7254 "});", 7255 "", 7256 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 7257 "", 7258 "pm.test(\"Responds with token in JSON format\", function () {", 7259 " var jsonData = pm.response.json();", 7260 " pm.expect(jsonData).to.have.property(\"token\");", 7261 " pm.expect(jsonData.token).to.match(tokenRegex);", 7262 "});", 7263 "", 7264 "", 7265 "const response = pm.response.json();", 7266 "const token = response.token;", 7267 "pm.globals.set(\"session_token\", token);" 7268 ], 7269 "type": "text/javascript" 7270 } 7271 }, 7272 { 7273 "listen": "prerequest", 7274 "script": { 7275 "id": "213bdf59-9f98-4b5e-bacc-ae3cb31ae26a", 7276 "exec": [ 7277 "var automaticTimeout = 120000;", 7278 "var manualTimeout = 1000000;", 7279 "var specialTimeout = 2000;", 7280 "", 7281 "pm.globals.set(\"automatic_timeout\", automaticTimeout);", 7282 "pm.globals.set(\"manual_timeout\", manualTimeout);", 7283 "pm.globals.set(\"special_timeout\", specialTimeout);", 7284 "", 7285 "const availableTests = pm.globals.get(\"available_tests\");", 7286 "const apiNames = Object.keys(availableTests).sort();", 7287 "const apiName = apiNames[0];", 7288 "", 7289 "pm.globals.set(\"api_name\", apiName);", 7290 "pm.globals.set(\"special_timeout_test\", \"/\" + apiName);" 7291 ], 7292 "type": "text/javascript" 7293 } 7294 } 7295 ], 7296 "request": { 7297 "method": "POST", 7298 "header": [ 7299 { 7300 "key": "Content-Type", 7301 "name": "Content-Type", 7302 "type": "text", 7303 "value": "application/json" 7304 } 7305 ], 7306 "body": { 7307 "mode": "raw", 7308 "raw": "{\n \"tests\": {\n \"include\": [\"/{{api_name}}\"]\n },\n \"timeouts\": {\n \"automatic\": {{automatic_timeout}},\n \"manual\": {{manual_timeout}},\n \"{{special_timeout_test}}\": {{special_timeout}}\n },\n \"labels\": [\"label1\", \"label2\"]\n}" 7309 }, 7310 "url": { 7311 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 7312 "protocol": "{{protocol}}", 7313 "host": [ 7314 "{{host}}" 7315 ], 7316 "port": "{{port}}", 7317 "path": [ 7318 "{{web_root}}", 7319 "api", 7320 "sessions" 7321 ] 7322 } 7323 }, 7324 "response": [] 7325 }, 7326 { 7327 "name": "Read Session Configuration", 7328 "event": [ 7329 { 7330 "listen": "test", 7331 "script": { 7332 "id": "a0434a56-04b8-4987-8f44-2d71b440ef03", 7333 "exec": [ 7334 "pm.test(\"Status code is 200\", function () {", 7335 " pm.response.to.have.status(200);", 7336 "});", 7337 "", 7338 "var jsonData = pm.response.json();", 7339 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 7340 "", 7341 "var includedTests = JSON.parse(pm.globals.get(\"included_tests\"));", 7342 "var excludedTests = JSON.parse(pm.globals.get(\"excluded_tests\"));", 7343 "var automaticTimeout = pm.globals.get(\"automatic_timeout\");", 7344 "var manualTimeout = pm.globals.get(\"manual_timeout\");", 7345 "var specialTimeout = pm.globals.get(\"special_timeout\");", 7346 "var specialTimeoutTest = pm.globals.get(\"special_timeout_test\");", 7347 "", 7348 "pm.test(\"Configuration is as specified\", function () {", 7349 " pm.expect(jsonData.token).to.match(tokenRegex);", 7350 " for (var test of includedTests) {", 7351 " pm.expect(jsonData.tests.include).to.include(test);", 7352 " }", 7353 " for (var test of excludedTests) {", 7354 " pm.expect(jsonData.tests.exclude).to.include(test);", 7355 " }", 7356 " pm.expect(jsonData.types).to.include(\"automatic\");", 7357 " pm.expect(jsonData.types).to.include(\"manual\");", 7358 " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", 7359 " pm.expect(jsonData.timeouts.automatic).to.equal(automaticTimeout);", 7360 " pm.expect(jsonData.timeouts.manual).to.equal(manualTimeout);", 7361 " pm.expect(jsonData.timeouts[specialTimeoutTest]).to.equal(specialTimeout);", 7362 " pm.expect(jsonData.browser.name).to.equal(\"Other\");", 7363 " pm.expect(jsonData.browser.version).to.equal(\"0\");", 7364 " pm.expect(jsonData.is_public).to.equal(false);", 7365 " pm.expect(jsonData.reference_tokens).to.be.empty;", 7366 " pm.expect(jsonData.labels).to.include(\"label1\");", 7367 " pm.expect(jsonData.labels).to.include(\"label2\");", 7368 "});" 7369 ], 7370 "type": "text/javascript" 7371 } 7372 } 7373 ], 7374 "request": { 7375 "method": "GET", 7376 "header": [], 7377 "url": { 7378 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 7379 "protocol": "{{protocol}}", 7380 "host": [ 7381 "{{host}}" 7382 ], 7383 "port": "{{port}}", 7384 "path": [ 7385 "{{web_root}}", 7386 "api", 7387 "sessions", 7388 "{{session_token}}" 7389 ] 7390 } 7391 }, 7392 "response": [] 7393 }, 7394 { 7395 "name": "Read Session Status", 7396 "event": [ 7397 { 7398 "listen": "test", 7399 "script": { 7400 "id": "2a7524e5-7394-4177-8267-42d5b32bc474", 7401 "exec": [ 7402 "pm.test(\"Status code is 200\", function () {", 7403 " pm.response.to.have.status(200);", 7404 "});", 7405 "", 7406 "", 7407 "var jsonData = pm.response.json();", 7408 "", 7409 "pm.test(\"Session status is pending\", function () {", 7410 " pm.expect(jsonData.status).to.equal(\"pending\");", 7411 "})", 7412 "", 7413 "pm.test(\"Start and Finish date not set\", function () {", 7414 " pm.expect(jsonData.date_started).to.be.null;", 7415 " pm.expect(jsonData.date_finished).to.be.null;", 7416 "});" 7417 ], 7418 "type": "text/javascript" 7419 } 7420 } 7421 ], 7422 "request": { 7423 "method": "GET", 7424 "header": [], 7425 "url": { 7426 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 7427 "protocol": "{{protocol}}", 7428 "host": [ 7429 "{{host}}" 7430 ], 7431 "port": "{{port}}", 7432 "path": [ 7433 "{{web_root}}", 7434 "api", 7435 "sessions", 7436 "{{session_token}}", 7437 "status" 7438 ] 7439 } 7440 }, 7441 "response": [] 7442 }, 7443 { 7444 "name": "Read Tests of Session", 7445 "event": [ 7446 { 7447 "listen": "test", 7448 "script": { 7449 "id": "448b6a0c-135d-42ef-8bc0-b4b1ce4ab8a0", 7450 "exec": [ 7451 "pm.test(\"Status code is 200\", function () {", 7452 " pm.response.to.have.status(200);", 7453 "});", 7454 "", 7455 "var jsonData = pm.response.json();", 7456 "", 7457 "pm.test(\"All tests are pending tests\", function () {", 7458 " pm.expect(Object.keys(jsonData.pending_tests)).to.not.have.lengthOf(0);", 7459 " pm.expect(Object.keys(jsonData.running_tests)).to.have.lengthOf(0);", 7460 "})", 7461 "", 7462 "const availableTests = pm.globals.get(\"available_tests\");", 7463 "const includedTests = pm.globals.get(\"included_tests\");", 7464 "const excludedTests = pm.globals.get(\"excluded_tests\");", 7465 "", 7466 "pm.test(\"Selected subset of tests are part of the session\", function () {", 7467 " for (var api of Object.keys(jsonData.pending_tests)) {", 7468 " for (var includedTest of includedTests) {", 7469 " if (includedTest.split(\"/\").find(part => !!part) === api) {", 7470 " var includeRegExp = new RegExp(\"^\" + includedTest, \"i\");", 7471 " for (var test of jsonData.pending_tests[api]) {", 7472 " pm.expect(test).to.match(regex);", 7473 " }", 7474 " break;", 7475 " }", 7476 " }", 7477 " for (var excludedTest of excludedTests) {", 7478 " if (excludedTest.split(\"/\").find(part => !!part) === api) {", 7479 " var excludeRegExp = new RegExp(\"^\" + excludedTest, \"i\");", 7480 " for (var test of jsonData.pending_tests[api]) {", 7481 " pm.expect(test).to.not.match(regex);", 7482 " }", 7483 " break;", 7484 " }", 7485 " }", 7486 " }", 7487 "});", 7488 "", 7489 "const sessionTests = jsonData.pending_tests;", 7490 "", 7491 "pm.globals.set(\"session_tests\", JSON.stringify(sessionTests));" 7492 ], 7493 "type": "text/javascript" 7494 } 7495 } 7496 ], 7497 "request": { 7498 "method": "GET", 7499 "header": [], 7500 "url": { 7501 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}", 7502 "protocol": "{{protocol}}", 7503 "host": [ 7504 "{{host}}" 7505 ], 7506 "port": "{{port}}", 7507 "path": [ 7508 "{{web_root}}", 7509 "api", 7510 "tests", 7511 "{{session_token}}" 7512 ] 7513 } 7514 }, 7515 "response": [] 7516 }, 7517 { 7518 "name": "Clean up: Delete session", 7519 "request": { 7520 "method": "DELETE", 7521 "header": [], 7522 "url": { 7523 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 7524 "protocol": "{{protocol}}", 7525 "host": [ 7526 "{{host}}" 7527 ], 7528 "port": "{{port}}", 7529 "path": [ 7530 "{{web_root}}", 7531 "api", 7532 "sessions", 7533 "{{session_token}}" 7534 ] 7535 } 7536 }, 7537 "response": [] 7538 } 7539 ], 7540 "event": [ 7541 { 7542 "listen": "prerequest", 7543 "script": { 7544 "id": "a16eac8e-9609-4314-abd8-a5c470537b52", 7545 "type": "text/javascript", 7546 "exec": [ 7547 "" 7548 ] 7549 } 7550 }, 7551 { 7552 "listen": "test", 7553 "script": { 7554 "id": "5df55957-0bbb-4db8-9ab9-d8a70ce37bc5", 7555 "type": "text/javascript", 7556 "exec": [ 7557 "" 7558 ] 7559 } 7560 } 7561 ], 7562 "protocolProfileBehavior": {}, 7563 "_postman_isSubFolder": true 7564 }, 7565 { 7566 "name": "With Expiration", 7567 "item": [ 7568 { 7569 "name": "Create Session With Expiration", 7570 "event": [ 7571 { 7572 "listen": "test", 7573 "script": { 7574 "id": "6c4aa702-ae3a-44a4-b886-b3e883de4d32", 7575 "exec": [ 7576 "pm.test(\"Status code is 200\", function () {", 7577 " pm.response.to.have.status(200);", 7578 "});", 7579 "", 7580 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 7581 "", 7582 "pm.test(\"Responds with token in JSON format\", function () {", 7583 " var jsonData = pm.response.json();", 7584 " pm.expect(jsonData).to.have.property(\"token\");", 7585 " pm.expect(jsonData.token).to.match(tokenRegex);", 7586 "});", 7587 "", 7588 "", 7589 "const response = pm.response.json();", 7590 "const token = response.token;", 7591 "pm.globals.set(\"session_token\", token);" 7592 ], 7593 "type": "text/javascript" 7594 } 7595 }, 7596 { 7597 "listen": "prerequest", 7598 "script": { 7599 "id": "893672a9-c666-4790-b6a7-e0ce7afda482", 7600 "exec": [ 7601 "var expirationDate = Date.now() + 3000;", 7602 "pm.globals.set(\"expiration_date\", expirationDate);" 7603 ], 7604 "type": "text/javascript" 7605 } 7606 } 7607 ], 7608 "request": { 7609 "method": "POST", 7610 "header": [ 7611 { 7612 "key": "Content-Type", 7613 "name": "Content-Type", 7614 "type": "text", 7615 "value": "application/json" 7616 } 7617 ], 7618 "body": { 7619 "mode": "raw", 7620 "raw": "{\n\t\"expiration_date\": {{expiration_date}}\n}" 7621 }, 7622 "url": { 7623 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 7624 "protocol": "{{protocol}}", 7625 "host": [ 7626 "{{host}}" 7627 ], 7628 "port": "{{port}}", 7629 "path": [ 7630 "{{web_root}}", 7631 "api", 7632 "sessions" 7633 ] 7634 } 7635 }, 7636 "response": [] 7637 }, 7638 { 7639 "name": "Read Expired Session", 7640 "event": [ 7641 { 7642 "listen": "test", 7643 "script": { 7644 "id": "f6b31d37-a98b-4110-80a2-f78db6f2e26f", 7645 "exec": [ 7646 "pm.test(\"Status code is 404\", function () {", 7647 " pm.response.to.have.status(404);", 7648 "});" 7649 ], 7650 "type": "text/javascript" 7651 } 7652 }, 7653 { 7654 "listen": "prerequest", 7655 "script": { 7656 "id": "d41cf31b-c8e8-455f-aa69-527af5fbd66b", 7657 "exec": [ 7658 "var expirationDate = pm.globals.get(\"expiration_date\");", 7659 "", 7660 "var timeout = expirationDate - Date.now() + 1000", 7661 "", 7662 "console.log(timeout)", 7663 "", 7664 "setTimeout(function () {}, timeout);" 7665 ], 7666 "type": "text/javascript" 7667 } 7668 } 7669 ], 7670 "request": { 7671 "method": "GET", 7672 "header": [], 7673 "url": { 7674 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 7675 "protocol": "{{protocol}}", 7676 "host": [ 7677 "{{host}}" 7678 ], 7679 "port": "{{port}}", 7680 "path": [ 7681 "{{web_root}}", 7682 "api", 7683 "sessions", 7684 "{{session_token}}" 7685 ] 7686 } 7687 }, 7688 "response": [] 7689 }, 7690 { 7691 "name": "Clean up: Delete session", 7692 "request": { 7693 "method": "DELETE", 7694 "header": [], 7695 "url": { 7696 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 7697 "protocol": "{{protocol}}", 7698 "host": [ 7699 "{{host}}" 7700 ], 7701 "port": "{{port}}", 7702 "path": [ 7703 "{{web_root}}", 7704 "api", 7705 "sessions", 7706 "{{session_token}}" 7707 ] 7708 } 7709 }, 7710 "response": [] 7711 } 7712 ], 7713 "protocolProfileBehavior": {}, 7714 "_postman_isSubFolder": true 7715 } 7716 ], 7717 "protocolProfileBehavior": {}, 7718 "_postman_isSubFolder": true 7719 }, 7720 { 7721 "name": "read session", 7722 "item": [ 7723 { 7724 "name": "Prep: Create Session No Configuration", 7725 "event": [ 7726 { 7727 "listen": "test", 7728 "script": { 7729 "id": "090ca1bc-cbee-4d7b-b19f-fc1f4bb879a0", 7730 "exec": [ 7731 "pm.test(\"Status code is 200\", function () {", 7732 " pm.response.to.have.status(200);", 7733 "});", 7734 "", 7735 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 7736 "", 7737 "pm.test(\"Responds with token in JSON format\", function () {", 7738 " var jsonData = pm.response.json();", 7739 " pm.expect(jsonData).to.have.property(\"token\");", 7740 " pm.expect(jsonData.token).to.match(tokenRegex);", 7741 "});", 7742 "", 7743 "", 7744 "const response = pm.response.json();", 7745 "const token = response.token;", 7746 "pm.globals.set(\"session_token\", token);" 7747 ], 7748 "type": "text/javascript" 7749 } 7750 } 7751 ], 7752 "request": { 7753 "method": "POST", 7754 "header": [ 7755 { 7756 "key": "Content-Type", 7757 "name": "Content-Type", 7758 "type": "text", 7759 "value": "application/json" 7760 } 7761 ], 7762 "body": { 7763 "mode": "raw", 7764 "raw": "" 7765 }, 7766 "url": { 7767 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 7768 "protocol": "{{protocol}}", 7769 "host": [ 7770 "{{host}}" 7771 ], 7772 "port": "{{port}}", 7773 "path": [ 7774 "{{web_root}}", 7775 "api", 7776 "sessions" 7777 ] 7778 } 7779 }, 7780 "response": [] 7781 }, 7782 { 7783 "name": "Read Session Configuration", 7784 "event": [ 7785 { 7786 "listen": "test", 7787 "script": { 7788 "id": "232aff11-3cdc-4994-af42-5e3574583814", 7789 "exec": [ 7790 "pm.test(\"Status code is 200\", function () {", 7791 " pm.response.to.have.status(200);", 7792 "});", 7793 "", 7794 "var jsonData = pm.response.json();", 7795 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 7796 "", 7797 "pm.test(\"JSON structure is as expected\", function () {", 7798 " pm.expect(jsonData).to.have.property(\"token\");", 7799 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 7800 " pm.expect(jsonData).to.have.property(\"tests\");", 7801 " pm.expect(typeof jsonData.tests).to.equal(\"object\");", 7802 " pm.expect(jsonData.tests).to.have.property(\"include\");", 7803 " pm.expect(jsonData.tests.include).to.be.an.instanceof(Array);", 7804 " pm.expect(jsonData.tests).to.have.property(\"exclude\");", 7805 " pm.expect(jsonData.tests.exclude).to.be.an.instanceof(Array);", 7806 " pm.expect(jsonData).to.have.property(\"types\");", 7807 " pm.expect(jsonData.types).to.be.an.instanceof(Array);", 7808 " pm.expect(jsonData).to.have.property(\"user_agent\");", 7809 " pm.expect(typeof jsonData.user_agent).to.equal(\"string\");", 7810 " pm.expect(jsonData).to.have.property(\"timeouts\");", 7811 " pm.expect(typeof jsonData.timeouts).to.equal(\"object\")", 7812 " pm.expect(jsonData.timeouts).to.have.property(\"automatic\");", 7813 " pm.expect(typeof jsonData.timeouts.automatic).to.equal(\"number\");", 7814 " pm.expect(jsonData.timeouts).to.have.property(\"manual\");", 7815 " pm.expect(typeof jsonData.timeouts.manual).to.equal(\"number\");", 7816 " pm.expect(jsonData).to.have.property(\"browser\");", 7817 " pm.expect(typeof jsonData.browser).to.equal(\"object\");", 7818 " pm.expect(jsonData.browser).to.have.property(\"name\");", 7819 " pm.expect(typeof jsonData.browser.name).to.equal(\"string\");", 7820 " pm.expect(jsonData.browser).to.have.property(\"version\");", 7821 " pm.expect(typeof jsonData.browser.version).to.equal(\"string\");", 7822 " pm.expect(jsonData).to.have.property(\"reference_tokens\");", 7823 " pm.expect(jsonData.reference_tokens).to.be.an.instanceof(Array);", 7824 " pm.expect(jsonData).to.have.property(\"labels\");", 7825 " pm.expect(jsonData.labels).to.be.an.instanceof(Array);", 7826 " pm.expect(jsonData).to.have.property(\"date_created\");", 7827 "});", 7828 "", 7829 "pm.test(\"Configuration is default\", function () {", 7830 " pm.expect(jsonData.token).to.match(tokenRegex);", 7831 " pm.expect(jsonData.tests.include).to.include(\"/\");", 7832 " pm.expect(jsonData.types).to.include(\"automatic\");", 7833 " pm.expect(jsonData.types).to.include(\"manual\");", 7834 " pm.expect(jsonData.user_agent).to.include(\"PostmanRuntime\");", 7835 " pm.expect(jsonData.timeouts.automatic).to.equal(60000);", 7836 " pm.expect(jsonData.timeouts.manual).to.equal(300000);", 7837 " pm.expect(jsonData.browser.name).to.equal(\"Other\");", 7838 " pm.expect(jsonData.browser.version).to.equal(\"0\");", 7839 " pm.expect(jsonData.is_public).to.equal(false);", 7840 " pm.expect(jsonData.reference_tokens).to.be.empty;", 7841 " pm.expect(jsonData.labels).to.be.empty;", 7842 " pm.expect(new Date(jsonData.date_created).getTime()).to.be.below(Date.now());", 7843 "});" 7844 ], 7845 "type": "text/javascript" 7846 } 7847 } 7848 ], 7849 "request": { 7850 "method": "GET", 7851 "header": [], 7852 "url": { 7853 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 7854 "protocol": "{{protocol}}", 7855 "host": [ 7856 "{{host}}" 7857 ], 7858 "port": "{{port}}", 7859 "path": [ 7860 "{{web_root}}", 7861 "api", 7862 "sessions", 7863 "{{session_token}}" 7864 ] 7865 } 7866 }, 7867 "response": [] 7868 }, 7869 { 7870 "name": "Clean up: Delete session", 7871 "request": { 7872 "method": "DELETE", 7873 "header": [], 7874 "url": { 7875 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 7876 "protocol": "{{protocol}}", 7877 "host": [ 7878 "{{host}}" 7879 ], 7880 "port": "{{port}}", 7881 "path": [ 7882 "{{web_root}}", 7883 "api", 7884 "sessions", 7885 "{{session_token}}" 7886 ] 7887 } 7888 }, 7889 "response": [] 7890 } 7891 ], 7892 "protocolProfileBehavior": {}, 7893 "_postman_isSubFolder": true 7894 }, 7895 { 7896 "name": "read session status", 7897 "item": [ 7898 { 7899 "name": "Prep: Create Session No Configuration", 7900 "event": [ 7901 { 7902 "listen": "test", 7903 "script": { 7904 "id": "73cbeeb0-019b-4331-b0ec-ef9d3f1e0494", 7905 "exec": [ 7906 "pm.test(\"Status code is 200\", function () {", 7907 " pm.response.to.have.status(200);", 7908 "});", 7909 "", 7910 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 7911 "", 7912 "pm.test(\"Responds with token in JSON format\", function () {", 7913 " var jsonData = pm.response.json();", 7914 " pm.expect(jsonData).to.have.property(\"token\");", 7915 " pm.expect(jsonData.token).to.match(tokenRegex);", 7916 "});", 7917 "", 7918 "", 7919 "const response = pm.response.json();", 7920 "const token = response.token;", 7921 "pm.globals.set(\"session_token\", token);" 7922 ], 7923 "type": "text/javascript" 7924 } 7925 } 7926 ], 7927 "request": { 7928 "method": "POST", 7929 "header": [ 7930 { 7931 "key": "Content-Type", 7932 "name": "Content-Type", 7933 "type": "text", 7934 "value": "application/json" 7935 } 7936 ], 7937 "body": { 7938 "mode": "raw", 7939 "raw": "" 7940 }, 7941 "url": { 7942 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 7943 "protocol": "{{protocol}}", 7944 "host": [ 7945 "{{host}}" 7946 ], 7947 "port": "{{port}}", 7948 "path": [ 7949 "{{web_root}}", 7950 "api", 7951 "sessions" 7952 ] 7953 } 7954 }, 7955 "response": [] 7956 }, 7957 { 7958 "name": "Read Session Status", 7959 "event": [ 7960 { 7961 "listen": "test", 7962 "script": { 7963 "id": "ba142b55-2454-4472-bcf9-669b0bb7bab9", 7964 "exec": [ 7965 "pm.test(\"Status code is 200\", function () {", 7966 " pm.response.to.have.status(200);", 7967 "});", 7968 "", 7969 "", 7970 "var jsonData = pm.response.json();", 7971 "", 7972 "pm.test(\"JSON structure is as expected\", function () {", 7973 " pm.expect(jsonData).to.have.property(\"token\");", 7974 " pm.expect(typeof jsonData.token).to.equal(\"string\");", 7975 " pm.expect(jsonData).to.have.property(\"status\");", 7976 " pm.expect(typeof jsonData.status).to.equal(\"string\");", 7977 " pm.expect(jsonData).to.have.property(\"expiration_date\");", 7978 " pm.expect(jsonData.expiration_date).to.be.null;", 7979 " pm.expect(jsonData).to.have.property(\"date_started\");", 7980 " pm.expect(jsonData).to.have.property(\"date_finished\");", 7981 "});" 7982 ], 7983 "type": "text/javascript" 7984 } 7985 } 7986 ], 7987 "request": { 7988 "method": "GET", 7989 "header": [], 7990 "url": { 7991 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/status", 7992 "protocol": "{{protocol}}", 7993 "host": [ 7994 "{{host}}" 7995 ], 7996 "port": "{{port}}", 7997 "path": [ 7998 "{{web_root}}", 7999 "api", 8000 "sessions", 8001 "{{session_token}}", 8002 "status" 8003 ] 8004 } 8005 }, 8006 "response": [] 8007 }, 8008 { 8009 "name": "Clean up: Delete session", 8010 "request": { 8011 "method": "DELETE", 8012 "header": [], 8013 "url": { 8014 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 8015 "protocol": "{{protocol}}", 8016 "host": [ 8017 "{{host}}" 8018 ], 8019 "port": "{{port}}", 8020 "path": [ 8021 "{{web_root}}", 8022 "api", 8023 "sessions", 8024 "{{session_token}}" 8025 ] 8026 } 8027 }, 8028 "response": [] 8029 } 8030 ], 8031 "protocolProfileBehavior": {}, 8032 "_postman_isSubFolder": true 8033 }, 8034 { 8035 "name": "read sessions", 8036 "item": [ 8037 { 8038 "name": "Without query parameters", 8039 "item": [ 8040 { 8041 "name": "Read sessions", 8042 "event": [ 8043 { 8044 "listen": "test", 8045 "script": { 8046 "id": "f443955f-b57e-4801-8eac-547597381615", 8047 "exec": [ 8048 "const response = pm.response.json();", 8049 "", 8050 "pm.test(\"Status code is 200\", function () {", 8051 " pm.response.to.have.status(200);", 8052 "});", 8053 "", 8054 "pm.test(\"JSON structure as expected\", function() {", 8055 " pm.expect(response).to.have.property(\"items\");", 8056 " pm.expect(response[\"items\"]).to.be.instanceof(Array);", 8057 " pm.expect(response).to.have.property(\"_links\");", 8058 " pm.expect(response[\"_links\"]).to.be.instanceof(Object);", 8059 "});" 8060 ], 8061 "type": "text/javascript" 8062 } 8063 } 8064 ], 8065 "request": { 8066 "method": "GET", 8067 "header": [], 8068 "url": { 8069 "raw": "{{protocol}}://{{host}}:{{port}}/_wave/api/sessions", 8070 "protocol": "{{protocol}}", 8071 "host": [ 8072 "{{host}}" 8073 ], 8074 "port": "{{port}}", 8075 "path": [ 8076 "_wave", 8077 "api", 8078 "sessions" 8079 ] 8080 } 8081 }, 8082 "response": [] 8083 } 8084 ], 8085 "protocolProfileBehavior": {}, 8086 "_postman_isSubFolder": true 8087 }, 8088 { 8089 "name": "Containing created session", 8090 "item": [ 8091 { 8092 "name": "Prep: Create session", 8093 "event": [ 8094 { 8095 "listen": "test", 8096 "script": { 8097 "id": "2ca80dee-f9a5-4e0b-bead-6ab871d9edf8", 8098 "exec": [ 8099 "const response = pm.response.json();", 8100 "const token = response.token;", 8101 "pm.globals.set(\"session_token\", token);" 8102 ], 8103 "type": "text/javascript" 8104 } 8105 } 8106 ], 8107 "request": { 8108 "method": "POST", 8109 "header": [], 8110 "body": { 8111 "mode": "raw", 8112 "raw": "", 8113 "options": { 8114 "raw": { 8115 "language": "json" 8116 } 8117 } 8118 }, 8119 "url": { 8120 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 8121 "protocol": "{{protocol}}", 8122 "host": [ 8123 "{{host}}" 8124 ], 8125 "port": "{{port}}", 8126 "path": [ 8127 "{{web_root}}", 8128 "api", 8129 "sessions" 8130 ] 8131 } 8132 }, 8133 "response": [] 8134 }, 8135 { 8136 "name": "Read sessions", 8137 "event": [ 8138 { 8139 "listen": "test", 8140 "script": { 8141 "id": "fbf5eafb-0ae7-4105-8df5-51bb53b0c595", 8142 "exec": [ 8143 "const token = pm.globals.get(\"session_token\");", 8144 "const response = pm.response.json();", 8145 "", 8146 "pm.test(\"Status code is 200\", function () {", 8147 " pm.response.to.have.status(200);", 8148 "});", 8149 "", 8150 "pm.test(\"JSON structure as expected\", function() {", 8151 " pm.expect(response).to.have.property(\"items\");", 8152 " pm.expect(response[\"items\"]).to.be.instanceof(Array);", 8153 " pm.expect(response).to.have.property(\"_links\");", 8154 " pm.expect(response[\"_links\"]).to.be.instanceof(Object);", 8155 "});", 8156 "", 8157 "pm.test(\"Created session's token in response\", function() {", 8158 " pm.expect(response.items).to.contain(token);", 8159 "});" 8160 ], 8161 "type": "text/javascript" 8162 } 8163 } 8164 ], 8165 "request": { 8166 "method": "GET", 8167 "header": [], 8168 "url": { 8169 "raw": "{{protocol}}://{{host}}:{{port}}/_wave/api/sessions?index=0&count=1000", 8170 "protocol": "{{protocol}}", 8171 "host": [ 8172 "{{host}}" 8173 ], 8174 "port": "{{port}}", 8175 "path": [ 8176 "_wave", 8177 "api", 8178 "sessions" 8179 ], 8180 "query": [ 8181 { 8182 "key": "index", 8183 "value": "0" 8184 }, 8185 { 8186 "key": "count", 8187 "value": "1000" 8188 } 8189 ] 8190 } 8191 }, 8192 "response": [] 8193 }, 8194 { 8195 "name": "Clean up: Delete Session", 8196 "request": { 8197 "method": "DELETE", 8198 "header": [], 8199 "url": { 8200 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 8201 "protocol": "{{protocol}}", 8202 "host": [ 8203 "{{host}}" 8204 ], 8205 "port": "{{port}}", 8206 "path": [ 8207 "{{web_root}}", 8208 "api", 8209 "sessions", 8210 "{{session_token}}" 8211 ] 8212 } 8213 }, 8214 "response": [] 8215 } 8216 ], 8217 "protocolProfileBehavior": {}, 8218 "_postman_isSubFolder": true 8219 }, 8220 { 8221 "name": "With configuration expansion", 8222 "item": [ 8223 { 8224 "name": "Prep: Create session", 8225 "event": [ 8226 { 8227 "listen": "test", 8228 "script": { 8229 "id": "bdd64594-c874-4eb2-8b36-4c37cea0f0cb", 8230 "exec": [ 8231 "const response = pm.response.json();", 8232 "const token = response.token;", 8233 "pm.globals.set(\"session_token\", token);" 8234 ], 8235 "type": "text/javascript" 8236 } 8237 } 8238 ], 8239 "request": { 8240 "method": "POST", 8241 "header": [], 8242 "body": { 8243 "mode": "raw", 8244 "raw": "", 8245 "options": { 8246 "raw": { 8247 "language": "json" 8248 } 8249 } 8250 }, 8251 "url": { 8252 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 8253 "protocol": "{{protocol}}", 8254 "host": [ 8255 "{{host}}" 8256 ], 8257 "port": "{{port}}", 8258 "path": [ 8259 "{{web_root}}", 8260 "api", 8261 "sessions" 8262 ] 8263 } 8264 }, 8265 "response": [] 8266 }, 8267 { 8268 "name": "Read sessions", 8269 "event": [ 8270 { 8271 "listen": "test", 8272 "script": { 8273 "id": "6732aedf-d99d-416f-b93d-98bc0404ef61", 8274 "exec": [ 8275 "const token = pm.globals.get(\"session_token\");", 8276 "const response = pm.response.json();", 8277 "", 8278 "pm.test(\"Status code is 200\", function () {", 8279 " pm.response.to.have.status(200);", 8280 "});", 8281 "", 8282 "pm.test(\"JSON structure as expected\", function() {", 8283 " pm.expect(response).to.have.property(\"items\");", 8284 " pm.expect(response[\"items\"]).to.be.instanceof(Array);", 8285 " pm.expect(response).to.have.property(\"_links\");", 8286 " pm.expect(response[\"_links\"]).to.be.instanceof(Object);", 8287 " pm.expect(response).to.have.property(\"_embedded\");", 8288 " pm.expect(response[\"_embedded\"]).to.be.instanceof(Object);", 8289 " pm.expect(response[\"_embedded\"]).to.have.property(\"configuration\");", 8290 " pm.expect(response[\"_embedded\"][\"configuration\"]).to.be.instanceof(Array);", 8291 "});", 8292 "", 8293 "pm.test(\"Created session's token in response\", function() {", 8294 " pm.expect(response.items).to.contain(token);", 8295 "});", 8296 "", 8297 "pm.test(\"Created session's token in embedded configuration\", function() {", 8298 " let tokenInConfigurationList = false;", 8299 " let configurations = response._embedded.configuration;", 8300 " for (let configuration of configurations) {", 8301 " if (configuration.token !== token) continue;", 8302 " tokenInConfigurationList = true;", 8303 " }", 8304 " pm.expect(tokenInConfigurationList).to.equal(true);", 8305 "});" 8306 ], 8307 "type": "text/javascript" 8308 } 8309 } 8310 ], 8311 "request": { 8312 "method": "GET", 8313 "header": [], 8314 "url": { 8315 "raw": "{{protocol}}://{{host}}:{{port}}/_wave/api/sessions?index=0&count=1000&expand=configuration", 8316 "protocol": "{{protocol}}", 8317 "host": [ 8318 "{{host}}" 8319 ], 8320 "port": "{{port}}", 8321 "path": [ 8322 "_wave", 8323 "api", 8324 "sessions" 8325 ], 8326 "query": [ 8327 { 8328 "key": "index", 8329 "value": "0" 8330 }, 8331 { 8332 "key": "count", 8333 "value": "1000" 8334 }, 8335 { 8336 "key": "expand", 8337 "value": "configuration" 8338 } 8339 ] 8340 } 8341 }, 8342 "response": [] 8343 }, 8344 { 8345 "name": "Clean up: Delete Session", 8346 "request": { 8347 "method": "DELETE", 8348 "header": [], 8349 "url": { 8350 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 8351 "protocol": "{{protocol}}", 8352 "host": [ 8353 "{{host}}" 8354 ], 8355 "port": "{{port}}", 8356 "path": [ 8357 "{{web_root}}", 8358 "api", 8359 "sessions", 8360 "{{session_token}}" 8361 ] 8362 } 8363 }, 8364 "response": [] 8365 } 8366 ], 8367 "protocolProfileBehavior": {}, 8368 "_postman_isSubFolder": true 8369 }, 8370 { 8371 "name": "With status expansion", 8372 "item": [ 8373 { 8374 "name": "Prep: Create session", 8375 "event": [ 8376 { 8377 "listen": "test", 8378 "script": { 8379 "id": "3319e417-dd54-495f-a452-5519d2a61082", 8380 "exec": [ 8381 "const response = pm.response.json();", 8382 "const token = response.token;", 8383 "pm.globals.set(\"session_token\", token);" 8384 ], 8385 "type": "text/javascript" 8386 } 8387 } 8388 ], 8389 "request": { 8390 "method": "POST", 8391 "header": [], 8392 "body": { 8393 "mode": "raw", 8394 "raw": "", 8395 "options": { 8396 "raw": { 8397 "language": "json" 8398 } 8399 } 8400 }, 8401 "url": { 8402 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 8403 "protocol": "{{protocol}}", 8404 "host": [ 8405 "{{host}}" 8406 ], 8407 "port": "{{port}}", 8408 "path": [ 8409 "{{web_root}}", 8410 "api", 8411 "sessions" 8412 ] 8413 } 8414 }, 8415 "response": [] 8416 }, 8417 { 8418 "name": "Read sessions", 8419 "event": [ 8420 { 8421 "listen": "test", 8422 "script": { 8423 "id": "6ca3480a-3224-4bf8-a466-fdcb06338795", 8424 "exec": [ 8425 "const token = pm.globals.get(\"session_token\");", 8426 "const response = pm.response.json();", 8427 "", 8428 "pm.test(\"Status code is 200\", function () {", 8429 " pm.response.to.have.status(200);", 8430 "});", 8431 "", 8432 "pm.test(\"JSON structure as expected\", function() {", 8433 " pm.expect(response).to.have.property(\"items\");", 8434 " pm.expect(response[\"items\"]).to.be.instanceof(Array);", 8435 " pm.expect(response).to.have.property(\"_links\");", 8436 " pm.expect(response[\"_links\"]).to.be.instanceof(Object);", 8437 " pm.expect(response).to.have.property(\"_embedded\");", 8438 " pm.expect(response[\"_embedded\"]).to.be.instanceof(Object);", 8439 " pm.expect(response[\"_embedded\"]).to.have.property(\"status\");", 8440 " pm.expect(response[\"_embedded\"][\"status\"]).to.be.instanceof(Array);", 8441 "});", 8442 "", 8443 "pm.test(\"Created session's token in response\", function() {", 8444 " pm.expect(response.items).to.contain(token);", 8445 "});", 8446 "", 8447 "pm.test(\"Created session's token in embedded status\", function() {", 8448 " let tokenInStatusList = false;", 8449 " let statuses = response._embedded.status;", 8450 " for (let status of statuses) {", 8451 " if (status.token !== token) continue;", 8452 " tokenInStatusList = true;", 8453 " }", 8454 " pm.expect(tokenInStatusList).to.equal(true);", 8455 "});" 8456 ], 8457 "type": "text/javascript" 8458 } 8459 } 8460 ], 8461 "request": { 8462 "method": "GET", 8463 "header": [], 8464 "url": { 8465 "raw": "{{protocol}}://{{host}}:{{port}}/_wave/api/sessions?index=0&count=1000&expand=status", 8466 "protocol": "{{protocol}}", 8467 "host": [ 8468 "{{host}}" 8469 ], 8470 "port": "{{port}}", 8471 "path": [ 8472 "_wave", 8473 "api", 8474 "sessions" 8475 ], 8476 "query": [ 8477 { 8478 "key": "index", 8479 "value": "0" 8480 }, 8481 { 8482 "key": "count", 8483 "value": "1000" 8484 }, 8485 { 8486 "key": "expand", 8487 "value": "status" 8488 } 8489 ] 8490 } 8491 }, 8492 "response": [] 8493 }, 8494 { 8495 "name": "Clean up: Delete Session", 8496 "request": { 8497 "method": "DELETE", 8498 "header": [], 8499 "url": { 8500 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 8501 "protocol": "{{protocol}}", 8502 "host": [ 8503 "{{host}}" 8504 ], 8505 "port": "{{port}}", 8506 "path": [ 8507 "{{web_root}}", 8508 "api", 8509 "sessions", 8510 "{{session_token}}" 8511 ] 8512 } 8513 }, 8514 "response": [] 8515 } 8516 ], 8517 "protocolProfileBehavior": {}, 8518 "_postman_isSubFolder": true 8519 } 8520 ], 8521 "protocolProfileBehavior": {}, 8522 "_postman_isSubFolder": true 8523 } 8524 ], 8525 "protocolProfileBehavior": {} 8526 }, 8527 { 8528 "name": "Results API", 8529 "item": [ 8530 { 8531 "name": "upload api", 8532 "item": [ 8533 { 8534 "name": "create session", 8535 "item": [ 8536 { 8537 "name": "Prep: Read Available Tests", 8538 "event": [ 8539 { 8540 "listen": "test", 8541 "script": { 8542 "id": "1f3d8b67-aab8-44a0-abf4-e320a6b27755", 8543 "exec": [ 8544 "pm.test(\"Status code is 200\", function () {", 8545 " pm.response.to.have.status(200);", 8546 "});", 8547 "", 8548 "var availableTests = pm.response.json();", 8549 "", 8550 "var includedTests = [];", 8551 "var excludedTests = [];", 8552 "var specialTimeoutTest = \"\";", 8553 "", 8554 "var apis = Object.keys(availableTests);", 8555 "for(var api of apis) {", 8556 " if (availableTests[api].length > 50) {", 8557 " var subDirs = availableTests[api].map(test => test.split(\"/\").filter(part => !!part)[1]).reduce((acc, curr) => acc.indexOf(curr) === -1 ? acc.concat([curr]) : acc, []);", 8558 " if (subDirs.length > 2) {", 8559 " includedTests.push(\"/\" + api);", 8560 " excludedTests.push(\"/\" + api + \"/\" + subDirs[0]);", 8561 " specialTimeoutTest = availableTests[api][availableTests[api].length - 1];", 8562 " break;", 8563 " }", 8564 " ", 8565 " }", 8566 "}", 8567 "", 8568 "var usedApi = apis[0];", 8569 "", 8570 "pm.globals.set(\"api_name\", usedApi);", 8571 "pm.globals.set(\"test\", availableTests[usedApi][0]);" 8572 ], 8573 "type": "text/javascript" 8574 } 8575 } 8576 ], 8577 "request": { 8578 "method": "GET", 8579 "header": [], 8580 "url": { 8581 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests", 8582 "protocol": "{{protocol}}", 8583 "host": [ 8584 "{{host}}" 8585 ], 8586 "port": "{{port}}", 8587 "path": [ 8588 "{{web_root}}", 8589 "api", 8590 "tests" 8591 ] 8592 } 8593 }, 8594 "response": [] 8595 }, 8596 { 8597 "name": "Create Session With One test", 8598 "event": [ 8599 { 8600 "listen": "test", 8601 "script": { 8602 "id": "f42479d4-f723-4843-ba91-f30019ebd975", 8603 "exec": [ 8604 "pm.test(\"Status code is 200\", function () {", 8605 " pm.response.to.have.status(200);", 8606 "});", 8607 "", 8608 "const tokenRegex = new RegExp(\"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$\");", 8609 "", 8610 "pm.test(\"Responds with token in JSON format\", function () {", 8611 " var jsonData = pm.response.json();", 8612 " pm.expect(jsonData).to.have.property(\"token\");", 8613 " pm.expect(jsonData.token).to.match(tokenRegex);", 8614 "});", 8615 "", 8616 "", 8617 "const response = pm.response.json();", 8618 "const token = response.token;", 8619 "pm.globals.set(\"session_token\", token);" 8620 ], 8621 "type": "text/javascript" 8622 } 8623 } 8624 ], 8625 "request": { 8626 "method": "POST", 8627 "header": [ 8628 { 8629 "key": "Content-Type", 8630 "name": "Content-Type", 8631 "type": "text", 8632 "value": "application/json" 8633 } 8634 ], 8635 "body": { 8636 "mode": "raw", 8637 "raw": "{\n \"tests\": {\n \"include\": [\"{{test}}\"]\n }\n}" 8638 }, 8639 "url": { 8640 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions", 8641 "protocol": "{{protocol}}", 8642 "host": [ 8643 "{{host}}" 8644 ], 8645 "port": "{{port}}", 8646 "path": [ 8647 "{{web_root}}", 8648 "api", 8649 "sessions" 8650 ] 8651 } 8652 }, 8653 "response": [] 8654 } 8655 ], 8656 "event": [ 8657 { 8658 "listen": "prerequest", 8659 "script": { 8660 "id": "9f8fc606-25ee-45de-bcd8-57735900701b", 8661 "type": "text/javascript", 8662 "exec": [ 8663 "" 8664 ] 8665 } 8666 }, 8667 { 8668 "listen": "test", 8669 "script": { 8670 "id": "be2341a8-1598-41b0-96a6-cfd049badd07", 8671 "type": "text/javascript", 8672 "exec": [ 8673 "" 8674 ] 8675 } 8676 } 8677 ], 8678 "protocolProfileBehavior": {}, 8679 "_postman_isSubFolder": true 8680 }, 8681 { 8682 "name": "create results", 8683 "item": [ 8684 { 8685 "name": "Start Session", 8686 "event": [ 8687 { 8688 "listen": "test", 8689 "script": { 8690 "id": "897e04ae-d0a2-4a67-9488-2bdeb55db06b", 8691 "exec": [ 8692 "pm.test(\"Status code is 200\", function () {", 8693 " pm.response.to.have.status(200);", 8694 "});" 8695 ], 8696 "type": "text/javascript" 8697 } 8698 } 8699 ], 8700 "request": { 8701 "method": "POST", 8702 "header": [], 8703 "url": { 8704 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}/start", 8705 "protocol": "{{protocol}}", 8706 "host": [ 8707 "{{host}}" 8708 ], 8709 "port": "{{port}}", 8710 "path": [ 8711 "{{web_root}}", 8712 "api", 8713 "sessions", 8714 "{{session_token}}", 8715 "start" 8716 ] 8717 } 8718 }, 8719 "response": [] 8720 }, 8721 { 8722 "name": "Read Next Test of Session", 8723 "event": [ 8724 { 8725 "listen": "test", 8726 "script": { 8727 "id": "95b382c6-9d08-41b9-80d1-40dc0217cc09", 8728 "exec": [ 8729 "pm.test(\"Status code is 200\", function () {", 8730 " pm.response.to.have.status(200);", 8731 "});", 8732 "", 8733 "const response = pm.response.json();", 8734 "", 8735 "pm.test(\"JSON structure is as expected\", function () {", 8736 " pm.expect(Object.keys(response)).to.have.lengthOf(1);", 8737 " pm.expect(response).to.have.property(\"next_test\");", 8738 " pm.expect(typeof response.next_test).to.equal(\"string\");", 8739 "});", 8740 "", 8741 "const nextTest = response.next_test;", 8742 "pm.globals.set(\"current_test_url\", nextTest);", 8743 "if (!nextTest) return;", 8744 "", 8745 "const parameters = nextTest.split(\"?\")[1].split(\"&\");", 8746 "let test = parameters.find(parameter => parameter.split(\"=\")[0] === \"test_url\").split(\"=\")[1];", 8747 "test = decodeURIComponent(test);", 8748 "test = \"/\" + test.split(\"/\").slice(3).join(\"/\").split(\"?\")[0];", 8749 "", 8750 "pm.globals.set(\"current_test\", test);" 8751 ], 8752 "type": "text/javascript" 8753 } 8754 } 8755 ], 8756 "request": { 8757 "method": "GET", 8758 "header": [], 8759 "url": { 8760 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/tests/{{session_token}}/next", 8761 "protocol": "{{protocol}}", 8762 "host": [ 8763 "{{host}}" 8764 ], 8765 "port": "{{port}}", 8766 "path": [ 8767 "{{web_root}}", 8768 "api", 8769 "tests", 8770 "{{session_token}}", 8771 "next" 8772 ] 8773 } 8774 }, 8775 "response": [] 8776 }, 8777 { 8778 "name": "Create Result", 8779 "event": [ 8780 { 8781 "listen": "test", 8782 "script": { 8783 "id": "67b23ac9-5254-4b7b-90bf-930a9661a614", 8784 "exec": [ 8785 "pm.test(\"Status code is 200\", function () {", 8786 " pm.response.to.have.status(200);", 8787 "});" 8788 ], 8789 "type": "text/javascript" 8790 } 8791 } 8792 ], 8793 "request": { 8794 "method": "POST", 8795 "header": [ 8796 { 8797 "key": "Content-Type", 8798 "name": "Content-Type", 8799 "value": "application/json", 8800 "type": "text" 8801 } 8802 ], 8803 "body": { 8804 "mode": "raw", 8805 "raw": "{\n \"test\": \"{{current_test}}\",\n \"status\": \"OK\",\n \"message\": null,\n \"subtests\": [\n {\n \"name\": \"Subtest testing feature xy\",\n \"status\": \"FAIL\",\n \"message\": \"Error message\"\n }\n ]\n}" 8806 }, 8807 "url": { 8808 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}", 8809 "protocol": "{{protocol}}", 8810 "host": [ 8811 "{{host}}" 8812 ], 8813 "port": "{{port}}", 8814 "path": [ 8815 "{{web_root}}", 8816 "api", 8817 "results", 8818 "{{session_token}}" 8819 ] 8820 } 8821 }, 8822 "response": [] 8823 } 8824 ], 8825 "protocolProfileBehavior": {}, 8826 "_postman_isSubFolder": true 8827 }, 8828 { 8829 "name": "upload new results", 8830 "item": [ 8831 { 8832 "name": "Download current results", 8833 "event": [ 8834 { 8835 "listen": "test", 8836 "script": { 8837 "id": "984c79db-5ae1-4c22-8b62-6eccabfaeb98", 8838 "exec": [ 8839 "pm.test(\"Status code is 200\", function () {", 8840 " pm.response.to.have.status(200);", 8841 "});", 8842 "", 8843 "var jsonData = pm.response.json();", 8844 "var results = jsonData.results;", 8845 "", 8846 "pm.globals.set(\"results\", results);" 8847 ], 8848 "type": "text/javascript" 8849 } 8850 }, 8851 { 8852 "listen": "prerequest", 8853 "script": { 8854 "id": "a9a46b5f-2dd3-4fa7-a482-7186ac01a4d6", 8855 "exec": [ 8856 "" 8857 ], 8858 "type": "text/javascript" 8859 } 8860 } 8861 ], 8862 "request": { 8863 "method": "GET", 8864 "header": [], 8865 "url": { 8866 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/{{api_name}}/json", 8867 "protocol": "{{protocol}}", 8868 "host": [ 8869 "{{host}}" 8870 ], 8871 "port": "{{port}}", 8872 "path": [ 8873 "{{web_root}}", 8874 "api", 8875 "results", 8876 "{{session_token}}", 8877 "{{api_name}}", 8878 "json" 8879 ] 8880 } 8881 }, 8882 "response": [] 8883 }, 8884 { 8885 "name": "Read Current Compact Results", 8886 "event": [ 8887 { 8888 "listen": "test", 8889 "script": { 8890 "id": "f4974495-2e84-4962-9259-1d5501fb7a3f", 8891 "exec": [ 8892 "pm.test(\"Status code is 200\", function () {", 8893 " pm.response.to.have.status(200);", 8894 "});", 8895 "", 8896 "var jsonData = pm.response.json();", 8897 "", 8898 "pm.globals.set(\"compact_results\", jsonData);" 8899 ], 8900 "type": "text/javascript" 8901 } 8902 } 8903 ], 8904 "request": { 8905 "method": "GET", 8906 "header": [], 8907 "url": { 8908 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/compact", 8909 "protocol": "{{protocol}}", 8910 "host": [ 8911 "{{host}}" 8912 ], 8913 "port": "{{port}}", 8914 "path": [ 8915 "{{web_root}}", 8916 "api", 8917 "results", 8918 "{{session_token}}", 8919 "compact" 8920 ] 8921 } 8922 }, 8923 "response": [] 8924 }, 8925 { 8926 "name": "Upload Results Api Json", 8927 "event": [ 8928 { 8929 "listen": "test", 8930 "script": { 8931 "id": "4a7df46d-546c-4cf4-8c6a-9b13eaa0be32", 8932 "exec": [ 8933 "pm.test(\"Status code is 200\", function () {", 8934 " pm.response.to.have.status(200);", 8935 "});" 8936 ], 8937 "type": "text/javascript" 8938 } 8939 }, 8940 { 8941 "listen": "prerequest", 8942 "script": { 8943 "id": "e2196348-a4a0-48d3-bd72-f591f0b65cf0", 8944 "exec": [ 8945 "var results = pm.globals.get(\"results\");", 8946 "var newSubResult = ", 8947 " {", 8948 " \"name\": \"placeholder sub test\",", 8949 " \"status\": \"PASS\",", 8950 " \"message\": \"this is a placeholder sub test\"", 8951 " };", 8952 "", 8953 "results[0].subtests.push(newSubResult);", 8954 "resultsString = JSON.stringify(results);", 8955 "pm.globals.set(\"resultsString\", resultsString);" 8956 ], 8957 "type": "text/javascript" 8958 } 8959 } 8960 ], 8961 "request": { 8962 "method": "POST", 8963 "header": [], 8964 "body": { 8965 "mode": "raw", 8966 "raw": "{\n \"results\": {{resultsString}}\n}", 8967 "options": { 8968 "raw": { 8969 "language": "json" 8970 } 8971 } 8972 }, 8973 "url": { 8974 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/{{api_name}}/json", 8975 "protocol": "{{protocol}}", 8976 "host": [ 8977 "{{host}}" 8978 ], 8979 "port": "{{port}}", 8980 "path": [ 8981 "{{web_root}}", 8982 "api", 8983 "results", 8984 "{{session_token}}", 8985 "{{api_name}}", 8986 "json" 8987 ] 8988 } 8989 }, 8990 "response": [] 8991 }, 8992 { 8993 "name": "Check if changes took effect", 8994 "event": [ 8995 { 8996 "listen": "test", 8997 "script": { 8998 "id": "8c45fd6d-ca98-4393-ace6-c01563d7c1ec", 8999 "exec": [ 9000 "pm.test(\"Status code is 200\", function () {", 9001 " pm.response.to.have.status(200);", 9002 "});", 9003 "", 9004 "pm.test(\"Returned results contain new result\", function () {", 9005 " var jsonData = pm.response.json();", 9006 " var results = jsonData.results;", 9007 "", 9008 " var oldResults = pm.globals.get(\"results\");", 9009 "", 9010 " pm.expect(oldResults[0].subtests.length + 1).to.equal(results[0].subtests.length);", 9011 "});", 9012 "" 9013 ], 9014 "type": "text/javascript" 9015 } 9016 }, 9017 { 9018 "listen": "prerequest", 9019 "script": { 9020 "id": "0c9e31fc-1931-4dcd-978f-39e2a38f9a3f", 9021 "exec": [ 9022 "" 9023 ], 9024 "type": "text/javascript" 9025 } 9026 } 9027 ], 9028 "request": { 9029 "method": "GET", 9030 "header": [], 9031 "url": { 9032 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/{{api_name}}/json", 9033 "protocol": "{{protocol}}", 9034 "host": [ 9035 "{{host}}" 9036 ], 9037 "port": "{{port}}", 9038 "path": [ 9039 "{{web_root}}", 9040 "api", 9041 "results", 9042 "{{session_token}}", 9043 "{{api_name}}", 9044 "json" 9045 ] 9046 } 9047 }, 9048 "response": [] 9049 }, 9050 { 9051 "name": "Check changes in Compact Results", 9052 "event": [ 9053 { 9054 "listen": "test", 9055 "script": { 9056 "id": "6e30b533-18f9-41bc-af65-bdde323c215a", 9057 "exec": [ 9058 "pm.test(\"Status code is 200\", function () {", 9059 " pm.response.to.have.status(200);", 9060 "});", 9061 "", 9062 "var jsonData = pm.response.json();", 9063 "var test = pm.globals.get(\"test\");", 9064 "var oldCompactResults = pm.globals.get(\"compact_results\");", 9065 "", 9066 "pm.test(\"passed test increased\", function () {", 9067 " var api = test.split(\"/\").find(part => !!part);", 9068 " pm.expect(jsonData[api].pass).to.equal(oldCompactResults[api].pass + 1);", 9069 "})" 9070 ], 9071 "type": "text/javascript" 9072 } 9073 } 9074 ], 9075 "request": { 9076 "method": "GET", 9077 "header": [], 9078 "url": { 9079 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/results/{{session_token}}/compact", 9080 "protocol": "{{protocol}}", 9081 "host": [ 9082 "{{host}}" 9083 ], 9084 "port": "{{port}}", 9085 "path": [ 9086 "{{web_root}}", 9087 "api", 9088 "results", 9089 "{{session_token}}", 9090 "compact" 9091 ] 9092 } 9093 }, 9094 "response": [] 9095 } 9096 ], 9097 "protocolProfileBehavior": {}, 9098 "_postman_isSubFolder": true 9099 }, 9100 { 9101 "name": "clean up", 9102 "item": [ 9103 { 9104 "name": "Clean up: Delete session", 9105 "request": { 9106 "method": "DELETE", 9107 "header": [], 9108 "url": { 9109 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/sessions/{{session_token}}", 9110 "protocol": "{{protocol}}", 9111 "host": [ 9112 "{{host}}" 9113 ], 9114 "port": "{{port}}", 9115 "path": [ 9116 "{{web_root}}", 9117 "api", 9118 "sessions", 9119 "{{session_token}}" 9120 ] 9121 } 9122 }, 9123 "response": [] 9124 } 9125 ], 9126 "protocolProfileBehavior": {}, 9127 "_postman_isSubFolder": true 9128 } 9129 ], 9130 "protocolProfileBehavior": {}, 9131 "_postman_isSubFolder": true 9132 } 9133 ], 9134 "protocolProfileBehavior": {} 9135 }, 9136 { 9137 "name": "General API", 9138 "item": [ 9139 { 9140 "name": "server status", 9141 "item": [ 9142 { 9143 "name": "Read server status", 9144 "event": [ 9145 { 9146 "listen": "test", 9147 "script": { 9148 "id": "8b5b4c23-db0a-4b81-9349-ce8ead64bb7a", 9149 "exec": [ 9150 "pm.test(\"Status code is 200\", function () {", 9151 " pm.response.to.have.status(200);", 9152 "});", 9153 "", 9154 "var jsonData = pm.response.json();", 9155 "", 9156 "pm.test(\"JSON structure is as expected\", function () {", 9157 " pm.expect(jsonData).to.have.property(\"import_results_enabled\");", 9158 " pm.expect(typeof jsonData.import_results_enabled).to.equal(\"boolean\");", 9159 " pm.expect(jsonData).to.have.property(\"reports_enabled\");", 9160 " pm.expect(typeof jsonData.reports_enabled).to.equal(\"boolean\");", 9161 " pm.expect(jsonData).to.have.property(\"read_sessions_enabled\");", 9162 " pm.expect(typeof jsonData.read_sessions_enabled).to.equal(\"boolean\");", 9163 " pm.expect(jsonData).to.have.property(\"version_string\");", 9164 " pm.expect(typeof jsonData.version_string).to.equal(\"string\");", 9165 "});" 9166 ], 9167 "type": "text/javascript" 9168 } 9169 } 9170 ], 9171 "request": { 9172 "method": "GET", 9173 "header": [], 9174 "url": { 9175 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/status", 9176 "protocol": "{{protocol}}", 9177 "host": [ 9178 "{{host}}" 9179 ], 9180 "port": "{{port}}", 9181 "path": [ 9182 "{{web_root}}", 9183 "api", 9184 "status" 9185 ] 9186 } 9187 }, 9188 "response": [] 9189 } 9190 ], 9191 "protocolProfileBehavior": {}, 9192 "_postman_isSubFolder": true 9193 } 9194 ], 9195 "protocolProfileBehavior": {} 9196 }, 9197 { 9198 "name": "Devices API", 9199 "item": [ 9200 { 9201 "name": "create", 9202 "item": [ 9203 { 9204 "name": "Create device", 9205 "event": [ 9206 { 9207 "listen": "test", 9208 "script": { 9209 "id": "286426ec-c394-48a4-a90f-c6dd80c7bef1", 9210 "exec": [ 9211 "pm.test(\"Successful POST request\", function () {", 9212 " pm.expect(pm.response.code).to.be.oneOf([200,201,202]);", 9213 "});", 9214 "", 9215 "var response = pm.response.json();", 9216 "", 9217 "pm.test('Schema is valid', function() {", 9218 " pm.expect(response).to.have.property(\"token\");", 9219 "});", 9220 "", 9221 "pm.test('Data is valid', function() {", 9222 " pm.expect(typeof response.token).to.equal(\"string\");", 9223 "});" 9224 ], 9225 "type": "text/javascript" 9226 } 9227 } 9228 ], 9229 "request": { 9230 "method": "POST", 9231 "header": [], 9232 "url": { 9233 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9234 "protocol": "{{protocol}}", 9235 "host": [ 9236 "{{host}}" 9237 ], 9238 "port": "{{port}}", 9239 "path": [ 9240 "{{web_root}}", 9241 "api", 9242 "devices", 9243 "" 9244 ] 9245 } 9246 }, 9247 "response": [] 9248 }, 9249 { 9250 "name": "Clean up: Wait device timeout", 9251 "event": [ 9252 { 9253 "listen": "test", 9254 "script": { 9255 "id": "3bdb0f7c-1261-465e-9b02-0070005f0c43", 9256 "exec": [ 9257 "" 9258 ], 9259 "type": "text/javascript" 9260 } 9261 }, 9262 { 9263 "listen": "prerequest", 9264 "script": { 9265 "id": "a1cf5880-7b8e-4bc6-9d92-59632a719c54", 9266 "exec": [ 9267 "var timeout = parseInt(pm.environment.get(\"device_timeout\")) + 500", 9268 "", 9269 "setTimeout(function () {}, timeout);" 9270 ], 9271 "type": "text/javascript" 9272 } 9273 } 9274 ], 9275 "request": { 9276 "method": "GET", 9277 "header": [], 9278 "url": { 9279 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9280 "protocol": "{{protocol}}", 9281 "host": [ 9282 "{{host}}" 9283 ], 9284 "port": "{{port}}", 9285 "path": [ 9286 "{{web_root}}", 9287 "api", 9288 "devices", 9289 "" 9290 ] 9291 } 9292 }, 9293 "response": [] 9294 } 9295 ], 9296 "protocolProfileBehavior": {}, 9297 "_postman_isSubFolder": true 9298 }, 9299 { 9300 "name": "read device", 9301 "item": [ 9302 { 9303 "name": "Device not found", 9304 "item": [ 9305 { 9306 "name": "Read device", 9307 "event": [ 9308 { 9309 "listen": "test", 9310 "script": { 9311 "id": "a4401cbc-0a3a-4c2d-b1ed-e7d6867614ff", 9312 "exec": [ 9313 "pm.test(\"Successful GET request\", function () {", 9314 " pm.expect(pm.response.code).to.equal(404);", 9315 "});" 9316 ], 9317 "type": "text/javascript" 9318 } 9319 }, 9320 { 9321 "listen": "prerequest", 9322 "script": { 9323 "id": "1644fd70-b4c4-4207-8e12-67752a984417", 9324 "exec": [ 9325 "" 9326 ], 9327 "type": "text/javascript" 9328 } 9329 } 9330 ], 9331 "request": { 9332 "method": "GET", 9333 "header": [], 9334 "url": { 9335 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/invalid_token", 9336 "protocol": "{{protocol}}", 9337 "host": [ 9338 "{{host}}" 9339 ], 9340 "port": "{{port}}", 9341 "path": [ 9342 "{{web_root}}", 9343 "api", 9344 "devices", 9345 "invalid_token" 9346 ] 9347 } 9348 }, 9349 "response": [] 9350 } 9351 ], 9352 "protocolProfileBehavior": {}, 9353 "_postman_isSubFolder": true 9354 }, 9355 { 9356 "name": "Device found", 9357 "item": [ 9358 { 9359 "name": "Prep: Create device", 9360 "event": [ 9361 { 9362 "listen": "test", 9363 "script": { 9364 "id": "c4f14137-5ced-449b-a872-b7d541e2f6af", 9365 "exec": [ 9366 "var response = pm.response.json();", 9367 "var token = response.token;", 9368 "", 9369 "pm.globals.set(\"device_token\", token)" 9370 ], 9371 "type": "text/javascript" 9372 } 9373 } 9374 ], 9375 "request": { 9376 "method": "POST", 9377 "header": [], 9378 "url": { 9379 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9380 "protocol": "{{protocol}}", 9381 "host": [ 9382 "{{host}}" 9383 ], 9384 "port": "{{port}}", 9385 "path": [ 9386 "{{web_root}}", 9387 "api", 9388 "devices", 9389 "" 9390 ] 9391 } 9392 }, 9393 "response": [] 9394 }, 9395 { 9396 "name": "Read device", 9397 "event": [ 9398 { 9399 "listen": "test", 9400 "script": { 9401 "id": "61a840f1-d3cd-4d7a-a54f-30da1266e48f", 9402 "exec": [ 9403 "pm.test(\"Successful GET request\", function () {", 9404 " pm.expect(pm.response.code).to.be.oneOf([200]);", 9405 "});", 9406 "", 9407 "var response = pm.response.json();", 9408 "", 9409 "pm.test('Schema is valid', function() {", 9410 " pm.expect(response).to.have.property(\"token\");", 9411 " pm.expect(response).to.have.property(\"user_agent\");", 9412 " pm.expect(response).to.have.property(\"last_active\");", 9413 " pm.expect(response).to.have.property(\"name\");", 9414 "});", 9415 "", 9416 "pm.test('Data is valid', function() {", 9417 " pm.expect(typeof response.token).to.equal(\"string\");", 9418 " pm.expect(typeof response.user_agent).to.equal(\"string\");", 9419 " pm.expect(typeof response.last_active).to.equal(\"string\");", 9420 " pm.expect(typeof response.name).to.equal(\"string\");", 9421 "});" 9422 ], 9423 "type": "text/javascript" 9424 } 9425 } 9426 ], 9427 "request": { 9428 "method": "GET", 9429 "header": [], 9430 "url": { 9431 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/{{device_token}}", 9432 "protocol": "{{protocol}}", 9433 "host": [ 9434 "{{host}}" 9435 ], 9436 "port": "{{port}}", 9437 "path": [ 9438 "{{web_root}}", 9439 "api", 9440 "devices", 9441 "{{device_token}}" 9442 ] 9443 } 9444 }, 9445 "response": [] 9446 }, 9447 { 9448 "name": "Clean up: Wait device timeout", 9449 "event": [ 9450 { 9451 "listen": "test", 9452 "script": { 9453 "id": "17112336-b962-472d-86a8-7872ff9876d1", 9454 "exec": [ 9455 "" 9456 ], 9457 "type": "text/javascript" 9458 } 9459 }, 9460 { 9461 "listen": "prerequest", 9462 "script": { 9463 "id": "912939cc-1685-4e1f-b0a6-696b264870ca", 9464 "exec": [ 9465 "var timeout = parseInt(pm.environment.get(\"device_timeout\")) + 500", 9466 "", 9467 "setTimeout(function () {}, timeout);" 9468 ], 9469 "type": "text/javascript" 9470 } 9471 } 9472 ], 9473 "request": { 9474 "method": "GET", 9475 "header": [], 9476 "url": { 9477 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9478 "protocol": "{{protocol}}", 9479 "host": [ 9480 "{{host}}" 9481 ], 9482 "port": "{{port}}", 9483 "path": [ 9484 "{{web_root}}", 9485 "api", 9486 "devices", 9487 "" 9488 ] 9489 } 9490 }, 9491 "response": [] 9492 } 9493 ], 9494 "protocolProfileBehavior": {}, 9495 "_postman_isSubFolder": true 9496 }, 9497 { 9498 "name": "Timed out device", 9499 "item": [ 9500 { 9501 "name": "Prep: Create device", 9502 "event": [ 9503 { 9504 "listen": "test", 9505 "script": { 9506 "id": "c99b9318-1e50-4702-9d81-53d87faa1080", 9507 "exec": [ 9508 "var response = pm.response.json();", 9509 "var token = response.token;", 9510 "", 9511 "pm.globals.set(\"device_token\", token)" 9512 ], 9513 "type": "text/javascript" 9514 } 9515 } 9516 ], 9517 "request": { 9518 "method": "POST", 9519 "header": [], 9520 "url": { 9521 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9522 "protocol": "{{protocol}}", 9523 "host": [ 9524 "{{host}}" 9525 ], 9526 "port": "{{port}}", 9527 "path": [ 9528 "{{web_root}}", 9529 "api", 9530 "devices", 9531 "" 9532 ] 9533 } 9534 }, 9535 "response": [] 9536 }, 9537 { 9538 "name": "Wait device timeout", 9539 "event": [ 9540 { 9541 "listen": "test", 9542 "script": { 9543 "id": "89517dc9-31b4-40e7-89e4-99dd6e792e6a", 9544 "exec": [ 9545 "" 9546 ], 9547 "type": "text/javascript" 9548 } 9549 }, 9550 { 9551 "listen": "prerequest", 9552 "script": { 9553 "id": "ed20bbf6-4f31-4d91-a07b-7a0b4afcf161", 9554 "exec": [ 9555 "var timeout = parseInt(pm.environment.get(\"device_timeout\")) + 500", 9556 "", 9557 "setTimeout(function () {}, timeout);" 9558 ], 9559 "type": "text/javascript" 9560 } 9561 } 9562 ], 9563 "request": { 9564 "method": "GET", 9565 "header": [], 9566 "url": { 9567 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9568 "protocol": "{{protocol}}", 9569 "host": [ 9570 "{{host}}" 9571 ], 9572 "port": "{{port}}", 9573 "path": [ 9574 "{{web_root}}", 9575 "api", 9576 "devices", 9577 "" 9578 ] 9579 } 9580 }, 9581 "response": [] 9582 }, 9583 { 9584 "name": "Read device", 9585 "event": [ 9586 { 9587 "listen": "test", 9588 "script": { 9589 "id": "7b7496f5-2fdc-470c-b394-2a5ae7d29da2", 9590 "exec": [ 9591 "pm.test(\"Successful GET request\", function () {", 9592 " pm.expect(pm.response.code).to.equal(404);", 9593 "});" 9594 ], 9595 "type": "text/javascript" 9596 } 9597 }, 9598 { 9599 "listen": "prerequest", 9600 "script": { 9601 "id": "1807f152-7ef4-4277-9db6-1bff53d6cc8b", 9602 "exec": [ 9603 "" 9604 ], 9605 "type": "text/javascript" 9606 } 9607 } 9608 ], 9609 "request": { 9610 "method": "GET", 9611 "header": [], 9612 "url": { 9613 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/{{device_token}}", 9614 "protocol": "{{protocol}}", 9615 "host": [ 9616 "{{host}}" 9617 ], 9618 "port": "{{port}}", 9619 "path": [ 9620 "{{web_root}}", 9621 "api", 9622 "devices", 9623 "{{device_token}}" 9624 ] 9625 } 9626 }, 9627 "response": [] 9628 } 9629 ], 9630 "protocolProfileBehavior": {}, 9631 "_postman_isSubFolder": true 9632 } 9633 ], 9634 "protocolProfileBehavior": {}, 9635 "_postman_isSubFolder": true 9636 }, 9637 { 9638 "name": "read devices", 9639 "item": [ 9640 { 9641 "name": "Prep: Create device A", 9642 "event": [ 9643 { 9644 "listen": "test", 9645 "script": { 9646 "id": "a7803c5c-f371-4ae0-8b08-1c06995c9b60", 9647 "exec": [ 9648 "var response = pm.response.json();", 9649 "var token = response.token;", 9650 "", 9651 "pm.globals.set(\"device_token_a\", token)" 9652 ], 9653 "type": "text/javascript" 9654 } 9655 } 9656 ], 9657 "request": { 9658 "method": "POST", 9659 "header": [], 9660 "url": { 9661 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9662 "protocol": "{{protocol}}", 9663 "host": [ 9664 "{{host}}" 9665 ], 9666 "port": "{{port}}", 9667 "path": [ 9668 "{{web_root}}", 9669 "api", 9670 "devices", 9671 "" 9672 ] 9673 } 9674 }, 9675 "response": [] 9676 }, 9677 { 9678 "name": "Prep: Create device B", 9679 "event": [ 9680 { 9681 "listen": "test", 9682 "script": { 9683 "id": "02450903-aef9-4ee6-9d48-94ba9b5fd54c", 9684 "exec": [ 9685 "var response = pm.response.json();", 9686 "var token = response.token;", 9687 "", 9688 "pm.globals.set(\"device_token_b\", token)" 9689 ], 9690 "type": "text/javascript" 9691 } 9692 } 9693 ], 9694 "request": { 9695 "method": "POST", 9696 "header": [], 9697 "url": { 9698 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9699 "protocol": "{{protocol}}", 9700 "host": [ 9701 "{{host}}" 9702 ], 9703 "port": "{{port}}", 9704 "path": [ 9705 "{{web_root}}", 9706 "api", 9707 "devices", 9708 "" 9709 ] 9710 } 9711 }, 9712 "response": [] 9713 }, 9714 { 9715 "name": "Read devices", 9716 "event": [ 9717 { 9718 "listen": "test", 9719 "script": { 9720 "id": "1612417b-bed8-48d5-a6a3-39d0d0fe6932", 9721 "exec": [ 9722 "pm.test(\"Successful GET request\", function () {", 9723 " pm.expect(pm.response.code).to.be.oneOf([200]);", 9724 "});", 9725 "", 9726 "var response = pm.response.json();", 9727 "", 9728 "pm.test('Schema is valid', function() {", 9729 " pm.expect(response).to.be.instanceof(Array);", 9730 " response.forEach(element => {", 9731 " pm.expect(element).to.have.property(\"token\");", 9732 " pm.expect(element).to.have.property(\"user_agent\");", 9733 " pm.expect(element).to.have.property(\"last_active\");", 9734 " pm.expect(element).to.have.property(\"name\");", 9735 " })", 9736 "});", 9737 "", 9738 "pm.test('Data is valid', function() {", 9739 " pm.expect(response).to.have.lengthOf(2);", 9740 " var devices_left = [", 9741 " pm.globals.get(\"device_token_a\"), ", 9742 " pm.globals.get(\"device_token_b\")", 9743 " ]", 9744 " response.forEach(element => {", 9745 " pm.expect(typeof element.token).to.equal(\"string\");", 9746 " pm.expect(typeof element.user_agent).to.equal(\"string\");", 9747 " pm.expect(typeof element.last_active).to.equal(\"string\");", 9748 " pm.expect(typeof element.name).to.equal(\"string\");", 9749 " pm.expect(devices_left).to.include(element.token);", 9750 " devices_left.splice(devices_left.indexOf(element.token), 1);", 9751 " })", 9752 "});" 9753 ], 9754 "type": "text/javascript" 9755 } 9756 } 9757 ], 9758 "request": { 9759 "method": "GET", 9760 "header": [], 9761 "url": { 9762 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9763 "protocol": "{{protocol}}", 9764 "host": [ 9765 "{{host}}" 9766 ], 9767 "port": "{{port}}", 9768 "path": [ 9769 "{{web_root}}", 9770 "api", 9771 "devices", 9772 "" 9773 ] 9774 } 9775 }, 9776 "response": [] 9777 }, 9778 { 9779 "name": "Clean up: Wait device timeout", 9780 "event": [ 9781 { 9782 "listen": "test", 9783 "script": { 9784 "id": "9b7ff623-8aac-46d1-9c56-1ceb8acc2de6", 9785 "exec": [ 9786 "" 9787 ], 9788 "type": "text/javascript" 9789 } 9790 }, 9791 { 9792 "listen": "prerequest", 9793 "script": { 9794 "id": "c0fbf742-f75e-4f3b-a576-75c9d5e0f72d", 9795 "exec": [ 9796 "var timeout = parseInt(pm.environment.get(\"device_timeout\")) + 500", 9797 "", 9798 "setTimeout(function () {}, timeout);" 9799 ], 9800 "type": "text/javascript" 9801 } 9802 } 9803 ], 9804 "request": { 9805 "method": "GET", 9806 "header": [], 9807 "url": { 9808 "raw": "{{protocol}}://{{host}}:{{port}}/{{web_root}}/api/devices/", 9809 "protocol": "{{protocol}}", 9810 "host": [ 9811 "{{host}}" 9812 ], 9813 "port": "{{port}}", 9814 "path": [ 9815 "{{web_root}}", 9816 "api", 9817 "devices", 9818 "" 9819 ] 9820 } 9821 }, 9822 "response": [] 9823 } 9824 ], 9825 "protocolProfileBehavior": {}, 9826 "_postman_isSubFolder": true 9827 } 9828 ], 9829 "protocolProfileBehavior": {} 9830 } 9831 ], 9832 "protocolProfileBehavior": {} 9833 }