Skip to content

Conversation

@feloy
Copy link
Contributor

@feloy feloy commented Dec 3, 2025

Bootstrap e2e tests, to be completed

Tests will be executed in CI, in follow-up PR

Part of #76

@feloy feloy requested review from a team and benoitf as code owners December 3, 2025 14:21
@feloy feloy requested review from SoniaSandler, dgolovin and simonrey1 and removed request for a team December 3, 2025 14:21
@feloy feloy changed the title tests: e2e tests test: e2e tests Dec 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

📝 Walkthrough

Walkthrough

Adds a Playwright end-to-end test package and tests for the Kubernetes Dashboard extension, updates workspace and TypeScript configs, adds root npm scripts, adjusts the build container pnpm command, and includes the new test package in release workflow version-bump and git-add steps.

Changes

Cohort / File(s) Summary
Release workflow & CI
\.github/workflows/release.yaml
Extended sed-based version bump and git add steps to include tests/playwright/package.json alongside existing package.json entries.
Container build
build/Containerfile
Changed pnpm invocation to use --workspace-root when adding isomorphic-ws in the extension directory.
Workspace configuration
pnpm-workspace.yaml
Added tests/* to workspace packages and expanded onlyBuiltDependencies to include svelte-preprocess and unrs-resolver.
Root package scripts
package.json
Added test:e2e and test:e2e:smoke scripts that run the corresponding scripts under tests/playwright.
Playwright package manifest & config
tests/playwright/package.json, tests/playwright/playwright.config.ts, tests/playwright/tsconfig.json
Added a new Playwright package manifest, Playwright config (workers=1, reporters: list/junit/json/html, output dir ./output/), and a tsconfig for the test package.
E2E tests and page model
tests/playwright/src/extension.spec.ts, tests/playwright/src/model/kd-details-page.ts
Added an end-to-end test suite for the Kubernetes Dashboard extension and a KubernetesDashboardDetailsPage page-object that extends ExtensionDetailsPage.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect tests/playwright/src/extension.spec.ts for test timeouts, serialization, and Podman startup/installation logic.
  • Verify reporter output paths and worker=1 in tests/playwright/playwright.config.ts align with CI/artefact expectations.
  • Check pnpm-workspace.yaml package globs and onlyBuiltDependencies additions for unintended effects on workspace builds.
  • Validate release.yaml sed patterns and git add steps correctly include tests/playwright/package.json.
  • Confirm build/Containerfile --workspace-root change behaves as intended in the container build context.

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'test: e2e tests' directly aligns with the main objective of bootstrapping end-to-end tests, clearly summarizing the primary changeset focus.
Description check ✅ Passed The description accurately explains that the PR bootstraps e2e tests with follow-up work planned, relating directly to the changeset additions of Playwright configuration and test files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (5)
tests/playwright/tsconfig.json (2)

8-8: Consider enabling skipLibCheck for faster compilation.

Setting skipLibCheck: false forces TypeScript to check all declaration files, which slows down compilation. For test code, setting this to true is typically preferred.

Apply this diff:

-    "skipLibCheck": false,
+    "skipLibCheck": true,

12-12: Review the "tests/" exclusion pattern.**

Excluding "tests/**" from a tsconfig.json located in tests/playwright/ may be confusing or could unintentionally exclude nested test directories if any are added later.

Consider whether this exclusion is necessary, or clarify its intent with a comment.

tests/playwright/src/extension.spec.ts (3)

28-34: Defaulting to :latest image may hurt CI determinism

Using :latest as the fallback for EXTENSION_OCI_IMAGE (Line 28) is convenient locally but makes CI runs non‑reproducible when the env var isn’t set. If these tests are ever run in CI without EXTENSION_OCI_IMAGE defined, you may see spurious breakage when the image is updated.

Consider either:

  • Making EXTENSION_OCI_IMAGE required in CI (and only defaulting for local runs), or
  • Pointing the default to a fixed tag or digest that you update intentionally.

70-83: Avoid cross‑test shared state for extensionsPage

extensionsPage (Line 71) is populated in one test and consumed in another:

  • Line 73–78: initialized in Open Settings -> Extensions page.
  • Line 80–83: used in Install extension without any local initialization.

This has a couple of drawbacks:

  • It relies on test.describe.serial semantics plus execution order; reordering tests or running a single test in isolation would break it.
  • Under stricter TypeScript settings, this pattern can trigger TS2454 (“Variable is used before being assigned”), since the compiler doesn’t see the assignment happening within the same function body.

A more robust pattern is to keep each test self‑contained, for example:

-  test(`Install extension`, async () => {
-    test.skip(EXTENSION_PREINSTALLED, 'Extension is preinstalled');
-    await extensionsPage.installExtensionFromOCIImage(EXTENSION_OCI_IMAGE);
-  });
+  test(`Install extension`, async ({ navigationBar }) => {
+    test.skip(EXTENSION_PREINSTALLED, 'Extension is preinstalled');
+    const extensionsPage = await navigationBar.openExtensions();
+    await extensionsPage.installExtensionFromOCIImage(EXTENSION_OCI_IMAGE);
+  });

This preserves serial semantics but removes cross‑test coupling and any definite‑assignment concerns.


103-111: Clarify error‑tab assertion to better express intent

The current pattern:

  • Checks if an “Error” tab exists.
  • If present, activates it and captures stackTrace.
  • Then always runs expect(errorTab, message).not.toBeVisible() (Line 110).

Functionally this will:

  • Pass when the Error tab is absent (no error).
  • Fail when it’s present/visible, with a message that includes the captured stack trace.

That meets the intent but is a bit non‑obvious to a reader, since we deliberately make the tab visible in the error case and then assert that it’s not visible to force a failure.

You could make the intent clearer by asserting on the count instead of visibility, while still propagating the stack trace, for example:

-      let stackTrace = '';
-      if ((await errorTab.count()) > 0) {
-        await details.activateTab('Error');
-        stackTrace = await details.errorStackTrace.innerText();
-      }
-      await playExpect(errorTab, `Error Tab was present with stackTrace: ${stackTrace}`).not.toBeVisible();
+      const errorTabCount = await errorTab.count();
+      let stackTrace = '';
+      if (errorTabCount > 0) {
+        await details.activateTab('Error');
+        stackTrace = await details.errorStackTrace.innerText();
+      }
+      await playExpect(
+        errorTabCount,
+        `Error Tab was present with stackTrace: ${stackTrace}`,
+      ).toBe(0);

Same behavior, but the assertion more directly encodes “there must be no Error tab”.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 13a0f80 and 692782a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .github/workflows/release.yaml (2 hunks)
  • build/Containerfile (1 hunks)
  • package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • tests/playwright/package.json (1 hunks)
  • tests/playwright/playwright.config.ts (1 hunks)
  • tests/playwright/src/extension.spec.ts (1 hunks)
  • tests/playwright/src/model/kd-details-page.ts (1 hunks)
  • tests/playwright/tsconfig.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/playwright/src/extension.spec.ts (1)
tests/playwright/src/model/kd-details-page.ts (1)
  • KubernetesDashboardDetailsPage (22-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build / macos-14
  • GitHub Check: Build / ubuntu-24.04
  • GitHub Check: Build / windows-2022
  • GitHub Check: Build extension OCI image
🔇 Additional comments (10)
.github/workflows/release.yaml (2)

74-77: LGTM!

The tagging workflow correctly includes the new Playwright test package in version updates and git staging, maintaining consistency with existing package handling.


111-114: LGTM!

The version bump workflow correctly includes the new test package, ensuring consistent versioning across the monorepo.

pnpm-workspace.yaml (1)

3-3: LGTM!

Adding tests/* to the workspace correctly integrates the new Playwright test package into the monorepo structure.

build/Containerfile (1)

57-57: LGTM!

Adding --workspace-root correctly aligns the pnpm installation with the workspace configuration now that tests/* has been added to the workspace. This ensures pnpm respects the workspace structure when installing dependencies in the extension directory.

package.json (1)

26-27: LGTM!

The E2E test scripts correctly delegate to the Playwright package, providing convenient entry points from the root of the monorepo.

tests/playwright/playwright.config.ts (1)

21-40: LGTM!

The Playwright configuration is well-suited for bootstrapping E2E tests with:

  • Serial execution (workers: 1) for stability
  • Comprehensive reporting (junit, json, html)
  • Chromium-only testing as a starting point
tests/playwright/src/model/kd-details-page.ts (1)

22-26: LGTM!

The page object model follows best practices by extending the base ExtensionDetailsPage class and provides a clean abstraction for the Kubernetes Dashboard details page.

tests/playwright/src/extension.spec.ts (3)

35-62: RunnerOptions and startup flow look consistent with the fixtures

The use of RunnerOptions with a dedicated customFolder and disabled extensions plus the beforeAll that handles the welcome page and waits for the Podman machine to start are coherent and match typical Playwright patterns for this kind of setup. Timeout bump to 80s for startup is reasonable.


85-94: Polling for installation and status assertion look good

The polling loop via playExpect.poll (Lines 87–91) for extensionIsInstalled followed by reading the installed card and asserting ACTIVE status is a solid way to avoid race conditions during extension installation. This pattern should be fairly robust in CI.


96-103: Inconsistent extension name passed to getInstalledExtension

In line 98, you call:

const extensionCard = await extensions.getInstalledExtension('kubernetes-dashboard', CATALOG_EXTENSION_LABEL);

but elsewhere in this file:

  • CATALOG_EXTENSION_NAME is 'Kubernetes Dashboard' (Line 32)
  • The earlier test uses getInstalledExtension(CATALOG_EXTENSION_NAME, CATALOG_EXTENSION_LABEL) (Line 92)

This inconsistency between 'kubernetes-dashboard' and 'Kubernetes Dashboard' is likely a bug and may cause getInstalledExtension to fail to locate the card (or behave differently than intended).

Recommend aligning this call with the constant and the previous usage:

-      const extensionCard = await extensions.getInstalledExtension('kubernetes-dashboard', CATALOG_EXTENSION_LABEL);
+      const extensionCard = await extensions.getInstalledExtension(
+        CATALOG_EXTENSION_NAME,
+        CATALOG_EXTENSION_LABEL,
+      );

@feloy feloy requested a review from simonrey1 December 3, 2025 14:52
@feloy feloy requested a review from odockal December 4, 2025 08:22
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
tests/playwright/src/extension.spec.ts (2)

56-67: Timeout management could be centralized or made more explicit

Calling test.setTimeout inside beforeAll and afterAll works, but it makes per-hook time budgets a bit implicit and duplicated with the explicit 80_000 passed into waitForPodmanMachineStartup. Consider:

  • Moving timeouts to Playwright config or a top-level test.setTimeout for this file; or
  • Extracting timeout values into named constants so they’re easier to tune consistently.

This is purely for clarity/maintainability; behavior is fine as-is.

You may want to confirm in the Playwright docs that test.setTimeout behaves as expected inside afterAll hooks for your version.


69-84: Shared extensionsPage state makes tests order-dependent

extensionsPage is initialized in test("Open Settings -> Extensions page") and then used in test("Install extension"). This couples the second test to the first and assumes they always run together and in order.

Even with describe.serial, running a subset of tests (e.g., via a test name filter) can cause extensionsPage to be undefined when only “Install extension” is executed.

Consider refactoring, for example:

  • Move navigation to Extensions into a beforeEach/helper that returns extensionsPage; or
  • Merge these two tests into a single scenario test that opens the page and performs installation in one flow.

This will make the suite more robust to selective test runs.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 692782a and 42a24e2.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .github/workflows/release.yaml (2 hunks)
  • build/Containerfile (1 hunks)
  • package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • tests/playwright/package.json (1 hunks)
  • tests/playwright/playwright.config.ts (1 hunks)
  • tests/playwright/src/extension.spec.ts (1 hunks)
  • tests/playwright/src/model/kd-details-page.ts (1 hunks)
  • tests/playwright/tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • tests/playwright/tsconfig.json
  • tests/playwright/src/model/kd-details-page.ts
  • build/Containerfile
  • package.json
  • .github/workflows/release.yaml
  • tests/playwright/package.json
  • tests/playwright/playwright.config.ts
  • pnpm-workspace.yaml
🧰 Additional context used
🧬 Code graph analysis (1)
tests/playwright/src/extension.spec.ts (1)
tests/playwright/src/model/kd-details-page.ts (1)
  • KubernetesDashboardDetailsPage (22-26)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build / macos-14
  • GitHub Check: Build / windows-2022
  • GitHub Check: Build / ubuntu-24.04
  • GitHub Check: Build extension OCI image
🔇 Additional comments (2)
tests/playwright/src/extension.spec.ts (2)

35-54: RunnerOptions and extension-disabling setup look solid

Custom runnerOptions (folder name and extensions.disabled list) are a good fit for keeping this suite focused and faster by turning off unrelated extensions. No functional issues spotted here.

If you want to double‑check IDs, you can grep for these extension identifiers in the repo or Podman Desktop settings schema to ensure they exactly match the installed extensions.


85-94: Polling for installation and card status looks appropriate

The use of expect.poll with extensionIsInstalled(CATALOG_EXTENSION_LABEL) and subsequent getInstalledExtension(CATALOG_EXTENSION_NAME, CATALOG_EXTENSION_LABEL) plus status check against CATALOG_STATUS_ACTIVE is clear and matches the intent of verifying successful installation.

If you observe flaky installs, you might later consider:

  • Slightly increasing the poll timeout; or
  • Reusing a shared constant for this timeout across tests.

But as written, this block is sound.

Signed-off-by: Philippe Martin <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42a24e2 and a5724c0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .github/workflows/release.yaml (2 hunks)
  • build/Containerfile (1 hunks)
  • package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • tests/playwright/package.json (1 hunks)
  • tests/playwright/playwright.config.ts (1 hunks)
  • tests/playwright/src/extension.spec.ts (1 hunks)
  • tests/playwright/src/model/kd-details-page.ts (1 hunks)
  • tests/playwright/tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • .github/workflows/release.yaml
  • tests/playwright/playwright.config.ts
  • tests/playwright/tsconfig.json
  • package.json
  • tests/playwright/src/extension.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build / ubuntu-24.04
  • GitHub Check: Build extension OCI image
  • GitHub Check: Build / macos-14
  • GitHub Check: Build / windows-2022
🔇 Additional comments (3)
pnpm-workspace.yaml (1)

1-8: Workspace update to include tests/ looks good*

Including tests/* in the workspace aligns with the new Playwright test package and should integrate cleanly with existing pnpm setup.

build/Containerfile (1)

53-58: Use of --workspace-root with pnpm in the image build looks correct

Pointing pnpm add at /opt/app-root/extension with --workspace-root is consistent with the workspace setup and keeps isomorphic-ws pinned at the intended root package level.

tests/playwright/src/model/kd-details-page.ts (1)

1-26: Page object implementation is clean and idiomatic

The KubernetesDashboardDetailsPage wrapper over ExtensionDetailsPage is minimal, typed, and follows a clear pattern; constructor wiring via the extension display name looks appropriate.

@feloy feloy merged commit 5feb1b1 into podman-desktop:main Dec 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants