Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Use non-dev port for webserver during end-to-end tests
Thomas Scholtes committed 2 years ago
commit 999a3a4c3011bbbcc66b37926c31655adef6f775
parent d7442d23ae558ff1c0b51996d8cf9f39f31fbcc1
3 files changed +7 -10
modified playwright.config.ts
@@ -17,7 +17,7 @@ const config: PlaywrightTestConfig = {
  globalSetup: "./tests/support/globalSetup",
  use: {
    actionTimeout: 0,
-
    baseURL: "http://localhost:3000",
+
    baseURL: "http://localhost:3001",
    trace: "retain-on-failure",
  },

@@ -58,15 +58,14 @@ const config: PlaywrightTestConfig = {
        ...devices["Desktop Chrome"],
        actionTimeout: 0,
        deviceScaleFactor: 2,
-
        baseURL: "http://localhost:3000",
        trace: "off",
      },
    },
  ],

  webServer: {
-
    command: "npm run start",
-
    port: 3000,
+
    command: "npm run start -- --strictPort --port 3001",
+
    port: 3001,
  },
};

modified playwright.ipfs.config.ts
@@ -6,8 +6,8 @@ const config: PlaywrightTestConfig = {
  ...base,
  testIgnore: undefined,
  webServer: {
-
    command: "npm run start:ipfs",
-
    port: 3000,
+
    command: "npm run start:ipfs -- --strictPort --port 3001",
+
    port: 3001,
  },
};

modified tests/support/fixtures.ts
@@ -174,7 +174,7 @@ export const test = base.extend<{
    const { stdout } = await peer.rad([
      "web",
      "--frontend",
-
      "http://localhost:3000",
+
      "http://localhost:3001",
      "--backend",
      "http://127.0.0.1:8070",
      "--json",
@@ -182,9 +182,7 @@ export const test = base.extend<{
    const result = authSchema.safeParse(JSON.parse(stdout));
    if (result.success) {
      const { sessionId, publicKey, signature } = result.data;
-
      await page.goto(
-
        `http://localhost:3000/session/${sessionId}?pk=${publicKey}&sig=${signature}`,
-
      );
+
      await page.goto(`/session/${sessionId}?pk=${publicKey}&sig=${signature}`);
      await expect(page.getByText("Authenticated")).toBeVisible();
      await page.getByRole("button", { name: "Close" }).click();
    } else {