• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

KusionStack / karpor / 39356395367
65%

Build:
DEFAULT BRANCH: main
Ran 20 Oct 2026 01:59AM UTC
Jobs 1
Files 68
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Oct 2026 01:58AM UTC coverage: 63.801%. Remained the same
39356395367

push

github

web-flow
test(ui): add a Playwright e2e prototype for login and search (#862)

## What type of PR is this?

/kind test

## What this PR does / why we need it:

A small Playwright prototype for the UI e2e suite in #460, as suggested
there: login and search first, with the gitea `tests/e2e` setup as the
reference. It is deliberately small so we can agree on the approach
before adding more.

**How it works**

Playwright starts the UI dev server (`npm run dev`, port 8000) and stubs
every backend call with `page.route`. So the suite needs no karpor
server, Elasticsearch or cluster, and runs in about 40 seconds in CI.

- `ui/playwright.config.ts`: Chromium only, one worker, one retry in CI,
trace and screenshot kept on failure.
- `ui/e2e/mock-api.ts`: stubs `/server-configs`, `/rest-api/v1/authn`,
`/rest-api/v1/search`, and a catch-all for other `/rest-api` calls.
`rbac: true` turns on `EnableRBAC`, so the UI asks for a token. The UI
language is set to English so assertions use the en.json text.
- `ui/e2e/login.spec.ts`:
  - with RBAC on, opening `/insight` redirects to `/login`
  - an empty token shows "Enter Token"
- an invalid token (mocked 401) shows "Login failed. Please check token
validity"
  - a valid token logs in, saves the token, and returns to `/insight`
- `ui/e2e/search.spec.ts`: types `where kind='Deployment'` into the SQL
editor and presses Enter. It checks that the UI calls
`/rest-api/v1/search` with `pattern=sql` and `query=select * from
resources where kind='Deployment'`, and that both returned resources
appear on the result page.
- `ui/package.json`: `@playwright/test` 1.63.0 as a dev dependency and
an `e2e` script.
- `.github/workflows/ui-e2e.yaml`: runs the suite on PRs and pushes to
main that touch `ui/`, and uploads the report when it fails.

**How to run it**

```
cd ui
npm install
npx playwright install chromium
npm run e2e
```

**How I tested it**

- Locally on macOS: 5 passed.
- On my fork's CI (Ubuntu, Node 20), with a temporary commit th... (continued)

4394 of 6887 relevant lines covered (63.8%)

0.7 hits per line

Jobs
ID Job ID Ran Files Coverage
1 39356395367.1 20 Oct 2026 01:59AM UTC 68
63.8
GitHub Action Run
Source Files on build 39356395367
  • Tree
  • List 68
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 1276782e on github
  • Prev Build on main (#38717177540)
  • Next Build on main (#39356401477)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc