Skip to content

Add Playwright end-to-end tests#3441

Open
CannonLock wants to merge 1 commit into
PelicanPlatform:mainfrom
CannonLock:add-e2e-tests
Open

Add Playwright end-to-end tests#3441
CannonLock wants to merge 1 commit into
PelicanPlatform:mainfrom
CannonLock:add-e2e-tests

Conversation

@CannonLock
Copy link
Copy Markdown
Contributor

@CannonLock CannonLock commented May 11, 2026

  • Adds playwright
  • Templates for future tests
  • Automates test running

@h2zh This is just the start of the tests to get a base in to build on.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces Playwright-based end-to-end testing infrastructure for the Web UI, adds initial downtime-management E2E coverage (with API mocking), and wires the tests into GitHub Actions.

Changes:

  • Add Playwright configuration/scripts and an initial cross-service “downtime” E2E test suite (shared tests + page object + API mocks).
  • Update Web UI components/types to support stable E2E selectors and new API fields.
  • Add a GitHub Actions workflow to build Pelican binaries and run Playwright tests per-service.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
web_ui/frontend/types.ts Extends DowntimeGet type to include deletedAt.
web_ui/frontend/playwright.config.ts Adds Playwright config, dotenv loading, and per-service projects.
web_ui/frontend/package.json Adds Playwright + dotenv dev deps and e2e-related scripts.
web_ui/frontend/package-lock.json Locks Playwright/dotenv and updates transitive dependencies.
web_ui/frontend/jest.config.js Excludes e2e/ from Jest test discovery.
web_ui/frontend/e2e/shared_tests/downtimeTests.ts Implements shared downtime tests reused across services.
web_ui/frontend/e2e/shared_pages/DowntimePage.ts Adds shared page object for downtime UI interactions.
web_ui/frontend/e2e/README.md Documents how to run/configure Playwright E2E tests.
web_ui/frontend/e2e/origin/pages/OriginDowntimePage.ts Adds an origin-specific page object (currently unused).
web_ui/frontend/e2e/origin/downtime.spec.ts Registers shared downtime tests for origin.
web_ui/frontend/e2e/mocks/api/v1.0/downtime/get.ts Adds GET downtime fixtures and a helper route mock.
web_ui/frontend/e2e/mocks/api/v1.0/downtime/crud.ts Adds stateful CRUD API mocking for downtime endpoints.
web_ui/frontend/e2e/cache/downtime.spec.ts Registers shared downtime tests for cache.
web_ui/frontend/docker-compose.yml Updates local build/run commands for Pelican binaries/server.
web_ui/frontend/components/Downtime/Card.tsx Adds data-testid/attributes and improves edit button accessibility for E2E.
web_ui/frontend/.gitignore Ignores Playwright outputs and local e2e .env.
.github/workflows/test-webui-e2e.yml Adds CI workflow to build Pelican and run Playwright E2E tests per service.
Files not reviewed (1)
  • web_ui/frontend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web_ui/frontend/components/Downtime/Card.tsx
Comment thread web_ui/frontend/playwright.config.ts
Comment thread web_ui/frontend/playwright.config.ts
Comment thread web_ui/frontend/e2e/shared_pages/DowntimePage.ts
Comment thread web_ui/frontend/docker-compose.yml
Comment thread web_ui/frontend/e2e/README.md
Comment thread web_ui/frontend/e2e/origin/pages/OriginDowntimePage.ts Outdated
Comment thread web_ui/frontend/e2e/mocks/api/v1.0/downtime/get.ts
Comment thread .github/workflows/test-webui-e2e.yml
Comment thread web_ui/frontend/package-lock.json
@CannonLock
Copy link
Copy Markdown
Contributor Author

@CannonLock CannonLock linked an issue May 11, 2026 that may be closed by this pull request
@CannonLock CannonLock added this to the v7.26 milestone May 11, 2026
@CannonLock CannonLock added the web-ui Related to our web displays label May 11, 2026
@h2zh
Copy link
Copy Markdown
Contributor

h2zh commented May 12, 2026

@CannonLock Could you fix the failed tests? Seems like they are not those flaky ones.

- Adds playwright
- Templates for future tests
- Automates test running

Signed-off-by: clock <clock@wisc.edu>
Copy link
Copy Markdown
Contributor

@h2zh h2zh left a comment

Choose a reason for hiding this comment

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

This is a nice testing framework for webUI and a big step for Pelican! There are a few places worth a second look.

* Intercepts GET /api/v1.0/downtime and returns the provided fixture.
* Defaults to a two-entry list with one scheduled and one indefinite downtime.
*/
export async function mockGetDowntime(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This function is not being used anywhere.

this.submitButton = this.modal.getByRole('button', { name: 'Submit' });
this.closeModalButton = this.modal.getByRole('button').first();

this.editModal = page.getByRole('presentation').filter({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

editModal duplicates modal on line 68. Could you explain why?

- `cache`: Tests running against the Cache service
- `director`: Tests running against the Director service
- `registry`: Tests running against the Registry service
- `federation`: Tests that span multiple services (e.g. Origin + Cache)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I can't find this project in playwright.config.ts

registry/
pages/
*.spec.ts
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shared_pages, shared_tests direcotries are missing in this doc

Capabilities:
- Reads
- Listings
EOF
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To fix the current failed CI

Cannot create token, failed to initialize configuration: no discovery endpoint was resolved;
ensure Federation.DiscoveryUrl or Federation.DirectorUrl is configured

I think we should add the Federation.DiscoveryUrl here

Suggested change
EOF
Federation:
DiscoveryUrl: https://localhost:8444
EOF

fi
health_ok=false
key_ok=false
curl -sk https://localhost:8444/api/v1.0/health > /dev/null 2>&1 && health_ok=true
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice to also wait for director's metadata-publish step. What do you think?

curl -sk https://localhost:8444/.well-known/pelican-configuration > /dev/null && meta_ok=true

@h2zh h2zh assigned CannonLock and unassigned h2zh May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web-ui Related to our web displays

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add playwright tests

3 participants