Skip to content

Conversation

@DSingh0304
Copy link
Contributor

@DSingh0304 DSingh0304 commented Nov 10, 2025

Why submit this pull request?

  • New feature provided
  • Improve performance (test coverage)

What changes will this PR take into?

This PR adds comprehensive E2E tests for the Consumer Groups resource, covering all CRUD operations and list page functionality.

Test Coverage (5 tests, all passing ✅):

  1. List page tests (consumer_groups.list.spec.ts) - 3 tests

    • Navigation to consumer groups page
    • Pagination using table controls
    • Pagination using URL search parameters
  2. CRUD with required fields (consumer_groups.crud-required-fields.spec.ts) - 1 test

    • Creates consumer group via API with minimal required fields (id + plugins)
    • Tests view, edit mode, and delete operations through UI
  3. CRUD with all fields (consumer_groups.crud-all-fields.spec.ts) - 1 test

    • Creates consumer group with description and basic-auth plugin via UI
    • Tests full CRUD workflow including plugin addition
    • Verifies edit and delete operations

Files Added:

  • e2e/pom/consumer_groups.ts - Page Object Model with navigation helpers and assertions
  • e2e/tests/consumer_groups.list.spec.ts - List page and pagination tests
  • e2e/tests/consumer_groups.crud-required-fields.spec.ts - Required fields CRUD tests
  • e2e/tests/consumer_groups.crud-all-fields.spec.ts - All fields CRUD tests with plugins

Files Modified:

  • src/apis/consumer_groups.ts - Added deleteAllConsumerGroups helper for test cleanup

Implementation Details:

  • Consumer Groups require plugins field (even if empty object {}) per APISIX validation
  • Required fields test creates via API due to UI form validation requirements
  • All-fields test demonstrates full UI workflow with plugin configuration (basic-auth)
  • Uses Monaco editor for plugin JSON configuration
  • Follows test patterns from routes, upstreams, and ssls tests
  • Proper cleanup with deleteAllConsumerGroups helper

Closes: #3086

- Add POM file for consumer groups navigation
- Add deleteAllConsumerGroups API function
- Add list page test with pagination
- Add CRUD test with required fields (id + plugins)
- Add CRUD test with all fields including description and basic-auth plugin
- All 5 tests passing
- Update required-fields test to create consumer group through UI
- Add minimal plugin configuration (basic-auth) required by UI
- Remove API-based creation in favor of full UI workflow
@SkyeYoung SkyeYoung changed the title test: add E2E tests for Consumer Groups (#3086) test: add E2E tests for Consumer Groups Nov 21, 2025
@SkyeYoung SkyeYoung merged commit b28b884 into apache:master Nov 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test(resource): consumer groups

3 participants