From 327861b353e9033028f8913031275c407cf3bd6e Mon Sep 17 00:00:00 2001 From: shubh-bruno Date: Thu, 7 May 2026 23:30:32 +0530 Subject: [PATCH] fix: persist scroll for assertions (#7947) --- .../RequestPane/Assertions/index.js | 1 + .../fixtures/collection/assertions-many.bru | 74 ++ .../fixtures/collection/body-json.bru | 268 ++++++ .../fixtures/collection/body-xml.bru | 167 ++++ .../fixtures/collection/bruno.json | 6 + .../fixtures/collection/collection.bru | 837 +++++++++++++++++ .../fixtures/collection/headers-many.bru | 114 +++ .../body-scroll/fixtures/collection/req-a.bru | 268 ++++++ .../body-scroll/fixtures/collection/req-b.bru | 268 ++++++ .../fixtures/collection/script.bru | 337 +++++++ .../collection/test-folder/folder-req.bru | 11 + .../collection/test-folder/folder.bru | 838 ++++++++++++++++++ .../body-scroll/fixtures/collection/tests.bru | 174 ++++ .../init-user-data/preferences.json | 11 + .../body-scroll/scroll-persistent.spec.ts | 297 +++---- 15 files changed, 3519 insertions(+), 152 deletions(-) create mode 100644 tests/request/body-scroll/fixtures/collection/assertions-many.bru create mode 100644 tests/request/body-scroll/fixtures/collection/body-json.bru create mode 100644 tests/request/body-scroll/fixtures/collection/body-xml.bru create mode 100644 tests/request/body-scroll/fixtures/collection/bruno.json create mode 100644 tests/request/body-scroll/fixtures/collection/collection.bru create mode 100644 tests/request/body-scroll/fixtures/collection/headers-many.bru create mode 100644 tests/request/body-scroll/fixtures/collection/req-a.bru create mode 100644 tests/request/body-scroll/fixtures/collection/req-b.bru create mode 100644 tests/request/body-scroll/fixtures/collection/script.bru create mode 100644 tests/request/body-scroll/fixtures/collection/test-folder/folder-req.bru create mode 100644 tests/request/body-scroll/fixtures/collection/test-folder/folder.bru create mode 100644 tests/request/body-scroll/fixtures/collection/tests.bru create mode 100644 tests/request/body-scroll/init-user-data/preferences.json diff --git a/packages/bruno-app/src/components/RequestPane/Assertions/index.js b/packages/bruno-app/src/components/RequestPane/Assertions/index.js index 5c0535af7..a7cdc19d2 100644 --- a/packages/bruno-app/src/components/RequestPane/Assertions/index.js +++ b/packages/bruno-app/src/components/RequestPane/Assertions/index.js @@ -183,6 +183,7 @@ const Assertions = ({ item, collection }) => { testId="assertions-table" columnWidths={assertionsWidths} onColumnWidthsChange={(widths) => handleColumnWidthsChange('assertions', widths)} + initialScroll={scroll} /> ); diff --git a/tests/request/body-scroll/fixtures/collection/assertions-many.bru b/tests/request/body-scroll/fixtures/collection/assertions-many.bru new file mode 100644 index 000000000..21375dab2 --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/assertions-many.bru @@ -0,0 +1,74 @@ +meta { + name: assertions-many + type: http + seq: 8 +} + +get { + url: https://echo.usebruno.com + body: none + auth: none +} + +assert { + res.body.field1: eq value-1 + res.body.field2: eq value-2 + res.body.field3: eq value-3 + res.body.field4: eq value-4 + res.body.field5: eq value-5 + res.body.field6: eq value-6 + res.body.field7: eq value-7 + res.body.field8: eq value-8 + res.body.field9: eq value-9 + res.body.field10: eq value-10 + res.body.field11: eq value-11 + res.body.field12: eq value-12 + res.body.field13: eq value-13 + res.body.field14: eq value-14 + res.body.field15: eq value-15 + res.body.field16: eq value-16 + res.body.field17: eq value-17 + res.body.field18: eq value-18 + res.body.field19: eq value-19 + res.body.field20: eq value-20 + res.body.field21: eq value-21 + res.body.field22: eq value-22 + res.body.field23: eq value-23 + res.body.field24: eq value-24 + res.body.field25: eq value-25 + res.body.field26: eq value-26 + res.body.field27: eq value-27 + res.body.field28: eq value-28 + res.body.field29: eq value-29 + res.body.field30: eq value-30 + res.body.field31: eq value-31 + res.body.field32: eq value-32 + res.body.field33: eq value-33 + res.body.field34: eq value-34 + res.body.field35: eq value-35 + res.body.field36: eq value-36 + res.body.field37: eq value-37 + res.body.field38: eq value-38 + res.body.field39: eq value-39 + res.body.field40: eq value-40 + res.body.field41: eq value-41 + res.body.field42: eq value-42 + res.body.field43: eq value-43 + res.body.field44: eq value-44 + res.body.field45: eq value-45 + res.body.field46: eq value-46 + res.body.field47: eq value-47 + res.body.field48: eq value-48 + res.body.field49: eq value-49 + res.body.field50: eq value-50 + res.body.field51: eq value-51 + res.body.field52: eq value-52 + res.body.field53: eq value-53 + res.body.field54: eq value-54 + res.body.field55: eq value-55 + res.body.field56: eq value-56 + res.body.field57: eq value-57 + res.body.field58: eq value-58 + res.body.field59: eq value-59 + res.body.field60: eq value-60 +} diff --git a/tests/request/body-scroll/fixtures/collection/body-json.bru b/tests/request/body-scroll/fixtures/collection/body-json.bru new file mode 100644 index 000000000..53fbd3662 --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/body-json.bru @@ -0,0 +1,268 @@ +meta { + name: body-json + type: http + seq: 1 +} + +post { + url: https://echo.usebruno.com + body: json + auth: none +} + +body:json { + { + "users": [ + { + "id": 1, + "name": "User 1", + "email": "user1@example.com" + }, + { + "id": 2, + "name": "User 2", + "email": "user2@example.com" + }, + { + "id": 3, + "name": "User 3", + "email": "user3@example.com" + }, + { + "id": 4, + "name": "User 4", + "email": "user4@example.com" + }, + { + "id": 5, + "name": "User 5", + "email": "user5@example.com" + }, + { + "id": 6, + "name": "User 6", + "email": "user6@example.com" + }, + { + "id": 7, + "name": "User 7", + "email": "user7@example.com" + }, + { + "id": 8, + "name": "User 8", + "email": "user8@example.com" + }, + { + "id": 9, + "name": "User 9", + "email": "user9@example.com" + }, + { + "id": 10, + "name": "User 10", + "email": "user10@example.com" + }, + { + "id": 11, + "name": "User 11", + "email": "user11@example.com" + }, + { + "id": 12, + "name": "User 12", + "email": "user12@example.com" + }, + { + "id": 13, + "name": "User 13", + "email": "user13@example.com" + }, + { + "id": 14, + "name": "User 14", + "email": "user14@example.com" + }, + { + "id": 15, + "name": "User 15", + "email": "user15@example.com" + }, + { + "id": 16, + "name": "User 16", + "email": "user16@example.com" + }, + { + "id": 17, + "name": "User 17", + "email": "user17@example.com" + }, + { + "id": 18, + "name": "User 18", + "email": "user18@example.com" + }, + { + "id": 19, + "name": "User 19", + "email": "user19@example.com" + }, + { + "id": 20, + "name": "User 20", + "email": "user20@example.com" + }, + { + "id": 21, + "name": "User 21", + "email": "user21@example.com" + }, + { + "id": 22, + "name": "User 22", + "email": "user22@example.com" + }, + { + "id": 23, + "name": "User 23", + "email": "user23@example.com" + }, + { + "id": 24, + "name": "User 24", + "email": "user24@example.com" + }, + { + "id": 25, + "name": "User 25", + "email": "user25@example.com" + }, + { + "id": 26, + "name": "User 26", + "email": "user26@example.com" + }, + { + "id": 27, + "name": "User 27", + "email": "user27@example.com" + }, + { + "id": 28, + "name": "User 28", + "email": "user28@example.com" + }, + { + "id": 29, + "name": "User 29", + "email": "user29@example.com" + }, + { + "id": 30, + "name": "User 30", + "email": "user30@example.com" + }, + { + "id": 31, + "name": "User 31", + "email": "user31@example.com" + }, + { + "id": 32, + "name": "User 32", + "email": "user32@example.com" + }, + { + "id": 33, + "name": "User 33", + "email": "user33@example.com" + }, + { + "id": 34, + "name": "User 34", + "email": "user34@example.com" + }, + { + "id": 35, + "name": "User 35", + "email": "user35@example.com" + }, + { + "id": 36, + "name": "User 36", + "email": "user36@example.com" + }, + { + "id": 37, + "name": "User 37", + "email": "user37@example.com" + }, + { + "id": 38, + "name": "User 38", + "email": "user38@example.com" + }, + { + "id": 39, + "name": "User 39", + "email": "user39@example.com" + }, + { + "id": 40, + "name": "User 40", + "email": "user40@example.com" + }, + { + "id": 41, + "name": "User 41", + "email": "user41@example.com" + }, + { + "id": 42, + "name": "User 42", + "email": "user42@example.com" + }, + { + "id": 43, + "name": "User 43", + "email": "user43@example.com" + }, + { + "id": 44, + "name": "User 44", + "email": "user44@example.com" + }, + { + "id": 45, + "name": "User 45", + "email": "user45@example.com" + }, + { + "id": 46, + "name": "User 46", + "email": "user46@example.com" + }, + { + "id": 47, + "name": "User 47", + "email": "user47@example.com" + }, + { + "id": 48, + "name": "User 48", + "email": "user48@example.com" + }, + { + "id": 49, + "name": "User 49", + "email": "user49@example.com" + }, + { + "id": 50, + "name": "User 50", + "email": "user50@example.com" + } + ] + } +} diff --git a/tests/request/body-scroll/fixtures/collection/body-xml.bru b/tests/request/body-scroll/fixtures/collection/body-xml.bru new file mode 100644 index 000000000..fc2b2fa36 --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/body-xml.bru @@ -0,0 +1,167 @@ +meta { + name: body-xml + type: http + seq: 2 +} + +post { + url: https://echo.usebruno.com + body: xml + auth: none +} + +body:xml { + + + Item 1 + Item 2 + Item 3 + Item 4 + Item 5 + Item 6 + Item 7 + Item 8 + Item 9 + Item 10 + Item 11 + Item 12 + Item 13 + Item 14 + Item 15 + Item 16 + Item 17 + Item 18 + Item 19 + Item 20 + Item 21 + Item 22 + Item 23 + Item 24 + Item 25 + Item 26 + Item 27 + Item 28 + Item 29 + Item 30 + Item 31 + Item 32 + Item 33 + Item 34 + Item 35 + Item 36 + Item 37 + Item 38 + Item 39 + Item 40 + Item 41 + Item 42 + Item 43 + Item 44 + Item 45 + Item 46 + Item 47 + Item 48 + Item 49 + Item 50 + Item 51 + Item 52 + Item 53 + Item 54 + Item 55 + Item 56 + Item 57 + Item 58 + Item 59 + Item 60 + Item 61 + Item 62 + Item 63 + Item 64 + Item 65 + Item 66 + Item 67 + Item 68 + Item 69 + Item 70 + Item 71 + Item 72 + Item 73 + Item 74 + Item 75 + Item 76 + Item 77 + Item 78 + Item 79 + Item 80 + Item 81 + Item 82 + Item 83 + Item 84 + Item 85 + Item 86 + Item 87 + Item 88 + Item 89 + Item 90 + Item 91 + Item 92 + Item 93 + Item 94 + Item 95 + Item 96 + Item 97 + Item 98 + Item 99 + Item 100 + Item 101 + Item 102 + Item 103 + Item 104 + Item 105 + Item 106 + Item 107 + Item 108 + Item 109 + Item 110 + Item 111 + Item 112 + Item 113 + Item 114 + Item 115 + Item 116 + Item 117 + Item 118 + Item 119 + Item 120 + Item 121 + Item 122 + Item 123 + Item 124 + Item 125 + Item 126 + Item 127 + Item 128 + Item 129 + Item 130 + Item 131 + Item 132 + Item 133 + Item 134 + Item 135 + Item 136 + Item 137 + Item 138 + Item 139 + Item 140 + Item 141 + Item 142 + Item 143 + Item 144 + Item 145 + Item 146 + Item 147 + Item 148 + Item 149 + Item 150 + +} diff --git a/tests/request/body-scroll/fixtures/collection/bruno.json b/tests/request/body-scroll/fixtures/collection/bruno.json new file mode 100644 index 000000000..caf1c54f4 --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/bruno.json @@ -0,0 +1,6 @@ +{ + "version": "1", + "name": "scroll-fixtures", + "type": "collection", + "uid": "scroll-fixtures-uid" +} diff --git a/tests/request/body-scroll/fixtures/collection/collection.bru b/tests/request/body-scroll/fixtures/collection/collection.bru new file mode 100644 index 000000000..c881a2287 --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/collection.bru @@ -0,0 +1,837 @@ +meta { + name: scroll-fixtures +} + +script:pre-request { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} + +script:post-response { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} + +tests { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} + +docs { + ## Section 1 + Lorem ipsum dolor sit amet for section 1. + + ## Section 2 + Lorem ipsum dolor sit amet for section 2. + + ## Section 3 + Lorem ipsum dolor sit amet for section 3. + + ## Section 4 + Lorem ipsum dolor sit amet for section 4. + + ## Section 5 + Lorem ipsum dolor sit amet for section 5. + + ## Section 6 + Lorem ipsum dolor sit amet for section 6. + + ## Section 7 + Lorem ipsum dolor sit amet for section 7. + + ## Section 8 + Lorem ipsum dolor sit amet for section 8. + + ## Section 9 + Lorem ipsum dolor sit amet for section 9. + + ## Section 10 + Lorem ipsum dolor sit amet for section 10. + + ## Section 11 + Lorem ipsum dolor sit amet for section 11. + + ## Section 12 + Lorem ipsum dolor sit amet for section 12. + + ## Section 13 + Lorem ipsum dolor sit amet for section 13. + + ## Section 14 + Lorem ipsum dolor sit amet for section 14. + + ## Section 15 + Lorem ipsum dolor sit amet for section 15. + + ## Section 16 + Lorem ipsum dolor sit amet for section 16. + + ## Section 17 + Lorem ipsum dolor sit amet for section 17. + + ## Section 18 + Lorem ipsum dolor sit amet for section 18. + + ## Section 19 + Lorem ipsum dolor sit amet for section 19. + + ## Section 20 + Lorem ipsum dolor sit amet for section 20. + + ## Section 21 + Lorem ipsum dolor sit amet for section 21. + + ## Section 22 + Lorem ipsum dolor sit amet for section 22. + + ## Section 23 + Lorem ipsum dolor sit amet for section 23. + + ## Section 24 + Lorem ipsum dolor sit amet for section 24. + + ## Section 25 + Lorem ipsum dolor sit amet for section 25. + + ## Section 26 + Lorem ipsum dolor sit amet for section 26. + + ## Section 27 + Lorem ipsum dolor sit amet for section 27. + + ## Section 28 + Lorem ipsum dolor sit amet for section 28. + + ## Section 29 + Lorem ipsum dolor sit amet for section 29. + + ## Section 30 + Lorem ipsum dolor sit amet for section 30. + + ## Section 31 + Lorem ipsum dolor sit amet for section 31. + + ## Section 32 + Lorem ipsum dolor sit amet for section 32. + + ## Section 33 + Lorem ipsum dolor sit amet for section 33. + + ## Section 34 + Lorem ipsum dolor sit amet for section 34. + + ## Section 35 + Lorem ipsum dolor sit amet for section 35. + + ## Section 36 + Lorem ipsum dolor sit amet for section 36. + + ## Section 37 + Lorem ipsum dolor sit amet for section 37. + + ## Section 38 + Lorem ipsum dolor sit amet for section 38. + + ## Section 39 + Lorem ipsum dolor sit amet for section 39. + + ## Section 40 + Lorem ipsum dolor sit amet for section 40. + + ## Section 41 + Lorem ipsum dolor sit amet for section 41. + + ## Section 42 + Lorem ipsum dolor sit amet for section 42. + + ## Section 43 + Lorem ipsum dolor sit amet for section 43. + + ## Section 44 + Lorem ipsum dolor sit amet for section 44. + + ## Section 45 + Lorem ipsum dolor sit amet for section 45. + + ## Section 46 + Lorem ipsum dolor sit amet for section 46. + + ## Section 47 + Lorem ipsum dolor sit amet for section 47. + + ## Section 48 + Lorem ipsum dolor sit amet for section 48. + + ## Section 49 + Lorem ipsum dolor sit amet for section 49. + + ## Section 50 + Lorem ipsum dolor sit amet for section 50. + + ## Section 51 + Lorem ipsum dolor sit amet for section 51. + + ## Section 52 + Lorem ipsum dolor sit amet for section 52. + + ## Section 53 + Lorem ipsum dolor sit amet for section 53. + + ## Section 54 + Lorem ipsum dolor sit amet for section 54. + + ## Section 55 + Lorem ipsum dolor sit amet for section 55. + + ## Section 56 + Lorem ipsum dolor sit amet for section 56. + + ## Section 57 + Lorem ipsum dolor sit amet for section 57. + + ## Section 58 + Lorem ipsum dolor sit amet for section 58. + + ## Section 59 + Lorem ipsum dolor sit amet for section 59. + + ## Section 60 + Lorem ipsum dolor sit amet for section 60. + + ## Section 61 + Lorem ipsum dolor sit amet for section 61. + + ## Section 62 + Lorem ipsum dolor sit amet for section 62. + + ## Section 63 + Lorem ipsum dolor sit amet for section 63. + + ## Section 64 + Lorem ipsum dolor sit amet for section 64. + + ## Section 65 + Lorem ipsum dolor sit amet for section 65. + + ## Section 66 + Lorem ipsum dolor sit amet for section 66. + + ## Section 67 + Lorem ipsum dolor sit amet for section 67. + + ## Section 68 + Lorem ipsum dolor sit amet for section 68. + + ## Section 69 + Lorem ipsum dolor sit amet for section 69. + + ## Section 70 + Lorem ipsum dolor sit amet for section 70. + + ## Section 71 + Lorem ipsum dolor sit amet for section 71. + + ## Section 72 + Lorem ipsum dolor sit amet for section 72. + + ## Section 73 + Lorem ipsum dolor sit amet for section 73. + + ## Section 74 + Lorem ipsum dolor sit amet for section 74. + + ## Section 75 + Lorem ipsum dolor sit amet for section 75. + + ## Section 76 + Lorem ipsum dolor sit amet for section 76. + + ## Section 77 + Lorem ipsum dolor sit amet for section 77. + + ## Section 78 + Lorem ipsum dolor sit amet for section 78. + + ## Section 79 + Lorem ipsum dolor sit amet for section 79. + + ## Section 80 + Lorem ipsum dolor sit amet for section 80. +} + +headers { + X-Custom-Header-1: value-1 + X-Custom-Header-2: value-2 + X-Custom-Header-3: value-3 + X-Custom-Header-4: value-4 + X-Custom-Header-5: value-5 + X-Custom-Header-6: value-6 + X-Custom-Header-7: value-7 + X-Custom-Header-8: value-8 + X-Custom-Header-9: value-9 + X-Custom-Header-10: value-10 + X-Custom-Header-11: value-11 + X-Custom-Header-12: value-12 + X-Custom-Header-13: value-13 + X-Custom-Header-14: value-14 + X-Custom-Header-15: value-15 + X-Custom-Header-16: value-16 + X-Custom-Header-17: value-17 + X-Custom-Header-18: value-18 + X-Custom-Header-19: value-19 + X-Custom-Header-20: value-20 + X-Custom-Header-21: value-21 + X-Custom-Header-22: value-22 + X-Custom-Header-23: value-23 + X-Custom-Header-24: value-24 + X-Custom-Header-25: value-25 + X-Custom-Header-26: value-26 + X-Custom-Header-27: value-27 + X-Custom-Header-28: value-28 + X-Custom-Header-29: value-29 + X-Custom-Header-30: value-30 + X-Custom-Header-31: value-31 + X-Custom-Header-32: value-32 + X-Custom-Header-33: value-33 + X-Custom-Header-34: value-34 + X-Custom-Header-35: value-35 + X-Custom-Header-36: value-36 + X-Custom-Header-37: value-37 + X-Custom-Header-38: value-38 + X-Custom-Header-39: value-39 + X-Custom-Header-40: value-40 + X-Custom-Header-41: value-41 + X-Custom-Header-42: value-42 + X-Custom-Header-43: value-43 + X-Custom-Header-44: value-44 + X-Custom-Header-45: value-45 + X-Custom-Header-46: value-46 + X-Custom-Header-47: value-47 + X-Custom-Header-48: value-48 + X-Custom-Header-49: value-49 + X-Custom-Header-50: value-50 + X-Custom-Header-51: value-51 + X-Custom-Header-52: value-52 + X-Custom-Header-53: value-53 + X-Custom-Header-54: value-54 + X-Custom-Header-55: value-55 + X-Custom-Header-56: value-56 + X-Custom-Header-57: value-57 + X-Custom-Header-58: value-58 + X-Custom-Header-59: value-59 + X-Custom-Header-60: value-60 + X-Custom-Header-61: value-61 + X-Custom-Header-62: value-62 + X-Custom-Header-63: value-63 + X-Custom-Header-64: value-64 + X-Custom-Header-65: value-65 + X-Custom-Header-66: value-66 + X-Custom-Header-67: value-67 + X-Custom-Header-68: value-68 + X-Custom-Header-69: value-69 + X-Custom-Header-70: value-70 + X-Custom-Header-71: value-71 + X-Custom-Header-72: value-72 + X-Custom-Header-73: value-73 + X-Custom-Header-74: value-74 + X-Custom-Header-75: value-75 + X-Custom-Header-76: value-76 + X-Custom-Header-77: value-77 + X-Custom-Header-78: value-78 + X-Custom-Header-79: value-79 + X-Custom-Header-80: value-80 + X-Custom-Header-81: value-81 + X-Custom-Header-82: value-82 + X-Custom-Header-83: value-83 + X-Custom-Header-84: value-84 + X-Custom-Header-85: value-85 + X-Custom-Header-86: value-86 + X-Custom-Header-87: value-87 + X-Custom-Header-88: value-88 + X-Custom-Header-89: value-89 + X-Custom-Header-90: value-90 + X-Custom-Header-91: value-91 + X-Custom-Header-92: value-92 + X-Custom-Header-93: value-93 + X-Custom-Header-94: value-94 + X-Custom-Header-95: value-95 + X-Custom-Header-96: value-96 + X-Custom-Header-97: value-97 + X-Custom-Header-98: value-98 + X-Custom-Header-99: value-99 + X-Custom-Header-100: value-100 +} diff --git a/tests/request/body-scroll/fixtures/collection/headers-many.bru b/tests/request/body-scroll/fixtures/collection/headers-many.bru new file mode 100644 index 000000000..9147162c6 --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/headers-many.bru @@ -0,0 +1,114 @@ +meta { + name: headers-many + type: http + seq: 7 +} + +get { + url: https://echo.usebruno.com + body: none + auth: none +} + +headers { + X-Custom-Header-1: value-1 + X-Custom-Header-2: value-2 + X-Custom-Header-3: value-3 + X-Custom-Header-4: value-4 + X-Custom-Header-5: value-5 + X-Custom-Header-6: value-6 + X-Custom-Header-7: value-7 + X-Custom-Header-8: value-8 + X-Custom-Header-9: value-9 + X-Custom-Header-10: value-10 + X-Custom-Header-11: value-11 + X-Custom-Header-12: value-12 + X-Custom-Header-13: value-13 + X-Custom-Header-14: value-14 + X-Custom-Header-15: value-15 + X-Custom-Header-16: value-16 + X-Custom-Header-17: value-17 + X-Custom-Header-18: value-18 + X-Custom-Header-19: value-19 + X-Custom-Header-20: value-20 + X-Custom-Header-21: value-21 + X-Custom-Header-22: value-22 + X-Custom-Header-23: value-23 + X-Custom-Header-24: value-24 + X-Custom-Header-25: value-25 + X-Custom-Header-26: value-26 + X-Custom-Header-27: value-27 + X-Custom-Header-28: value-28 + X-Custom-Header-29: value-29 + X-Custom-Header-30: value-30 + X-Custom-Header-31: value-31 + X-Custom-Header-32: value-32 + X-Custom-Header-33: value-33 + X-Custom-Header-34: value-34 + X-Custom-Header-35: value-35 + X-Custom-Header-36: value-36 + X-Custom-Header-37: value-37 + X-Custom-Header-38: value-38 + X-Custom-Header-39: value-39 + X-Custom-Header-40: value-40 + X-Custom-Header-41: value-41 + X-Custom-Header-42: value-42 + X-Custom-Header-43: value-43 + X-Custom-Header-44: value-44 + X-Custom-Header-45: value-45 + X-Custom-Header-46: value-46 + X-Custom-Header-47: value-47 + X-Custom-Header-48: value-48 + X-Custom-Header-49: value-49 + X-Custom-Header-50: value-50 + X-Custom-Header-51: value-51 + X-Custom-Header-52: value-52 + X-Custom-Header-53: value-53 + X-Custom-Header-54: value-54 + X-Custom-Header-55: value-55 + X-Custom-Header-56: value-56 + X-Custom-Header-57: value-57 + X-Custom-Header-58: value-58 + X-Custom-Header-59: value-59 + X-Custom-Header-60: value-60 + X-Custom-Header-61: value-61 + X-Custom-Header-62: value-62 + X-Custom-Header-63: value-63 + X-Custom-Header-64: value-64 + X-Custom-Header-65: value-65 + X-Custom-Header-66: value-66 + X-Custom-Header-67: value-67 + X-Custom-Header-68: value-68 + X-Custom-Header-69: value-69 + X-Custom-Header-70: value-70 + X-Custom-Header-71: value-71 + X-Custom-Header-72: value-72 + X-Custom-Header-73: value-73 + X-Custom-Header-74: value-74 + X-Custom-Header-75: value-75 + X-Custom-Header-76: value-76 + X-Custom-Header-77: value-77 + X-Custom-Header-78: value-78 + X-Custom-Header-79: value-79 + X-Custom-Header-80: value-80 + X-Custom-Header-81: value-81 + X-Custom-Header-82: value-82 + X-Custom-Header-83: value-83 + X-Custom-Header-84: value-84 + X-Custom-Header-85: value-85 + X-Custom-Header-86: value-86 + X-Custom-Header-87: value-87 + X-Custom-Header-88: value-88 + X-Custom-Header-89: value-89 + X-Custom-Header-90: value-90 + X-Custom-Header-91: value-91 + X-Custom-Header-92: value-92 + X-Custom-Header-93: value-93 + X-Custom-Header-94: value-94 + X-Custom-Header-95: value-95 + X-Custom-Header-96: value-96 + X-Custom-Header-97: value-97 + X-Custom-Header-98: value-98 + X-Custom-Header-99: value-99 + X-Custom-Header-100: value-100 +} diff --git a/tests/request/body-scroll/fixtures/collection/req-a.bru b/tests/request/body-scroll/fixtures/collection/req-a.bru new file mode 100644 index 000000000..ec3f7fc14 --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/req-a.bru @@ -0,0 +1,268 @@ +meta { + name: req-a + type: http + seq: 5 +} + +post { + url: https://echo.usebruno.com + body: json + auth: none +} + +body:json { + { + "users": [ + { + "id": 1, + "name": "User 1", + "email": "user1@example.com" + }, + { + "id": 2, + "name": "User 2", + "email": "user2@example.com" + }, + { + "id": 3, + "name": "User 3", + "email": "user3@example.com" + }, + { + "id": 4, + "name": "User 4", + "email": "user4@example.com" + }, + { + "id": 5, + "name": "User 5", + "email": "user5@example.com" + }, + { + "id": 6, + "name": "User 6", + "email": "user6@example.com" + }, + { + "id": 7, + "name": "User 7", + "email": "user7@example.com" + }, + { + "id": 8, + "name": "User 8", + "email": "user8@example.com" + }, + { + "id": 9, + "name": "User 9", + "email": "user9@example.com" + }, + { + "id": 10, + "name": "User 10", + "email": "user10@example.com" + }, + { + "id": 11, + "name": "User 11", + "email": "user11@example.com" + }, + { + "id": 12, + "name": "User 12", + "email": "user12@example.com" + }, + { + "id": 13, + "name": "User 13", + "email": "user13@example.com" + }, + { + "id": 14, + "name": "User 14", + "email": "user14@example.com" + }, + { + "id": 15, + "name": "User 15", + "email": "user15@example.com" + }, + { + "id": 16, + "name": "User 16", + "email": "user16@example.com" + }, + { + "id": 17, + "name": "User 17", + "email": "user17@example.com" + }, + { + "id": 18, + "name": "User 18", + "email": "user18@example.com" + }, + { + "id": 19, + "name": "User 19", + "email": "user19@example.com" + }, + { + "id": 20, + "name": "User 20", + "email": "user20@example.com" + }, + { + "id": 21, + "name": "User 21", + "email": "user21@example.com" + }, + { + "id": 22, + "name": "User 22", + "email": "user22@example.com" + }, + { + "id": 23, + "name": "User 23", + "email": "user23@example.com" + }, + { + "id": 24, + "name": "User 24", + "email": "user24@example.com" + }, + { + "id": 25, + "name": "User 25", + "email": "user25@example.com" + }, + { + "id": 26, + "name": "User 26", + "email": "user26@example.com" + }, + { + "id": 27, + "name": "User 27", + "email": "user27@example.com" + }, + { + "id": 28, + "name": "User 28", + "email": "user28@example.com" + }, + { + "id": 29, + "name": "User 29", + "email": "user29@example.com" + }, + { + "id": 30, + "name": "User 30", + "email": "user30@example.com" + }, + { + "id": 31, + "name": "User 31", + "email": "user31@example.com" + }, + { + "id": 32, + "name": "User 32", + "email": "user32@example.com" + }, + { + "id": 33, + "name": "User 33", + "email": "user33@example.com" + }, + { + "id": 34, + "name": "User 34", + "email": "user34@example.com" + }, + { + "id": 35, + "name": "User 35", + "email": "user35@example.com" + }, + { + "id": 36, + "name": "User 36", + "email": "user36@example.com" + }, + { + "id": 37, + "name": "User 37", + "email": "user37@example.com" + }, + { + "id": 38, + "name": "User 38", + "email": "user38@example.com" + }, + { + "id": 39, + "name": "User 39", + "email": "user39@example.com" + }, + { + "id": 40, + "name": "User 40", + "email": "user40@example.com" + }, + { + "id": 41, + "name": "User 41", + "email": "user41@example.com" + }, + { + "id": 42, + "name": "User 42", + "email": "user42@example.com" + }, + { + "id": 43, + "name": "User 43", + "email": "user43@example.com" + }, + { + "id": 44, + "name": "User 44", + "email": "user44@example.com" + }, + { + "id": 45, + "name": "User 45", + "email": "user45@example.com" + }, + { + "id": 46, + "name": "User 46", + "email": "user46@example.com" + }, + { + "id": 47, + "name": "User 47", + "email": "user47@example.com" + }, + { + "id": 48, + "name": "User 48", + "email": "user48@example.com" + }, + { + "id": 49, + "name": "User 49", + "email": "user49@example.com" + }, + { + "id": 50, + "name": "User 50", + "email": "user50@example.com" + } + ] + } +} diff --git a/tests/request/body-scroll/fixtures/collection/req-b.bru b/tests/request/body-scroll/fixtures/collection/req-b.bru new file mode 100644 index 000000000..6ada8236a --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/req-b.bru @@ -0,0 +1,268 @@ +meta { + name: req-b + type: http + seq: 6 +} + +post { + url: https://echo.usebruno.com + body: json + auth: none +} + +body:json { + { + "users": [ + { + "id": 1, + "name": "User 1", + "email": "user1@example.com" + }, + { + "id": 2, + "name": "User 2", + "email": "user2@example.com" + }, + { + "id": 3, + "name": "User 3", + "email": "user3@example.com" + }, + { + "id": 4, + "name": "User 4", + "email": "user4@example.com" + }, + { + "id": 5, + "name": "User 5", + "email": "user5@example.com" + }, + { + "id": 6, + "name": "User 6", + "email": "user6@example.com" + }, + { + "id": 7, + "name": "User 7", + "email": "user7@example.com" + }, + { + "id": 8, + "name": "User 8", + "email": "user8@example.com" + }, + { + "id": 9, + "name": "User 9", + "email": "user9@example.com" + }, + { + "id": 10, + "name": "User 10", + "email": "user10@example.com" + }, + { + "id": 11, + "name": "User 11", + "email": "user11@example.com" + }, + { + "id": 12, + "name": "User 12", + "email": "user12@example.com" + }, + { + "id": 13, + "name": "User 13", + "email": "user13@example.com" + }, + { + "id": 14, + "name": "User 14", + "email": "user14@example.com" + }, + { + "id": 15, + "name": "User 15", + "email": "user15@example.com" + }, + { + "id": 16, + "name": "User 16", + "email": "user16@example.com" + }, + { + "id": 17, + "name": "User 17", + "email": "user17@example.com" + }, + { + "id": 18, + "name": "User 18", + "email": "user18@example.com" + }, + { + "id": 19, + "name": "User 19", + "email": "user19@example.com" + }, + { + "id": 20, + "name": "User 20", + "email": "user20@example.com" + }, + { + "id": 21, + "name": "User 21", + "email": "user21@example.com" + }, + { + "id": 22, + "name": "User 22", + "email": "user22@example.com" + }, + { + "id": 23, + "name": "User 23", + "email": "user23@example.com" + }, + { + "id": 24, + "name": "User 24", + "email": "user24@example.com" + }, + { + "id": 25, + "name": "User 25", + "email": "user25@example.com" + }, + { + "id": 26, + "name": "User 26", + "email": "user26@example.com" + }, + { + "id": 27, + "name": "User 27", + "email": "user27@example.com" + }, + { + "id": 28, + "name": "User 28", + "email": "user28@example.com" + }, + { + "id": 29, + "name": "User 29", + "email": "user29@example.com" + }, + { + "id": 30, + "name": "User 30", + "email": "user30@example.com" + }, + { + "id": 31, + "name": "User 31", + "email": "user31@example.com" + }, + { + "id": 32, + "name": "User 32", + "email": "user32@example.com" + }, + { + "id": 33, + "name": "User 33", + "email": "user33@example.com" + }, + { + "id": 34, + "name": "User 34", + "email": "user34@example.com" + }, + { + "id": 35, + "name": "User 35", + "email": "user35@example.com" + }, + { + "id": 36, + "name": "User 36", + "email": "user36@example.com" + }, + { + "id": 37, + "name": "User 37", + "email": "user37@example.com" + }, + { + "id": 38, + "name": "User 38", + "email": "user38@example.com" + }, + { + "id": 39, + "name": "User 39", + "email": "user39@example.com" + }, + { + "id": 40, + "name": "User 40", + "email": "user40@example.com" + }, + { + "id": 41, + "name": "User 41", + "email": "user41@example.com" + }, + { + "id": 42, + "name": "User 42", + "email": "user42@example.com" + }, + { + "id": 43, + "name": "User 43", + "email": "user43@example.com" + }, + { + "id": 44, + "name": "User 44", + "email": "user44@example.com" + }, + { + "id": 45, + "name": "User 45", + "email": "user45@example.com" + }, + { + "id": 46, + "name": "User 46", + "email": "user46@example.com" + }, + { + "id": 47, + "name": "User 47", + "email": "user47@example.com" + }, + { + "id": 48, + "name": "User 48", + "email": "user48@example.com" + }, + { + "id": 49, + "name": "User 49", + "email": "user49@example.com" + }, + { + "id": 50, + "name": "User 50", + "email": "user50@example.com" + } + ] + } +} diff --git a/tests/request/body-scroll/fixtures/collection/script.bru b/tests/request/body-scroll/fixtures/collection/script.bru new file mode 100644 index 000000000..08e6b80f0 --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/script.bru @@ -0,0 +1,337 @@ +meta { + name: script + type: http + seq: 3 +} + +get { + url: https://echo.usebruno.com + body: none + auth: none +} + +script:pre-request { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} + +script:post-response { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} diff --git a/tests/request/body-scroll/fixtures/collection/test-folder/folder-req.bru b/tests/request/body-scroll/fixtures/collection/test-folder/folder-req.bru new file mode 100644 index 000000000..472d7ee2e --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/test-folder/folder-req.bru @@ -0,0 +1,11 @@ +meta { + name: folder-req + type: http + seq: 1 +} + +get { + url: https://echo.usebruno.com + body: none + auth: none +} diff --git a/tests/request/body-scroll/fixtures/collection/test-folder/folder.bru b/tests/request/body-scroll/fixtures/collection/test-folder/folder.bru new file mode 100644 index 000000000..c4e33446c --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/test-folder/folder.bru @@ -0,0 +1,838 @@ +meta { + name: test-folder + seq: 1 +} + +script:pre-request { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} + +script:post-response { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} + +tests { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} + +docs { + ## Section 1 + Lorem ipsum dolor sit amet for section 1. + + ## Section 2 + Lorem ipsum dolor sit amet for section 2. + + ## Section 3 + Lorem ipsum dolor sit amet for section 3. + + ## Section 4 + Lorem ipsum dolor sit amet for section 4. + + ## Section 5 + Lorem ipsum dolor sit amet for section 5. + + ## Section 6 + Lorem ipsum dolor sit amet for section 6. + + ## Section 7 + Lorem ipsum dolor sit amet for section 7. + + ## Section 8 + Lorem ipsum dolor sit amet for section 8. + + ## Section 9 + Lorem ipsum dolor sit amet for section 9. + + ## Section 10 + Lorem ipsum dolor sit amet for section 10. + + ## Section 11 + Lorem ipsum dolor sit amet for section 11. + + ## Section 12 + Lorem ipsum dolor sit amet for section 12. + + ## Section 13 + Lorem ipsum dolor sit amet for section 13. + + ## Section 14 + Lorem ipsum dolor sit amet for section 14. + + ## Section 15 + Lorem ipsum dolor sit amet for section 15. + + ## Section 16 + Lorem ipsum dolor sit amet for section 16. + + ## Section 17 + Lorem ipsum dolor sit amet for section 17. + + ## Section 18 + Lorem ipsum dolor sit amet for section 18. + + ## Section 19 + Lorem ipsum dolor sit amet for section 19. + + ## Section 20 + Lorem ipsum dolor sit amet for section 20. + + ## Section 21 + Lorem ipsum dolor sit amet for section 21. + + ## Section 22 + Lorem ipsum dolor sit amet for section 22. + + ## Section 23 + Lorem ipsum dolor sit amet for section 23. + + ## Section 24 + Lorem ipsum dolor sit amet for section 24. + + ## Section 25 + Lorem ipsum dolor sit amet for section 25. + + ## Section 26 + Lorem ipsum dolor sit amet for section 26. + + ## Section 27 + Lorem ipsum dolor sit amet for section 27. + + ## Section 28 + Lorem ipsum dolor sit amet for section 28. + + ## Section 29 + Lorem ipsum dolor sit amet for section 29. + + ## Section 30 + Lorem ipsum dolor sit amet for section 30. + + ## Section 31 + Lorem ipsum dolor sit amet for section 31. + + ## Section 32 + Lorem ipsum dolor sit amet for section 32. + + ## Section 33 + Lorem ipsum dolor sit amet for section 33. + + ## Section 34 + Lorem ipsum dolor sit amet for section 34. + + ## Section 35 + Lorem ipsum dolor sit amet for section 35. + + ## Section 36 + Lorem ipsum dolor sit amet for section 36. + + ## Section 37 + Lorem ipsum dolor sit amet for section 37. + + ## Section 38 + Lorem ipsum dolor sit amet for section 38. + + ## Section 39 + Lorem ipsum dolor sit amet for section 39. + + ## Section 40 + Lorem ipsum dolor sit amet for section 40. + + ## Section 41 + Lorem ipsum dolor sit amet for section 41. + + ## Section 42 + Lorem ipsum dolor sit amet for section 42. + + ## Section 43 + Lorem ipsum dolor sit amet for section 43. + + ## Section 44 + Lorem ipsum dolor sit amet for section 44. + + ## Section 45 + Lorem ipsum dolor sit amet for section 45. + + ## Section 46 + Lorem ipsum dolor sit amet for section 46. + + ## Section 47 + Lorem ipsum dolor sit amet for section 47. + + ## Section 48 + Lorem ipsum dolor sit amet for section 48. + + ## Section 49 + Lorem ipsum dolor sit amet for section 49. + + ## Section 50 + Lorem ipsum dolor sit amet for section 50. + + ## Section 51 + Lorem ipsum dolor sit amet for section 51. + + ## Section 52 + Lorem ipsum dolor sit amet for section 52. + + ## Section 53 + Lorem ipsum dolor sit amet for section 53. + + ## Section 54 + Lorem ipsum dolor sit amet for section 54. + + ## Section 55 + Lorem ipsum dolor sit amet for section 55. + + ## Section 56 + Lorem ipsum dolor sit amet for section 56. + + ## Section 57 + Lorem ipsum dolor sit amet for section 57. + + ## Section 58 + Lorem ipsum dolor sit amet for section 58. + + ## Section 59 + Lorem ipsum dolor sit amet for section 59. + + ## Section 60 + Lorem ipsum dolor sit amet for section 60. + + ## Section 61 + Lorem ipsum dolor sit amet for section 61. + + ## Section 62 + Lorem ipsum dolor sit amet for section 62. + + ## Section 63 + Lorem ipsum dolor sit amet for section 63. + + ## Section 64 + Lorem ipsum dolor sit amet for section 64. + + ## Section 65 + Lorem ipsum dolor sit amet for section 65. + + ## Section 66 + Lorem ipsum dolor sit amet for section 66. + + ## Section 67 + Lorem ipsum dolor sit amet for section 67. + + ## Section 68 + Lorem ipsum dolor sit amet for section 68. + + ## Section 69 + Lorem ipsum dolor sit amet for section 69. + + ## Section 70 + Lorem ipsum dolor sit amet for section 70. + + ## Section 71 + Lorem ipsum dolor sit amet for section 71. + + ## Section 72 + Lorem ipsum dolor sit amet for section 72. + + ## Section 73 + Lorem ipsum dolor sit amet for section 73. + + ## Section 74 + Lorem ipsum dolor sit amet for section 74. + + ## Section 75 + Lorem ipsum dolor sit amet for section 75. + + ## Section 76 + Lorem ipsum dolor sit amet for section 76. + + ## Section 77 + Lorem ipsum dolor sit amet for section 77. + + ## Section 78 + Lorem ipsum dolor sit amet for section 78. + + ## Section 79 + Lorem ipsum dolor sit amet for section 79. + + ## Section 80 + Lorem ipsum dolor sit amet for section 80. +} + +headers { + X-Custom-Header-1: value-1 + X-Custom-Header-2: value-2 + X-Custom-Header-3: value-3 + X-Custom-Header-4: value-4 + X-Custom-Header-5: value-5 + X-Custom-Header-6: value-6 + X-Custom-Header-7: value-7 + X-Custom-Header-8: value-8 + X-Custom-Header-9: value-9 + X-Custom-Header-10: value-10 + X-Custom-Header-11: value-11 + X-Custom-Header-12: value-12 + X-Custom-Header-13: value-13 + X-Custom-Header-14: value-14 + X-Custom-Header-15: value-15 + X-Custom-Header-16: value-16 + X-Custom-Header-17: value-17 + X-Custom-Header-18: value-18 + X-Custom-Header-19: value-19 + X-Custom-Header-20: value-20 + X-Custom-Header-21: value-21 + X-Custom-Header-22: value-22 + X-Custom-Header-23: value-23 + X-Custom-Header-24: value-24 + X-Custom-Header-25: value-25 + X-Custom-Header-26: value-26 + X-Custom-Header-27: value-27 + X-Custom-Header-28: value-28 + X-Custom-Header-29: value-29 + X-Custom-Header-30: value-30 + X-Custom-Header-31: value-31 + X-Custom-Header-32: value-32 + X-Custom-Header-33: value-33 + X-Custom-Header-34: value-34 + X-Custom-Header-35: value-35 + X-Custom-Header-36: value-36 + X-Custom-Header-37: value-37 + X-Custom-Header-38: value-38 + X-Custom-Header-39: value-39 + X-Custom-Header-40: value-40 + X-Custom-Header-41: value-41 + X-Custom-Header-42: value-42 + X-Custom-Header-43: value-43 + X-Custom-Header-44: value-44 + X-Custom-Header-45: value-45 + X-Custom-Header-46: value-46 + X-Custom-Header-47: value-47 + X-Custom-Header-48: value-48 + X-Custom-Header-49: value-49 + X-Custom-Header-50: value-50 + X-Custom-Header-51: value-51 + X-Custom-Header-52: value-52 + X-Custom-Header-53: value-53 + X-Custom-Header-54: value-54 + X-Custom-Header-55: value-55 + X-Custom-Header-56: value-56 + X-Custom-Header-57: value-57 + X-Custom-Header-58: value-58 + X-Custom-Header-59: value-59 + X-Custom-Header-60: value-60 + X-Custom-Header-61: value-61 + X-Custom-Header-62: value-62 + X-Custom-Header-63: value-63 + X-Custom-Header-64: value-64 + X-Custom-Header-65: value-65 + X-Custom-Header-66: value-66 + X-Custom-Header-67: value-67 + X-Custom-Header-68: value-68 + X-Custom-Header-69: value-69 + X-Custom-Header-70: value-70 + X-Custom-Header-71: value-71 + X-Custom-Header-72: value-72 + X-Custom-Header-73: value-73 + X-Custom-Header-74: value-74 + X-Custom-Header-75: value-75 + X-Custom-Header-76: value-76 + X-Custom-Header-77: value-77 + X-Custom-Header-78: value-78 + X-Custom-Header-79: value-79 + X-Custom-Header-80: value-80 + X-Custom-Header-81: value-81 + X-Custom-Header-82: value-82 + X-Custom-Header-83: value-83 + X-Custom-Header-84: value-84 + X-Custom-Header-85: value-85 + X-Custom-Header-86: value-86 + X-Custom-Header-87: value-87 + X-Custom-Header-88: value-88 + X-Custom-Header-89: value-89 + X-Custom-Header-90: value-90 + X-Custom-Header-91: value-91 + X-Custom-Header-92: value-92 + X-Custom-Header-93: value-93 + X-Custom-Header-94: value-94 + X-Custom-Header-95: value-95 + X-Custom-Header-96: value-96 + X-Custom-Header-97: value-97 + X-Custom-Header-98: value-98 + X-Custom-Header-99: value-99 + X-Custom-Header-100: value-100 +} diff --git a/tests/request/body-scroll/fixtures/collection/tests.bru b/tests/request/body-scroll/fixtures/collection/tests.bru new file mode 100644 index 000000000..2cc0caeed --- /dev/null +++ b/tests/request/body-scroll/fixtures/collection/tests.bru @@ -0,0 +1,174 @@ +meta { + name: tests + type: http + seq: 4 +} + +get { + url: https://echo.usebruno.com + body: none + auth: none +} + +tests { + // Line 1 + console.log('step 1'); + // Line 2 + console.log('step 2'); + // Line 3 + console.log('step 3'); + // Line 4 + console.log('step 4'); + // Line 5 + console.log('step 5'); + // Line 6 + console.log('step 6'); + // Line 7 + console.log('step 7'); + // Line 8 + console.log('step 8'); + // Line 9 + console.log('step 9'); + // Line 10 + console.log('step 10'); + // Line 11 + console.log('step 11'); + // Line 12 + console.log('step 12'); + // Line 13 + console.log('step 13'); + // Line 14 + console.log('step 14'); + // Line 15 + console.log('step 15'); + // Line 16 + console.log('step 16'); + // Line 17 + console.log('step 17'); + // Line 18 + console.log('step 18'); + // Line 19 + console.log('step 19'); + // Line 20 + console.log('step 20'); + // Line 21 + console.log('step 21'); + // Line 22 + console.log('step 22'); + // Line 23 + console.log('step 23'); + // Line 24 + console.log('step 24'); + // Line 25 + console.log('step 25'); + // Line 26 + console.log('step 26'); + // Line 27 + console.log('step 27'); + // Line 28 + console.log('step 28'); + // Line 29 + console.log('step 29'); + // Line 30 + console.log('step 30'); + // Line 31 + console.log('step 31'); + // Line 32 + console.log('step 32'); + // Line 33 + console.log('step 33'); + // Line 34 + console.log('step 34'); + // Line 35 + console.log('step 35'); + // Line 36 + console.log('step 36'); + // Line 37 + console.log('step 37'); + // Line 38 + console.log('step 38'); + // Line 39 + console.log('step 39'); + // Line 40 + console.log('step 40'); + // Line 41 + console.log('step 41'); + // Line 42 + console.log('step 42'); + // Line 43 + console.log('step 43'); + // Line 44 + console.log('step 44'); + // Line 45 + console.log('step 45'); + // Line 46 + console.log('step 46'); + // Line 47 + console.log('step 47'); + // Line 48 + console.log('step 48'); + // Line 49 + console.log('step 49'); + // Line 50 + console.log('step 50'); + // Line 51 + console.log('step 51'); + // Line 52 + console.log('step 52'); + // Line 53 + console.log('step 53'); + // Line 54 + console.log('step 54'); + // Line 55 + console.log('step 55'); + // Line 56 + console.log('step 56'); + // Line 57 + console.log('step 57'); + // Line 58 + console.log('step 58'); + // Line 59 + console.log('step 59'); + // Line 60 + console.log('step 60'); + // Line 61 + console.log('step 61'); + // Line 62 + console.log('step 62'); + // Line 63 + console.log('step 63'); + // Line 64 + console.log('step 64'); + // Line 65 + console.log('step 65'); + // Line 66 + console.log('step 66'); + // Line 67 + console.log('step 67'); + // Line 68 + console.log('step 68'); + // Line 69 + console.log('step 69'); + // Line 70 + console.log('step 70'); + // Line 71 + console.log('step 71'); + // Line 72 + console.log('step 72'); + // Line 73 + console.log('step 73'); + // Line 74 + console.log('step 74'); + // Line 75 + console.log('step 75'); + // Line 76 + console.log('step 76'); + // Line 77 + console.log('step 77'); + // Line 78 + console.log('step 78'); + // Line 79 + console.log('step 79'); + // Line 80 + console.log('step 80'); +} diff --git a/tests/request/body-scroll/init-user-data/preferences.json b/tests/request/body-scroll/init-user-data/preferences.json new file mode 100644 index 000000000..f3589a547 --- /dev/null +++ b/tests/request/body-scroll/init-user-data/preferences.json @@ -0,0 +1,11 @@ +{ + "lastOpenedCollections": [ + "{{projectRoot}}/tests/request/body-scroll/fixtures/collection" + ], + "preferences": { + "onboarding": { + "hasLaunchedBefore": true, + "hasSeenWelcomeModal": true + } + } +} diff --git a/tests/request/body-scroll/scroll-persistent.spec.ts b/tests/request/body-scroll/scroll-persistent.spec.ts index 23b2bed47..2eddc675c 100644 --- a/tests/request/body-scroll/scroll-persistent.spec.ts +++ b/tests/request/body-scroll/scroll-persistent.spec.ts @@ -3,10 +3,10 @@ import { closeAllCollections, createCollection, createRequest, - createFolder, selectRequestPaneTab, selectResponsePaneTab, selectScriptSubTab, + openCollection, openRequest, sendRequest } from '../../utils/page'; @@ -21,12 +21,6 @@ const generateLargeJson = () => JSON.stringify( null, 2 ); -const generateLargeScript = () => - Array.from({ length: 80 }, (_, i) => `// Line ${i + 1}\nconsole.log('step ${i + 1}');`).join('\n'); - -const generateLargeXml = () => - `\n\n${Array.from({ length: 150 }, (_, i) => ` Item ${i + 1}`).join('\n')}\n`; - // --------------------------------------------------------------------------- // CodeMirror helpers - interact with CM5 instances by CSS selector // --------------------------------------------------------------------------- @@ -119,6 +113,20 @@ const expectRowNear = (actual: number, expected: number, tolerance: number = 5) expect(actual).toBeLessThan(expected + tolerance); }; +// Tests share an Electron worker, so localStorage carries scroll values from one +// test into the next under the same `persisted::::` namespace — +// breaking the "initial scroll is 0" assertion. Wipe just the scroll-persistence +// keys at the start of each test that exercises the fixture collection. +const clearPersistedScrollState = async (page: Page) => { + await page.evaluate(() => { + try { + Object.keys(localStorage) + .filter((k) => k.startsWith('persisted::')) + .forEach((k) => localStorage.removeItem(k)); + } catch {} + }); +}; + // =========================================================================== // REQUEST PANE - scroll persistence // =========================================================================== @@ -136,23 +144,22 @@ test.describe('Scroll Position Persistence', () => { // ------------------------------------------------------------------------- test.describe('Request Pane', () => { - test.beforeEach(async ({ page }) => { - await closeAllCollections(page); + test.beforeEach(async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); + await clearPersistedScrollState(page); }); test.afterAll(async ({ page }) => { await closeAllCollections(page); }); - test('Body (JSON) - scroll persists across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-body-json'); + test('Body (JSON) - scroll persists across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); await test.step('Setup', async () => { - await createCollection(page, 'scroll-body-json', tmpDir); - await createRequest(page, 'req-1', 'scroll-body-json', { url: 'https://echo.usebruno.com' }); + await openCollection(page, 'scroll-fixtures'); + await openRequest(page, 'scroll-fixtures', 'body-json'); await selectRequestPaneTab(page, 'Body'); - await selectBodyMode(page, 'JSON'); - await setEditorContent(page, '.request-pane .CodeMirror', generateLargeJson()); }); await test.step('Verify initial scroll is 0', async () => { @@ -185,15 +192,13 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Body (XML) - scroll persists across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-body-xml'); + test('Body (XML) - scroll persists across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); await test.step('Setup', async () => { - await createCollection(page, 'scroll-body-xml', tmpDir); - await createRequest(page, 'req-xml', 'scroll-body-xml', { url: 'https://echo.usebruno.com' }); + await openCollection(page, 'scroll-fixtures'); + await openRequest(page, 'scroll-fixtures', 'body-xml'); await selectRequestPaneTab(page, 'Body'); - await selectBodyMode(page, 'XML'); - await setEditorContent(page, '.request-pane .CodeMirror', generateLargeXml()); }); await test.step('Verify initial scroll is 0', async () => { @@ -228,8 +233,8 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Script - pre-request and post-response scroll persists across sub-tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-script'); + test('Script - pre-request and post-response scroll persists across sub-tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const PRE_SELECTOR = '[data-testid="pre-request-script-editor"] .CodeMirror'; const POST_SELECTOR = '[data-testid="post-response-script-editor"] .CodeMirror'; @@ -238,11 +243,11 @@ test.describe('Scroll Position Persistence', () => { // --- Pre-request: add content, init hook, scroll, verify --- - await test.step('Switch to pre-request and add content', async () => { - await createCollection(page, 'scroll-script', tmpDir); - await createRequest(page, 'req-script', 'scroll-script', { url: 'https://echo.usebruno.com' }); + await test.step('Open script request and switch to pre-request', async () => { + await openCollection(page, 'scroll-fixtures'); + await openRequest(page, 'scroll-fixtures', 'script'); + await selectRequestPaneTab(page, 'Script'); await selectScriptSubTab(page, 'pre-request'); - await setEditorContent(page, PRE_SELECTOR, generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -277,10 +282,8 @@ test.describe('Scroll Position Persistence', () => { // --- Post-response: add content, init hook, scroll, verify --- - await test.step('Switch to post-response and add content', async () => { + await test.step('Switch to post-response', async () => { await selectScriptSubTab(page, 'post-response'); - - await setEditorContent(page, POST_SELECTOR, generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -330,14 +333,13 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Tests editor - scroll persists across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-tests'); + test('Tests editor - scroll persists across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); await test.step('Setup', async () => { - await createCollection(page, 'scroll-tests', tmpDir); - await createRequest(page, 'req-tests', 'scroll-tests', { url: 'https://echo.usebruno.com' }); + await openCollection(page, 'scroll-fixtures'); + await openRequest(page, 'scroll-fixtures', 'tests'); await selectRequestPaneTab(page, 'Tests'); - await setEditorContent(page, '[data-testid="test-script-editor"] .CodeMirror', generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -371,22 +373,18 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Scroll positions are independent per request', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-per-request'); + test('Scroll positions are independent per request', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); - await test.step('Setup two requests with JSON bodies', async () => { - await createCollection(page, 'scroll-per-request', tmpDir); - await createRequest(page, 'req-a', 'scroll-per-request', { url: 'https://echo.usebruno.com' }); - await createRequest(page, 'req-b', 'scroll-per-request', { url: 'https://echo.usebruno.com' }); + await test.step('Open collection', async () => { + await openCollection(page, 'scroll-fixtures'); }); let scrollA: number; - await test.step('Open req-a, set body, initialize hook via tab switch, then scroll', async () => { - await openRequest(page, 'scroll-per-request', 'req-a'); + await test.step('Open req-a and navigate to Body', async () => { + await openRequest(page, 'scroll-fixtures', 'req-a'); await selectRequestPaneTab(page, 'Body'); - await selectBodyMode(page, 'JSON'); - await setEditorContent(page, '.request-pane .CodeMirror', generateLargeJson()); }); await test.step('Verify initial scroll is 0', async () => { @@ -409,11 +407,11 @@ test.describe('Scroll Position Persistence', () => { }); await test.step('Switch to req-b', async () => { - await openRequest(page, 'scroll-per-request', 'req-b'); + await openRequest(page, 'scroll-fixtures', 'req-b'); }); await test.step('Switch back to req-a and verify scroll', async () => { - await openRequest(page, 'scroll-per-request', 'req-a'); + await openRequest(page, 'scroll-fixtures', 'req-a'); await selectRequestPaneTab(page, 'Body'); const restored = await getEditorScroll(page, '.request-pane .CodeMirror'); @@ -421,36 +419,17 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Request Headers - scroll persists with many headers across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-req-headers'); + test('Request Headers - scroll persists with many headers across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const scrollContainer = '.flex-boundary'; const firstVisibleRowLocator = () => page.getByTestId('editable-table').locator('table > tbody > tr:nth-child(2)'); await test.step('Setup request and navigate to Headers tab', async () => { - await createCollection(page, 'scroll-req-headers', tmpDir); - await createRequest(page, 'req-headers', 'scroll-req-headers', { url: 'https://echo.usebruno.com' }); + await openCollection(page, 'scroll-fixtures'); + await openRequest(page, 'scroll-fixtures', 'headers-many'); await selectRequestPaneTab(page, 'Headers'); }); - await test.step('Add 100 headers via Bulk Edit', async () => { - const bulkEditBtn = page.getByTestId('bulk-edit-toggle'); - await bulkEditBtn.scrollIntoViewIfNeeded(); - await bulkEditBtn.click(); - - const bulkHeaders = Array.from({ length: 100 }, (_, i) => - `X-Custom-Header-${i + 1}:value-${i + 1}` - ).join('\n'); - - // The bulk editor CodeMirror should now be visible in the request pane - const bulkEditor = page.locator('[data-testid="request-pane"] .CodeMirror').first(); - await bulkEditor.evaluate((el, content) => { - const cm = (el as any).CodeMirror; - cm?.setValue(content); - }, bulkHeaders); - - await page.getByTestId('key-value-edit-toggle').click(); - }); - await test.step('Verify initial scroll is 0', async () => { const container = page.locator(scrollContainer).first(); const initial = await container.evaluate((el) => el.scrollTop); @@ -481,6 +460,52 @@ test.describe('Scroll Position Persistence', () => { expectRowNear(current, 50); }); }); + + test('Assertions - scroll persists with many assertions across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); + const scrollContainer = '.flex-boundary'; + // Match the first row that actually has a data-index attribute. This skips + // Virtuoso's optional top-spacer tr (which has no data-index and is only + // rendered when scrolled past row 0). + const firstVisibleRowLocator = () => + page.getByTestId('assertions-table').locator('table > tbody > tr[data-index]').first(); + + await test.step('Setup request and navigate to Assertions tab', async () => { + await openCollection(page, 'scroll-fixtures'); + await openRequest(page, 'scroll-fixtures', 'assertions-many'); + await selectRequestPaneTab(page, 'Assert'); + }); + + await test.step('Verify initial scroll is 0', async () => { + const container = page.locator(scrollContainer).first(); + await container.evaluate((el) => { el.scrollTop = 0; }); + await expect(firstVisibleRowLocator()).toHaveAttribute('data-index', '0', { timeout: 2000 }); + const initial = await container.evaluate((el) => el.scrollTop); + expect(initial).toBe(0); + }); + + await test.step('Scroll to ~middle of table (~row 30)', async () => { + const container = page.locator(scrollContainer).first(); + await container.evaluate((el) => { el.scrollTop = el.scrollHeight / 2; }); + + const element = firstVisibleRowLocator(); + await expect(element).toHaveAttribute('data-index', /^(2[5-9]|3[0-5])$/, { timeout: 2000 }); + }); + + await test.step('Switch to Body tab and back to Assert', async () => { + await selectRequestPaneTab(page, 'Body'); + await selectRequestPaneTab(page, 'Assert'); + const header = page.getByTestId('assertions-table').locator('table thead tr').first(); + await expect(header).toBeVisible({ timeout: 2000 }); + }); + + await test.step('Verify scroll restored to ~row 30', async () => { + const element = firstVisibleRowLocator(); + await expect(element).toHaveAttribute('data-index', /^(2[5-9]|3[0-5])$/, { timeout: 2000 }); + const current = parseInt(await element.getAttribute('data-index') as string); + expectRowNear(current, 30); + }); + }); }); // ------------------------------------------------------------------------- @@ -593,7 +618,7 @@ test.describe('Scroll Position Persistence', () => { await test.step('Create collection and request', async () => { await createCollection(page, 'scroll-response-timeline', tmpDir); - await createRequest(page, 'req-timeline', 'scroll-response-timeline', { url: 'http://localhost:8081' }); + await createRequest(page, 'req-timeline', 'scroll-response-timeline', { url: 'http://localhost:8081/ping' }); }); await test.step('Send and cancel requests to generate timeline entries', async () => { @@ -653,28 +678,27 @@ test.describe('Scroll Position Persistence', () => { // ------------------------------------------------------------------------- test.describe('Folder Settings', () => { - test.beforeEach(async ({ page }) => { - await closeAllCollections(page); + test.beforeEach(async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); + await clearPersistedScrollState(page); }); test.afterAll(async ({ page }) => { await closeAllCollections(page); }); - test('Folder Script - scroll persists across sub-tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-folder-script'); + test('Folder Script - scroll persists across sub-tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); await test.step('Setup folder', async () => { - await createCollection(page, 'scroll-folder-script', tmpDir); - await createFolder(page, 'test-folder', 'scroll-folder-script'); + await openCollection(page, 'scroll-fixtures'); await locators.sidebar.folder('test-folder').click({ timeout: 2000 }); }); - await test.step('Navigate to Script tab and fill pre-request', async () => { + await test.step('Navigate to Script tab pre-request', async () => { await locators.paneTabs.folderSettingsTab('script').click({ timeout: 2000 }); await page.getByTestId('tab-trigger-pre-request').click({ timeout: 2000 }); - await setEditorContent(page, '.CodeMirror', generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -707,16 +731,14 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Folder Tests - scroll persists across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-folder-tests'); + test('Folder Tests - scroll persists across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); - await test.step('Setup folder and add test content', async () => { - await createCollection(page, 'scroll-folder-tests', tmpDir); - await createFolder(page, 'test-folder', 'scroll-folder-tests'); + await test.step('Open folder and navigate to Tests tab', async () => { + await openCollection(page, 'scroll-fixtures'); await locators.sidebar.folder('test-folder').click({ timeout: 2000 }); await locators.paneTabs.folderSettingsTab('test').click({ timeout: 2000 }); - await setEditorContent(page, '.CodeMirror', generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -748,22 +770,19 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Folder Docs - scroll persists in edit mode across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-folder-docs'); + test('Folder Docs - scroll persists in edit mode across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); - const largeDocContent = Array.from({ length: 80 }, (_, i) => `## Section ${i + 1}\nLorem ipsum dolor sit amet for section ${i + 1}.`).join('\n\n'); - await test.step('Setup folder and navigate to Docs tab', async () => { - await createCollection(page, 'scroll-folder-docs', tmpDir); - await createFolder(page, 'test-folder', 'scroll-folder-docs'); + await test.step('Open folder and navigate to Docs tab', async () => { + await openCollection(page, 'scroll-fixtures'); await locators.sidebar.folder('test-folder').click({ timeout: 2000 }); await locators.paneTabs.folderSettingsTab('docs').click({ timeout: 2000 }); }); - await test.step('Click Edit and add large doc content', async () => { + await test.step('Click Edit', async () => { const editToggle = page.locator('.editing-mode'); await editToggle.click({ timeout: 2000 }); - await setEditorContent(page, '.CodeMirror', largeDocContent); }); await test.step('Verify initial scroll is 0', async () => { @@ -795,20 +814,18 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Folder Script pre-request - scroll persists across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-folder-pre-req'); + test('Folder Script pre-request - scroll persists across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); const PRE_SELECTOR = '[data-testid="folder-pre-request-script-editor"] .CodeMirror'; let saved: number; - await test.step('Setup folder and add pre-request content', async () => { - await createCollection(page, 'scroll-folder-pre-req', tmpDir); - await createFolder(page, 'test-folder', 'scroll-folder-pre-req'); + await test.step('Open folder and navigate to pre-request', async () => { + await openCollection(page, 'scroll-fixtures'); await locators.sidebar.folder('test-folder').click({ timeout: 2000 }); await locators.paneTabs.folderSettingsTab('script').click({ timeout: 2000 }); await page.getByTestId('tab-trigger-pre-request').click({ timeout: 2000 }); - await setEditorContent(page, PRE_SELECTOR, generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -840,20 +857,18 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Folder Script post-response - scroll persists across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-folder-post-res'); + test('Folder Script post-response - scroll persists across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); const POST_SELECTOR = '[data-testid="folder-post-response-script-editor"] .CodeMirror'; let saved: number; - await test.step('Setup folder and add post-response content', async () => { - await createCollection(page, 'scroll-folder-post-res', tmpDir); - await createFolder(page, 'test-folder', 'scroll-folder-post-res'); + await test.step('Open folder and navigate to post-response', async () => { + await openCollection(page, 'scroll-fixtures'); await locators.sidebar.folder('test-folder').click({ timeout: 2000 }); await locators.paneTabs.folderSettingsTab('script').click({ timeout: 2000 }); await page.getByTestId('tab-trigger-post-response').click({ timeout: 2000 }); - await setEditorContent(page, POST_SELECTOR, generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -891,8 +906,9 @@ test.describe('Scroll Position Persistence', () => { // ------------------------------------------------------------------------- test.describe('Collection Settings', () => { - test.beforeEach(async ({ page }) => { - await closeAllCollections(page); + test.beforeEach(async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); + await clearPersistedScrollState(page); }); test.afterAll(async ({ page }) => { @@ -907,8 +923,8 @@ test.describe('Scroll Position Persistence', () => { await locators.dropdown.item('Settings').click({ timeout: 2000 }); }; - test('Collection Script - pre-request and post-response scroll persists', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-coll-script'); + test('Collection Script - pre-request and post-response scroll persists', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); const PRE_SELECTOR = '[data-testid="collection-pre-request-script-editor"] .CodeMirror'; const POST_SELECTOR = '[data-testid="collection-post-response-script-editor"] .CodeMirror'; @@ -918,12 +934,11 @@ test.describe('Scroll Position Persistence', () => { // --- Pre-request --- - await test.step('Setup collection and add pre-request content', async () => { - await createCollection(page, 'scroll-coll-script', tmpDir); - await openCollectionSettings(page, 'scroll-coll-script'); + await test.step('Open collection settings and navigate to pre-request', async () => { + await openCollection(page, 'scroll-fixtures'); + await openCollectionSettings(page, 'scroll-fixtures'); await locators.paneTabs.collectionSettingsTab('script').click({ timeout: 2000 }); await page.getByTestId('tab-trigger-pre-request').click({ timeout: 2000 }); - await setEditorContent(page, PRE_SELECTOR, generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -953,9 +968,8 @@ test.describe('Scroll Position Persistence', () => { // --- Post-response --- - await test.step('Switch to post-response and add content', async () => { + await test.step('Switch to post-response', async () => { await page.getByTestId('tab-trigger-post-response').click({ timeout: 2000 }); - await setEditorContent(page, POST_SELECTOR, generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -998,15 +1012,14 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Collection Tests - scroll persists across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-coll-tests'); + test('Collection Tests - scroll persists across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); - await test.step('Setup and add test content', async () => { - await createCollection(page, 'scroll-coll-tests', tmpDir); - await openCollectionSettings(page, 'scroll-coll-tests'); + await test.step('Open collection settings and navigate to Tests tab', async () => { + await openCollection(page, 'scroll-fixtures'); + await openCollectionSettings(page, 'scroll-fixtures'); await locators.paneTabs.collectionSettingsTab('tests').click({ timeout: 2000 }); - await setEditorContent(page, '.CodeMirror', generateLargeScript()); }); await test.step('Verify initial scroll is 0', async () => { @@ -1038,22 +1051,20 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Collection Docs - scroll persists in edit mode across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-coll-docs'); + test('Collection Docs - scroll persists in edit mode across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); - const largeDocContent = Array.from({ length: 80 }, (_, i) => `## Section ${i + 1}\nLorem ipsum dolor sit amet for section ${i + 1}.`).join('\n\n'); - await test.step('Setup and navigate to Docs tab', async () => { - await createCollection(page, 'scroll-coll-docs', tmpDir); - await openCollectionSettings(page, 'scroll-coll-docs'); + await test.step('Open collection settings and navigate to Docs tab', async () => { + await openCollection(page, 'scroll-fixtures'); + await openCollectionSettings(page, 'scroll-fixtures'); await locators.paneTabs.collectionSettingsTab('overview').click({ timeout: 2000 }); }); - await test.step('Click Edit and add large doc content', async () => { + await test.step('Click Edit', async () => { // Collection docs has an edit icon button const editBtn = page.locator('.editing-mode'); await editBtn.click({ timeout: 2000 }); - await setEditorContent(page, '.CodeMirror', largeDocContent); }); await test.step('Verify initial scroll is 0', async () => { @@ -1085,36 +1096,18 @@ test.describe('Scroll Position Persistence', () => { }); }); - test('Collection Headers - scroll persists with many headers across tab switches', async ({ page, createTmpDir }) => { - const tmpDir = await createTmpDir('scroll-coll-headers'); + test('Collection Headers - scroll persists with many headers across tab switches', async ({ pageWithUserData: page }) => { + await page.locator('[data-app-state="loaded"]').waitFor({ timeout: 30000 }); const locators = buildCommonLocators(page); const scrollContainer = '.collection-settings-content'; const firstVisibleRowLocator = () => page.getByTestId('editable-table').locator('table > tbody > tr:nth-child(2)'); - await test.step('Setup and navigate to Headers tab', async () => { - await createCollection(page, 'scroll-coll-headers', tmpDir); - await openCollectionSettings(page, 'scroll-coll-headers'); + await test.step('Open collection settings and navigate to Headers tab', async () => { + await openCollection(page, 'scroll-fixtures'); + await openCollectionSettings(page, 'scroll-fixtures'); await locators.paneTabs.collectionSettingsTab('headers').click({ timeout: 2000 }); }); - await test.step('Add 100 headers via Bulk Edit', async () => { - const bulkEditBtn = page.getByTestId('bulk-edit-toggle'); - await bulkEditBtn.scrollIntoViewIfNeeded(); - await bulkEditBtn.click({ timeout: 2000 }); - - const bulkHeaders = Array.from({ length: 100 }, (_, i) => - `X-Custom-Header-${i + 1}:value-${i + 1}` - ).join('\n'); - - const bulkEditor = page.locator('.CodeMirror').first(); - await bulkEditor.evaluate((el, content) => { - const cm = (el as any).CodeMirror; - cm?.setValue(content); - }, bulkHeaders); - - await page.getByTestId('key-value-edit-toggle').click({ timeout: 2000 }); - }); - await test.step('Verify initial scroll is 0', async () => { const container = page.locator(scrollContainer).first(); const initial = await container.evaluate((el) => el.scrollTop);