Created
March 27, 2025 15:10
-
-
Save Noxsios/6bab51012c1713948a30d197cb3587a3 to your computer and use it in GitHub Desktop.
Playwright + KFC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { expect } from "@playwright/test" | |
import { test } from "../../../e2e" | |
import { K8s as k, kind } from "kubernetes-fluent-client" | |
test("has title", async ({ page, pkg }) => { | |
await page.goto("/") | |
const ns = pkg.components.at(0)?.charts?.at(0)?.namespace || "" | |
expect(ns).toBeTruthy() | |
const pods = await k(kind.Pod).InNamespace(ns).Get() | |
expect(pods.items.length).toBe(2) | |
const title = await page.title() | |
// uncomment to cause the test to fail, then run w/ to see some magic | |
// `npx playwright test --project podinfo-chromium --trace on` | |
// const title = "podinfo" | |
expect(pods.items.map((p) => p.metadata?.name).find((n) => n === title)).toBeTruthy() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment