@sealcode/sealgen 0.12.8 → 0.12.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,30 +58,37 @@ describe("add route test", () => {
58
58
  console.log(
59
59
  " starting the database...(if timeouts here, run 'docker pull mongo:4.4-bionic' to solve)"
60
60
  );
61
- const port = await getPort();
62
- await execAsync(`docker run -p ${port}:27017 --name ${container_name} -d mongo:4.4-bionic`);
61
+ const mongo_port = await getPort();
62
+ const app_port = await getPort();
63
+ await execAsync(
64
+ `docker run -p ${mongo_port}:27017 --name ${container_name} -d mongo:4.4-bionic`
65
+ );
63
66
  console.log(" running app and making request to the generated url...");
64
- const env = { ...process.env, SEALIOUS_MONGO_PORT: port.toString() };
67
+ const env = {
68
+ ...process.env,
69
+ SEALIOUS_MONGO_PORT: mongo_port.toString(),
70
+ SEALIOUS_PORT: app_port.toString()
71
+ };
65
72
  const node_args = [`${app_path}/dist/back/index.js`];
66
73
  console.log(
67
- "EXECUTING",
74
+ "EXECUTING APP",
68
75
  `${Object.entries(env).map(([key, value]) => `${key}=${value}`).join(" ")} node ${node_args.join(" ")}`
69
76
  );
70
77
  let app_start = spawn(`node`, node_args, {
71
78
  env
72
79
  });
73
- app_start.stdout.on("data", (data) => console.log(data.toString()));
80
+ app_start.stdout.on("data", (data) => console.log("APP OUTPUT:", data.toString()));
74
81
  app_start.stderr.on("data", (data) => console.log(data.toString()));
75
82
  if (app_start.pid == void 0)
76
83
  throw new Error("node failed to start");
77
84
  node_pid = app_start.pid;
78
85
  await waitPort({
79
86
  host: "localhost",
80
- port: 8080,
87
+ port: app_port,
81
88
  output: "silent",
82
89
  timeout: 6e3
83
90
  });
84
- const res = await axios.get("http://localhost:8080/sample");
91
+ const res = await axios.get(`http://localhost:${app_port}/sample`);
85
92
  if (res.status != 200) {
86
93
  throw new Error("url generated by add-route exists but doesnt return 200");
87
94
  }
@@ -7,6 +7,7 @@ import { mount } from "../mount.js";
7
7
  import { locator_is_visible } from "../test_utils/locator_is_visible.js";
8
8
  import { getBrowser } from "../utils/browser-creator.js";
9
9
  import { assertThrowsAsync } from "../utils/utils.js";
10
+ import getPort from "get-port";
10
11
  const fields = {
11
12
  text: new Fields.SimpleFormField(true)
12
13
  };
@@ -31,6 +32,8 @@ function form_factory(canAccessFun) {
31
32
  result.canAccess = canAccessFun;
32
33
  return result;
33
34
  }
35
+ const port = await getPort();
36
+ console.log("Using port " + port + " for form.test.ts");
34
37
  describe("form test", () => {
35
38
  let page;
36
39
  beforeAll(async () => {
@@ -45,8 +48,8 @@ describe("form test", () => {
45
48
  const router = new Router();
46
49
  mount(router, "/", form_factory(), true);
47
50
  app.use(router.routes()).use(router.allowedMethods());
48
- server = app.listen(8080);
49
- await page.goto("http://localhost:8080");
51
+ server = app.listen(port);
52
+ await page.goto(`http://localhost:${port}`);
50
53
  });
51
54
  afterAll(async () => {
52
55
  server.close();
@@ -65,7 +68,7 @@ describe("form test", () => {
65
68
  });
66
69
  it("does not allow submitting an empty form by circumventing HTML-based validation", async () => {
67
70
  const res_axios = await axios.post(
68
- "http://localhost:8080",
71
+ `http://localhost:${port}`,
69
72
  {
70
73
  text: ""
71
74
  },
@@ -101,8 +104,8 @@ describe("form test", () => {
101
104
  true
102
105
  );
103
106
  app.use(router.routes()).use(router.allowedMethods());
104
- server = app.listen(8080);
105
- const response = await page.goto("http://localhost:8080");
107
+ server = app.listen(port);
108
+ const response = await page.goto(`http://localhost:${port}`);
106
109
  if (response?.status() != 200) {
107
110
  throw new Error(`Should return 200 status and it returns ${response?.status()}`);
108
111
  }
@@ -125,11 +128,10 @@ describe("form test", () => {
125
128
  app.use(router.routes()).use(router.allowedMethods());
126
129
  });
127
130
  beforeEach(async () => {
128
- server = app.listen(8080);
131
+ server = app.listen(port);
129
132
  });
130
133
  it("prevents the form from rendering", async () => {
131
- console.log("CONSOLELOG TEST");
132
- const response = await page.goto("http://localhost:8080");
134
+ const response = await page.goto(`http://localhost:${port}`);
133
135
  if (response?.status() != 403) {
134
136
  throw new Error(
135
137
  `Should return 403 status and it returns ${response?.status()}`
@@ -138,7 +140,7 @@ describe("form test", () => {
138
140
  });
139
141
  it("does not allow submitting of the form through axios", async () => {
140
142
  await axios.post(
141
- "http://localhost:8080",
143
+ `http://localhost:${port}`,
142
144
  {
143
145
  text: "sample"
144
146
  },
@@ -166,8 +168,8 @@ describe("form test", () => {
166
168
  true
167
169
  );
168
170
  app.use(router.routes()).use(router.allowedMethods());
169
- server = app.listen(8080);
170
- const response = await page.goto("http://localhost:8080");
171
+ server = app.listen(port);
172
+ const response = await page.goto(`http://localhost:${port}`);
171
173
  if (response?.status() != 403) {
172
174
  throw new Error(`Should return 403 status and it returns ${response?.status()}`);
173
175
  }
@@ -192,8 +194,8 @@ describe("form test", () => {
192
194
  true
193
195
  );
194
196
  app.use(router.routes()).use(router.allowedMethods());
195
- server = app.listen(8080);
196
- const response = await page.goto("http://localhost:8080");
197
+ server = app.listen(port);
198
+ const response = await page.goto(`http://localhost:${port}`);
197
199
  if (response?.status() != 200) {
198
200
  throw new Error(`Should return 200 status and it returns ${response?.status()}`);
199
201
  }
@@ -235,8 +237,8 @@ describe("form test", () => {
235
237
  true
236
238
  );
237
239
  app.use(router.routes()).use(router.allowedMethods());
238
- server = app.listen(8080);
239
- await page.goto("http://localhost:8080");
240
+ server = app.listen(port);
241
+ await page.goto(`http://localhost:${port}`);
240
242
  });
241
243
  afterAll(async () => {
242
244
  server.close();
@@ -287,8 +289,8 @@ describe("form test", () => {
287
289
  true
288
290
  );
289
291
  app.use(router.routes()).use(router.allowedMethods());
290
- server = app.listen(8080);
291
- await page.goto("http://localhost:8080");
292
+ server = app.listen(port);
293
+ await page.goto(`http://localhost:${port}`);
292
294
  });
293
295
  afterAll(async () => {
294
296
  server.close();
@@ -13,6 +13,9 @@ import { Form } from "./form.js";
13
13
  import { FormHeader } from "./controls/form-header.js";
14
14
  import { SimpleInput } from "./controls/simple-input.js";
15
15
  import { EmailField } from "./fields/email.js";
16
+ import getPort from "get-port";
17
+ const port = await getPort();
18
+ console.log(`Using port ${port} form multiform.test.ts`);
16
19
  const fields1 = {
17
20
  email: new SimpleFormField(true)
18
21
  };
@@ -75,7 +78,7 @@ async function tests(js_enabled) {
75
78
  javaScriptEnabled: js_enabled
76
79
  });
77
80
  page = await context.newPage();
78
- await page.goto("http://localhost:8080");
81
+ await page.goto(`http://localhost:${port}`);
79
82
  await page.getByLabel("email").click();
80
83
  await page.getByLabel("email").fill("sample1");
81
84
  await page.getByLabel("name").click();
@@ -100,7 +103,7 @@ async function general_form_validation_e2e_tests(js_enabled) {
100
103
  javaScriptEnabled: js_enabled
101
104
  });
102
105
  page = await context.newPage();
103
- await page.goto("http://localhost:8080");
106
+ await page.goto(`http://localhost:${port}`);
104
107
  await page.getByPlaceholder("text").click();
105
108
  await page.getByPlaceholder("text").fill("incorrect");
106
109
  await page.getByPlaceholder("password").click();
@@ -119,7 +122,7 @@ async function individual_field_validation_e2e_tests(javaScriptEnabled) {
119
122
  javaScriptEnabled
120
123
  });
121
124
  page = await context.newPage();
122
- await page.goto("http://localhost:8080");
125
+ await page.goto(`http://localhost:${port}`);
123
126
  });
124
127
  it("validation message shows when incorrect input is given", async () => {
125
128
  await page.getByPlaceholder("text").click();
@@ -174,7 +177,7 @@ describe("multiform test", () => {
174
177
  true
175
178
  );
176
179
  app.use(router.routes()).use(router.allowedMethods());
177
- server = app.listen(8080);
180
+ server = app.listen(port);
178
181
  });
179
182
  afterAll(() => {
180
183
  server.close();
@@ -203,7 +206,7 @@ describe("multiform test", () => {
203
206
  true
204
207
  );
205
208
  app.use(router.routes()).use(router.allowedMethods());
206
- server = app.listen(8080);
209
+ server = app.listen(port);
207
210
  const browser = await getBrowser();
208
211
  const context = await browser.newContext();
209
212
  page = await context.newPage();
@@ -212,7 +215,7 @@ describe("multiform test", () => {
212
215
  server.close();
213
216
  });
214
217
  it("check wether it renders", async () => {
215
- const response = await page.goto("http://localhost:8080");
218
+ const response = await page.goto(`http://localhost:${port}`);
216
219
  if (response?.status() != 200) {
217
220
  throw new Error(
218
221
  `Should return 200 status and it returns ${response?.status()}`
@@ -223,7 +226,7 @@ describe("multiform test", () => {
223
226
  });
224
227
  it("check wether you can submit through http (axios)", async () => {
225
228
  await axios.post(
226
- "http://localhost:8080/form2",
229
+ `http://localhost:${port}/form2`,
227
230
  {
228
231
  form2__text: "pass"
229
232
  },
@@ -255,7 +258,7 @@ describe("multiform test", () => {
255
258
  true
256
259
  );
257
260
  app.use(router.routes()).use(router.allowedMethods());
258
- server = app.listen(8080);
261
+ server = app.listen(port);
259
262
  const browser = await getBrowser();
260
263
  const context = await browser.newContext();
261
264
  page = await context.newPage();
@@ -264,14 +267,14 @@ describe("multiform test", () => {
264
267
  server.close();
265
268
  });
266
269
  it("check wether forms didnt render", async () => {
267
- await page.goto("http://localhost:8080");
270
+ await page.goto(`http://localhost:${port}`);
268
271
  await assertThrowsAsync(async () => {
269
272
  return page.locator("#form1").getByText("This is a test:").click({ timeout: 300 });
270
273
  });
271
274
  });
272
275
  it("check wether it's possible to submit through http", async () => {
273
276
  await axios.post(
274
- "http://localhost:8080/form2",
277
+ `http://localhost:${port}/form2`,
275
278
  {
276
279
  form2__text: "pass"
277
280
  },
@@ -303,7 +306,7 @@ describe("multiform test", () => {
303
306
  true
304
307
  );
305
308
  app.use(router.routes()).use(router.allowedMethods());
306
- server = app.listen(8080);
309
+ server = app.listen(port);
307
310
  const browser = await getBrowser();
308
311
  const context = await browser.newContext({});
309
312
  page = await context.newPage();
@@ -312,12 +315,12 @@ describe("multiform test", () => {
312
315
  server.close();
313
316
  });
314
317
  it("check wether form1 renders", async () => {
315
- await page.goto("http://localhost:8080");
318
+ await page.goto(`http://localhost:${port}`);
316
319
  await page.locator("#form1").getByText("This is a test:").click({ timeout: 300 });
317
320
  });
318
321
  it("check wether it's possible to submit to form1 through http", async () => {
319
322
  await axios.post(
320
- "http://localhost:8080/form1",
323
+ `http://localhost:${port}/form1`,
321
324
  {
322
325
  form1__text: "pass"
323
326
  },
@@ -331,14 +334,14 @@ describe("multiform test", () => {
331
334
  );
332
335
  });
333
336
  it("check wether form2 does not render", async () => {
334
- await page.goto("http://localhost:8080");
337
+ await page.goto(`http://localhost:${port}`);
335
338
  await assertThrowsAsync(async () => {
336
339
  return page.locator("#form2").getByText("This is a test:").click({ timeout: 300 });
337
340
  });
338
341
  });
339
342
  it("check wether it's possible to submit to form2 through http", async () => {
340
343
  await axios.post(
341
- "http://localhost:8080/form2",
344
+ `http://localhost:${port}/form2`,
342
345
  {
343
346
  form2__text: "pass"
344
347
  },
@@ -412,7 +415,7 @@ describe("multiform test", () => {
412
415
  true
413
416
  );
414
417
  app.use(router.routes()).use(router.allowedMethods());
415
- server = app.listen(8080);
418
+ server = app.listen(port);
416
419
  });
417
420
  afterAll(async () => {
418
421
  server.close();
@@ -473,7 +476,7 @@ describe("multiform test", () => {
473
476
  true
474
477
  );
475
478
  app.use(router.routes()).use(router.allowedMethods());
476
- server = app.listen(8080);
479
+ server = app.listen(port);
477
480
  });
478
481
  afterAll(async () => {
479
482
  server.close();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sealcode/sealgen",
3
- "version": "0.12.8",
3
+ "version": "0.12.9",
4
4
  "description": "Module to automate adding routes and collections to a sealious application",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "prettier": "^2.7.1",
61
61
  "prompts": "^2.4.2",
62
62
  "recursive-readdir": "^2.2.3",
63
- "tempstream": "^0.3.0",
63
+ "tempstream": "^0.3.4",
64
64
  "tiny-glob": "^0.2.9",
65
65
  "ws": "^8.16.0",
66
66
  "yargs": "^17.6.2"
@@ -65,13 +65,20 @@ describe("add route test", () => {
65
65
  console.log(
66
66
  "\tstarting the database...(if timeouts here, run 'docker pull mongo:4.4-bionic' to solve)"
67
67
  );
68
- const port = await getPort();
69
- await execAsync(`docker run -p ${port}:27017 --name ${container_name} -d mongo:4.4-bionic`);
68
+ const mongo_port = await getPort();
69
+ const app_port = await getPort();
70
+ await execAsync(
71
+ `docker run -p ${mongo_port}:27017 --name ${container_name} -d mongo:4.4-bionic`
72
+ );
70
73
  console.log("\trunning app and making request to the generated url...");
71
- const env = { ...process.env, SEALIOUS_MONGO_PORT: port.toString() };
74
+ const env = {
75
+ ...process.env,
76
+ SEALIOUS_MONGO_PORT: mongo_port.toString(),
77
+ SEALIOUS_PORT: app_port.toString(),
78
+ };
72
79
  const node_args = [`${app_path}/dist/back/index.js`];
73
80
  console.log(
74
- "EXECUTING",
81
+ "EXECUTING APP",
75
82
  `${Object.entries(env)
76
83
  .map(([key, value]) => `${key}=${value}`)
77
84
  .join(" ")} node ${node_args.join(" ")}`
@@ -79,17 +86,17 @@ describe("add route test", () => {
79
86
  let app_start = spawn(`node`, node_args, {
80
87
  env,
81
88
  });
82
- app_start.stdout.on("data", (data) => console.log(data.toString()));
89
+ app_start.stdout.on("data", (data) => console.log("APP OUTPUT:", data.toString()));
83
90
  app_start.stderr.on("data", (data) => console.log(data.toString()));
84
91
  if (app_start.pid == undefined) throw new Error("node failed to start");
85
92
  node_pid = app_start.pid;
86
93
  await waitPort({
87
94
  host: "localhost",
88
- port: 8080,
95
+ port: app_port,
89
96
  output: "silent",
90
97
  timeout: 6000,
91
98
  });
92
- const res = await axios.get("http://localhost:8080/sample");
99
+ const res = await axios.get(`http://localhost:${app_port}/sample`);
93
100
  if (res.status != 200) {
94
101
  throw new Error("url generated by add-route exists but doesnt return 200");
95
102
  }
@@ -9,6 +9,7 @@ import { locator_is_visible } from "../test_utils/locator_is_visible.js";
9
9
  import { getBrowser } from "../utils/browser-creator.js";
10
10
  import { assertThrowsAsync } from "../utils/utils.js";
11
11
  import { FormDataValue } from "./form-types.js";
12
+ import getPort from "get-port";
12
13
 
13
14
  const fields = {
14
15
  text: new Fields.SimpleFormField(true),
@@ -33,6 +34,9 @@ export function form_factory(canAccessFun?: Mountable["canAccess"]): Form<typeof
33
34
  return result;
34
35
  }
35
36
 
37
+ const port = await getPort();
38
+ console.log("Using port " + port + " for form.test.ts");
39
+
36
40
  describe("form test", () => {
37
41
  let page: Page;
38
42
 
@@ -51,8 +55,8 @@ describe("form test", () => {
51
55
 
52
56
  mount(router, "/", form_factory(), true);
53
57
  app.use(router.routes()).use(router.allowedMethods());
54
- server = app.listen(8080);
55
- await page.goto("http://localhost:8080");
58
+ server = app.listen(port);
59
+ await page.goto(`http://localhost:${port}`);
56
60
  });
57
61
 
58
62
  afterAll(async () => {
@@ -75,7 +79,7 @@ describe("form test", () => {
75
79
 
76
80
  it("does not allow submitting an empty form by circumventing HTML-based validation", async () => {
77
81
  const res_axios = await axios.post(
78
- "http://localhost:8080",
82
+ `http://localhost:${port}`,
79
83
  {
80
84
  text: "",
81
85
  },
@@ -114,8 +118,8 @@ describe("form test", () => {
114
118
  true
115
119
  );
116
120
  app.use(router.routes()).use(router.allowedMethods());
117
- server = app.listen(8080);
118
- const response = await page.goto("http://localhost:8080");
121
+ server = app.listen(port);
122
+ const response = await page.goto(`http://localhost:${port}`);
119
123
  if (response?.status() != 200) {
120
124
  throw new Error(`Should return 200 status and it returns ${response?.status()}`);
121
125
  }
@@ -143,12 +147,11 @@ describe("form test", () => {
143
147
  });
144
148
 
145
149
  beforeEach(async () => {
146
- server = app.listen(8080);
150
+ server = app.listen(port);
147
151
  });
148
152
 
149
153
  it("prevents the form from rendering", async () => {
150
- console.log("CONSOLELOG TEST");
151
- const response = await page.goto("http://localhost:8080");
154
+ const response = await page.goto(`http://localhost:${port}`);
152
155
  if (response?.status() != 403) {
153
156
  throw new Error(
154
157
  `Should return 403 status and it returns ${response?.status()}`
@@ -158,7 +161,7 @@ describe("form test", () => {
158
161
 
159
162
  it("does not allow submitting of the form through axios", async () => {
160
163
  await axios.post(
161
- "http://localhost:8080",
164
+ `http://localhost:${port}`,
162
165
  {
163
166
  text: "sample",
164
167
  },
@@ -189,8 +192,8 @@ describe("form test", () => {
189
192
  true
190
193
  );
191
194
  app.use(router.routes()).use(router.allowedMethods());
192
- server = app.listen(8080);
193
- const response = await page.goto("http://localhost:8080");
195
+ server = app.listen(port);
196
+ const response = await page.goto(`http://localhost:${port}`);
194
197
  if (response?.status() != 403) {
195
198
  throw new Error(`Should return 403 status and it returns ${response?.status()}`);
196
199
  }
@@ -219,8 +222,8 @@ describe("form test", () => {
219
222
  true
220
223
  );
221
224
  app.use(router.routes()).use(router.allowedMethods());
222
- server = app.listen(8080);
223
- const response = await page.goto("http://localhost:8080");
225
+ server = app.listen(port);
226
+ const response = await page.goto(`http://localhost:${port}`);
224
227
  if (response?.status() != 200) {
225
228
  throw new Error(`Should return 200 status and it returns ${response?.status()}`);
226
229
  }
@@ -268,8 +271,8 @@ describe("form test", () => {
268
271
  );
269
272
 
270
273
  app.use(router.routes()).use(router.allowedMethods());
271
- server = app.listen(8080);
272
- await page.goto("http://localhost:8080");
274
+ server = app.listen(port);
275
+ await page.goto(`http://localhost:${port}`);
273
276
  });
274
277
 
275
278
  afterAll(async () => {
@@ -325,8 +328,8 @@ describe("form test", () => {
325
328
  );
326
329
 
327
330
  app.use(router.routes()).use(router.allowedMethods());
328
- server = app.listen(8080);
329
- await page.goto("http://localhost:8080");
331
+ server = app.listen(port);
332
+ await page.goto(`http://localhost:${port}`);
330
333
  });
331
334
 
332
335
  afterAll(async () => {
@@ -1,7 +1,7 @@
1
1
  import Router from "@koa/router";
2
2
  import Koa from "koa";
3
3
  import axios from "axios";
4
- import { Browser, firefox, Page } from "playwright";
4
+ import { Browser, Page } from "playwright";
5
5
  import { expect } from "@playwright/test";
6
6
  import { FlatTemplatable, tempstream } from "tempstream";
7
7
  import { mount } from "../mount.js";
@@ -16,6 +16,10 @@ import { SimpleInput } from "./controls/simple-input.js";
16
16
  import { Mountable } from "../page/mountable.js";
17
17
  import { FormDataValue, FormMessage } from "./form-types.js";
18
18
  import { EmailField } from "./fields/email.js";
19
+ import getPort from "get-port";
20
+
21
+ const port = await getPort();
22
+ console.log(`Using port ${port} form multiform.test.ts`);
19
23
 
20
24
  const fields1 = {
21
25
  email: new SimpleFormField(true),
@@ -79,7 +83,7 @@ async function tests(js_enabled: boolean) {
79
83
  javaScriptEnabled: js_enabled,
80
84
  });
81
85
  page = await context.newPage();
82
- await page.goto("http://localhost:8080");
86
+ await page.goto(`http://localhost:${port}`);
83
87
  await page.getByLabel("email").click();
84
88
  await page.getByLabel("email").fill("sample1");
85
89
  await page.getByLabel("name").click();
@@ -108,7 +112,7 @@ async function general_form_validation_e2e_tests(js_enabled: boolean) {
108
112
  javaScriptEnabled: js_enabled,
109
113
  });
110
114
  page = await context.newPage();
111
- await page.goto("http://localhost:8080");
115
+ await page.goto(`http://localhost:${port}`);
112
116
  await page.getByPlaceholder("text").click();
113
117
  await page.getByPlaceholder("text").fill("incorrect");
114
118
  await page.getByPlaceholder("password").click();
@@ -129,7 +133,7 @@ async function individual_field_validation_e2e_tests(javaScriptEnabled: boolean)
129
133
  javaScriptEnabled,
130
134
  });
131
135
  page = await context.newPage();
132
- await page.goto("http://localhost:8080");
136
+ await page.goto(`http://localhost:${port}`);
133
137
  });
134
138
 
135
139
  it("validation message shows when incorrect input is given", async () => {
@@ -191,7 +195,7 @@ describe("multiform test", () => {
191
195
  true
192
196
  );
193
197
  app.use(router.routes()).use(router.allowedMethods());
194
- server = app.listen(8080);
198
+ server = app.listen(port);
195
199
  });
196
200
 
197
201
  afterAll(() => {
@@ -229,7 +233,7 @@ describe("multiform test", () => {
229
233
  true
230
234
  );
231
235
  app.use(router.routes()).use(router.allowedMethods());
232
- server = app.listen(8080);
236
+ server = app.listen(port);
233
237
  const browser = await getBrowser();
234
238
  const context = await browser.newContext();
235
239
  page = await context.newPage();
@@ -240,7 +244,7 @@ describe("multiform test", () => {
240
244
  });
241
245
 
242
246
  it("check wether it renders", async () => {
243
- const response = await page.goto("http://localhost:8080");
247
+ const response = await page.goto(`http://localhost:${port}`);
244
248
 
245
249
  if (response?.status() != 200) {
246
250
  throw new Error(
@@ -253,7 +257,7 @@ describe("multiform test", () => {
253
257
 
254
258
  it("check wether you can submit through http (axios)", async () => {
255
259
  await axios.post(
256
- "http://localhost:8080/form2",
260
+ `http://localhost:${port}/form2`,
257
261
  {
258
262
  form2__text: "pass",
259
263
  },
@@ -290,7 +294,7 @@ describe("multiform test", () => {
290
294
  true
291
295
  );
292
296
  app.use(router.routes()).use(router.allowedMethods());
293
- server = app.listen(8080);
297
+ server = app.listen(port);
294
298
  const browser = await getBrowser();
295
299
  const context = await browser.newContext();
296
300
  page = await context.newPage();
@@ -301,7 +305,7 @@ describe("multiform test", () => {
301
305
  });
302
306
 
303
307
  it("check wether forms didnt render", async () => {
304
- await page.goto("http://localhost:8080");
308
+ await page.goto(`http://localhost:${port}`);
305
309
  await assertThrowsAsync(async () => {
306
310
  return page
307
311
  .locator("#form1")
@@ -312,7 +316,7 @@ describe("multiform test", () => {
312
316
 
313
317
  it("check wether it's possible to submit through http", async () => {
314
318
  await axios.post(
315
- "http://localhost:8080/form2",
319
+ `http://localhost:${port}/form2`,
316
320
  {
317
321
  form2__text: "pass",
318
322
  },
@@ -349,7 +353,7 @@ describe("multiform test", () => {
349
353
  true
350
354
  );
351
355
  app.use(router.routes()).use(router.allowedMethods());
352
- server = app.listen(8080);
356
+ server = app.listen(port);
353
357
  const browser = await getBrowser();
354
358
  const context = await browser.newContext({});
355
359
  page = await context.newPage();
@@ -360,13 +364,13 @@ describe("multiform test", () => {
360
364
  });
361
365
 
362
366
  it("check wether form1 renders", async () => {
363
- await page.goto("http://localhost:8080");
367
+ await page.goto(`http://localhost:${port}`);
364
368
  await page.locator("#form1").getByText("This is a test:").click({ timeout: 300 });
365
369
  });
366
370
 
367
371
  it("check wether it's possible to submit to form1 through http", async () => {
368
372
  await axios.post(
369
- "http://localhost:8080/form1",
373
+ `http://localhost:${port}/form1`,
370
374
  {
371
375
  form1__text: "pass",
372
376
  },
@@ -380,7 +384,7 @@ describe("multiform test", () => {
380
384
  });
381
385
 
382
386
  it("check wether form2 does not render", async () => {
383
- await page.goto("http://localhost:8080");
387
+ await page.goto(`http://localhost:${port}`);
384
388
  await assertThrowsAsync(async () => {
385
389
  return page
386
390
  .locator("#form2")
@@ -391,7 +395,7 @@ describe("multiform test", () => {
391
395
 
392
396
  it("check wether it's possible to submit to form2 through http", async () => {
393
397
  await axios.post(
394
- "http://localhost:8080/form2",
398
+ `http://localhost:${port}/form2`,
395
399
  {
396
400
  form2__text: "pass",
397
401
  },
@@ -468,7 +472,7 @@ describe("multiform test", () => {
468
472
  true
469
473
  );
470
474
  app.use(router.routes()).use(router.allowedMethods());
471
- server = app.listen(8080);
475
+ server = app.listen(port);
472
476
  });
473
477
 
474
478
  afterAll(async () => {
@@ -531,7 +535,7 @@ describe("multiform test", () => {
531
535
  true
532
536
  );
533
537
  app.use(router.routes()).use(router.allowedMethods());
534
- server = app.listen(8080);
538
+ server = app.listen(port);
535
539
  });
536
540
 
537
541
  afterAll(async () => {