1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/web
jbpratt c6eb6b573d test(web): migrate more tests to playwright (#4773)
* test(web): migrate superuser-org-actions.cy.ts to Playwright

Migrate Cypress E2E tests for superuser organization actions to Playwright
following the project's MIGRATION.md guidelines.

Changes:
- Add new test file: playwright/e2e/superuser/org-actions.spec.ts
- Consolidate 12 Cypress tests into 5 focused Playwright tests
- Use real API data instead of mocked fixtures
- Auto-cleanup via TestApi fixture

Test coverage:
- Superuser sees actions column and options menu for organizations
- Regular user does not see organization options menu
- Superuser can rename organization
- Superuser can delete organization
- Superuser can take ownership of organization

Skipped from migration:
- Quota menu tests (already covered by quota.spec.ts)
- Fresh login requirement tests (low value, complex to mock)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(web): set superuser feature tag

Signed-off-by: Brady Pratt <bpratt@redhat.com>

* test(web): migrate superuser-messages.cy.ts to Playwright

Migrate superuser messages tests from Cypress to Playwright, consolidating
14 original tests into 6 focused, value-add tests.

Tests cover:
- Non-superuser redirect to organization page
- Full CRUD flow: create, view, and delete messages via UI
- Error state when API fails to load messages
- Loading spinner during message fetch
- Read-only superuser can access and view messages
- Read-only superuser sees disabled create/delete actions

Infrastructure additions:
- Add message() method to TestApi with auto-cleanup
- Add CreatedMessage interface for type safety
- Add SUPERUSERS_FULL_ACCESS feature tag

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(web): migrate superuser-user-management.cy.ts to Playwright

Consolidates 29 Cypress tests into 11 Playwright tests covering
superuser user management functionality.

Changes:
- Add CreatedUser interface and user() method to TestApi for
  user creation with auto-cleanup
- Add createUserAsSuperuser() to API client using superuser endpoint
- Add QuayAuthType and skipUnlessAuthType() helper for auth-type
  conditional tests
- Create user-management.spec.ts with consolidated tests

Tests cover:
- Create user via UI (Database/AppToken auth only)
- User access control based on user type
- Change email and password (Database auth only)
- Toggle user status (disable/enable)
- Delete user
- Take ownership (convert user to org)
- Fresh login error handling with mocked responses
- Send recovery email (MAILING feature)
- Auth type visibility

Key patterns:
- Uses search to find users in paginated list
- page.route() only for error scenarios per MIGRATION.md
- skipUnlessAuthType() for auth-dependent tests
- @feature:SUPERUSERS_FULL_ACCESS tag for all tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* test(web): delete more migrated cypress tests

Signed-off-by: Brady Pratt <bpratt@redhat.com>

* test(web): migrate superuser-framework Cypress test to Playwright

Consolidates 7 Cypress tests into 4 Playwright tests covering:
- Superuser navigation to all superuser pages
- Navigation section visibility and expansion
- Organizations table Settings column and actions menu
- Regular user restrictions and redirects

Uses real superuserPage/authenticatedPage fixtures instead of mocking.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* test(web): migrate superuser-service-keys Cypress test to Playwright

Consolidates 17 Cypress tests into 5 Playwright tests:
- non-superuser redirect to organization page
- superuser CRUD lifecycle (create, view, search, update, delete)
- error handling when create fails
- read-only superuser permission restrictions
- bulk select and delete operations

Adds service key API methods to Playwright test utilities:
- getServiceKeys, createServiceKey, updateServiceKey, deleteServiceKey
- TestApi.serviceKey() with auto-cleanup support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(web): migrate superuser-change-log Cypress test to Playwright

Migrate superuser-change-log.cy.ts to Playwright with test consolidation:
- 7 original tests reduced to 2 focused tests
- Access control tests already covered by framework.spec.ts
- Loading spinner and empty state tests skipped (low value)
- Uses real API calls except for error state (acceptable mock)
- No PatternFly class dependencies, uses role-based selectors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(web): migrate superuser-usage-logs Cypress test to Playwright

- Consolidate 7 Cypress tests into 2 Playwright tests
- Access control tests already covered by framework.spec.ts
- Add data-testid="usage-logs-table" to UsageLogsTable component
- Tests verify: page header, date pickers, chart toggle, table loading,
  and filter functionality
- Use structural assertions for parallel test safety

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Brady Pratt <bpratt@redhat.com>

* test(web): remove unneeded comments

Signed-off-by: Brady Pratt <bpratt@redhat.com>

---------

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 17:54:25 -06:00
..
2022-12-20 08:38:16 -05:00
2022-12-20 08:38:16 -05:00
2022-12-20 08:38:16 -05:00
2025-11-06 12:51:23 -06:00
2022-12-20 08:38:16 -05:00
2022-12-20 08:38:16 -05:00
2022-12-20 08:38:16 -05:00
2022-12-20 08:38:16 -05:00
2022-12-20 08:38:16 -05:00
2022-12-20 08:38:16 -05:00

Quay UI

UI for Quay based on React and Patternfly framework

Installation

It is assumed that you have a Quay instance running that you can point the UI to. Run the following commands to get started

git clone https://github.com/quay/quay-ui.git
cd quay-ui
npm install

Development

Start the dev server by running

npm start

Runs the app in the development mode.
Open http://localhost:9000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

By default the UI connects to the quay backend for API. If you don't have a backend or want to develop without a backend you can set the environment variable MOCK_API=true before running npm start.

In order for you to use this with a Quay backend, you need to configure CORS on the Quay side. Add the following to your config.yaml in Quay

CORS_ORIGIN: "http://localhost:9000"

If you are using docker-compose for local development, you can add this to local-dev/stack/config.yaml in the Quay repo.

Testing

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

Integration Tests

Integration tests are ran via Cypress. The URL under test defaults to http://localhost:9000 and can be overriden with the baseUrl parameter in the cypress.config.ts file.

To run tests locally:

  • Start the application with npm start
  • When application has started run the tests with npm run test:integration

Building for Production

npm run build

Builds the app for production to the dist folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes. See the section about deployment for more information.