diff --git a/.env.example b/.env.example index f7baccf..9b47526 100644 --- a/.env.example +++ b/.env.example @@ -1 +1 @@ -PLAYWRIGHT_PORT= +SERVER_PORT= diff --git a/bun.lockb b/bun.lockb index 70f493a..500b13a 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/e2e/auctions.test.ts b/e2e/auctions.test.ts index 07cb2c7..4c55b7d 100644 --- a/e2e/auctions.test.ts +++ b/e2e/auctions.test.ts @@ -1,6 +1,6 @@ import { expect, test } from "@playwright/test"; import { apis, baseURL } from "../src/constants/apis.constant"; -import { playwrightConstants } from "./constants"; +import { playwrightConstants } from "./config"; test.describe("Create Auction via Topsort SDK", () => { test("should create an auction successfully", async ({ page }) => { @@ -23,7 +23,7 @@ test.describe("Create Auction via Topsort SDK", () => { await route.fulfill({ json: mockAPIResponse }); }); - await page.goto(playwrightConstants.url); + await page.goto(playwrightConstants.host); const result = await page.evaluate(() => { const config = { apiKey: "rando-api-key", @@ -59,7 +59,7 @@ test.describe("Create Auction via Topsort SDK", () => { test("should fail to call with missing apiKey", async ({ page }) => { const expectedError = { status: 401, statusText: "API Key is required.", body: {} }; - await page.goto(playwrightConstants.url); + await page.goto(playwrightConstants.host); const result = await page.evaluate(() => { const config = { apiKey: null, diff --git a/e2e/config.ts b/e2e/config.ts new file mode 100644 index 0000000..008e530 --- /dev/null +++ b/e2e/config.ts @@ -0,0 +1,3 @@ +export const playwrightConstants = { + host: `http://localhost:${process.env.SERVER_PORT || 8080}/index.html`, +}; diff --git a/e2e/constants.ts b/e2e/constants.ts deleted file mode 100644 index 2864308..0000000 --- a/e2e/constants.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const playwrightConstants = { - url: `http://localhost:${process.env.PLAYWRIGHT_PORT || 8080}/e2e`, -} \ No newline at end of file diff --git a/e2e/events.test.ts b/e2e/events.test.ts index 9b92682..57408e5 100644 --- a/e2e/events.test.ts +++ b/e2e/events.test.ts @@ -1,6 +1,6 @@ import { expect, test } from "@playwright/test"; import { apis, baseURL } from "../src/constants/apis.constant"; -import { playwrightConstants } from "./constants"; +import { playwrightConstants } from "./config"; test.describe("Report Events via Topsort SDK", () => { test("should report an successfully", async ({ page }) => { @@ -12,7 +12,7 @@ test.describe("Report Events via Topsort SDK", () => { await route.fulfill({ json: mockAPIResponse }); }); - await page.goto(playwrightConstants.url); + await page.goto(playwrightConstants.host); const result = await page.evaluate(() => { const config = { apiKey: "rando-api-key", @@ -45,7 +45,7 @@ test.describe("Report Events via Topsort SDK", () => { test("should fail to call with missing apiKey", async ({ page }) => { const expectedError = { status: 401, statusText: "API Key is required.", body: {} }; - await page.goto(playwrightConstants.url); + await page.goto(playwrightConstants.host); const result = await page.evaluate(() => { const config = { apiKey: null, diff --git a/e2e/index.html b/e2e/public/index.html similarity index 93% rename from e2e/index.html rename to e2e/public/index.html index 9b1cedd..0165b8e 100644 --- a/e2e/index.html +++ b/e2e/public/index.html @@ -4,7 +4,7 @@