Skip to content

test(FR-2652): add E2E tests for admin model card deletion with folder option#6887

Open
agatha197 wants to merge 3 commits into04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_cardfrom
04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option
Open

test(FR-2652): add E2E tests for admin model card deletion with folder option#6887
agatha197 wants to merge 3 commits into04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_cardfrom
04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option

Conversation

@agatha197
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 commented Apr 22, 2026

Resolves #6885 (FR-2652)

Stacked on top of #6888.

Summary

Adds Playwright E2E tests covering the admin model card deletion flow introduced in FR-2622, including the new "Also delete the associated model folder" option.

Tests added (e2e/admin-model-card/admin-model-card-delete.spec.ts):

  • 5.1 Delete a model card via trash icon with confirmation (folder kept)
  • 5.2 Cancel single-delete confirmation — card remains
  • 5.3 Bulk-delete multiple model cards
  • 5.4 Cancel bulk deletion — cards remain
  • 5.5 Clear selection using the BAISelectionLabel clear button
  • 5.6 Select all model cards using the header checkbox
  • 5.7 Delete model card + folder together → notification "Model card and folder have been moved to trash" → "Go to Data > Trash" navigates to /data?statusCategory=deleted&filter=name == "<folder>"
  • 5.8 Delete model card only → notification "Model card has been deleted. The model folder was not deleted." → "Go to Data > Trash" navigates to /data?statusCategory=deleted (no folder filter)

POM updates (e2e/utils/classes/AdminModelCardPage.ts):

  • createNewFolderViaPlus(): robust handling of the "Change Project" Popconfirm — checks for the button sequentially (5 s timeout) instead of using Promise.race, which had a race condition causing the click to be missed.
  • Added getAlsoDeleteFolderCheckbox() and getFolderNameLinkInDeleteDialog() locators.

Each test creates its own dedicated folder via the "+" button and fully cleans up after itself (moves folder to trash → permanently deletes), leaving no side effects.

Copy link
Copy Markdown
Contributor Author

agatha197 commented Apr 22, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@agatha197 agatha197 changed the base branch from 04-22-chore_fr-2622_add_i18n_translations_for_delete-folder_option to graphite-base/6887 April 22, 2026 08:18
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from de2b083 to 57e9104 Compare April 22, 2026 08:19
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from 57e9104 to b9c18ca Compare April 22, 2026 08:24
@agatha197 agatha197 changed the base branch from graphite-base/6887 to 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card April 22, 2026 08:24
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch 10 times, most recently from c4c949d to daf4605 Compare April 22, 2026 10:11
@agatha197 agatha197 marked this pull request as ready for review April 22, 2026 10:15
Copilot AI review requested due to automatic review settings April 22, 2026 10:16
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

Adds Playwright E2E coverage for the Admin Model Store deletion flow when a model card has an associated model folder, including the “also delete folder” checkbox behavior and the “Go to Data > Trash” navigation outcomes. This extends the existing Admin Model Card delete suite and updates shared E2E helpers/coverage tracking accordingly.

Changes:

  • Extend Admin Model Card POM to support creating a new model folder via the “+” button and to expose delete-dialog locators (checkbox + folder link).
  • Expand admin-model-card-delete.spec.ts to create dedicated folders for test isolation, add new delete-with-folder / navigation assertions, and add folder cleanup via /admin-data.
  • Generalize vfolder helper utilities to support both /data and /admin-data, and update the E2E coverage report totals/features.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
e2e/utils/test-util.ts Adds optional dataPath argument to vfolder helpers so tests can operate on /data vs /admin-data.
e2e/utils/classes/AdminModelCardPage.ts Adds folder-create flow via “+” and delete-dialog helpers; updates create modal filling logic and access-level selection.
e2e/admin-model-card/admin-model-card-delete.spec.ts Adds/updates delete scenarios to cover “delete card + folder”, “delete card only”, “Go to Trash” navigation checks, and folder cleanup.
e2e/E2E_COVERAGE_REPORT.md Updates “Last Updated” date and Admin Model Store feature counts to reflect the new coverage.

Comment thread e2e/utils/classes/AdminModelCardPage.ts Outdated
Comment thread e2e/utils/classes/AdminModelCardPage.ts
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

  26 failed
    [chromium] › e2e/admin-model-card/admin-model-card-create.spec.ts:16:9 › Admin Model Card Management - Create › Superadmin can open the Create Model Card modal @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-create.spec.ts:79:9 › Admin Model Card Management - Create › Superadmin can create a model card with only required fields @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-create.spec.ts:139:9 › Admin Model Card Management - Create › Superadmin can create a model card with all fields populated @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-create.spec.ts:238:9 › Admin Model Card Management - Create › Superadmin cannot create a model card without a Name @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-delete.spec.ts:23:9 › Admin Model Card Management - Delete › Superadmin can delete a model card via the trash icon with confirmation @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-delete.spec.ts:89:9 › Admin Model Card Management - Delete › Superadmin can cancel a single-delete confirmation without deleting @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-delete.spec.ts:130:9 › Admin Model Card Management - Delete › Superadmin can select multiple model cards and delete them in bulk @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-delete.spec.ts:212:9 › Admin Model Card Management - Delete › Superadmin can cancel bulk deletion @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-delete.spec.ts:277:9 › Admin Model Card Management - Delete › Superadmin can clear selection using the BAISelectionLabel clear button @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-delete.spec.ts:328:9 › Admin Model Card Management - Delete › Superadmin can select all model cards on the current page using the header checkbox @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-delete.spec.ts:372:9 › Admin Model Card Management - Delete › Superadmin can delete a model card and its associated folder, and navigate to trash with folder filter @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-delete.spec.ts:440:9 › Admin Model Card Management - Delete › Superadmin can delete a model card only and navigate to trash without folder filter @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-edit.spec.ts:79:9 › Admin Model Card Management - Edit › Superadmin can open the Edit Model Card modal from a table row @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-edit.spec.ts:121:9 › Admin Model Card Management - Edit › Superadmin can update a model card's metadata fields @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-edit.spec.ts:183:9 › Admin Model Card Management - Edit › Superadmin cannot save an edit when the Name field is cleared @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-edit.spec.ts:222:9 › Admin Model Card Management - Edit › Superadmin can cancel the Edit modal without saving changes @admin-model-card @admin @crud 
    [chromium] › e2e/admin-model-card/admin-model-card-filter.spec.ts:16:9 › Admin Model Card Management - Filtering › Superadmin can filter model cards by name using BAIGraphQLPropertyFilter @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-filter.spec.ts:53:9 › Admin Model Card Management - Filtering › Superadmin can clear a filter to restore the full list @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-page-load.spec.ts:63:9 › Admin Model Card Management - Page Load and Table Display › Superadmin can see model card rows with correct data in the table @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-sort-refresh.spec.ts:16:9 › Admin Model Card Management - Refresh and Sorting › Superadmin can refresh the table using the fetch key button @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-sort-refresh.spec.ts:32:9 › Admin Model Card Management - Refresh and Sorting › Superadmin can sort model cards by Name in ascending order @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-sort-refresh.spec.ts:54:9 › Admin Model Card Management - Refresh and Sorting › Superadmin can sort model cards by Name in descending order @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-sort-refresh.spec.ts:74:9 › Admin Model Card Management - Refresh and Sorting › Superadmin can sort model cards by Created At @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-sort-refresh.spec.ts:97:9 › Admin Model Card Management - Refresh and Sorting › Superadmin can switch sort from Name to Created At @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-url-state.spec.ts:16:9 › Admin Model Card Management - URL State Persistence › Superadmin can persist filter state in the URL query parameters @admin-model-card @admin @functional 
    [chromium] › e2e/admin-model-card/admin-model-card-url-state.spec.ts:62:9 › Admin Model Card Management - URL State Persistence › Superadmin can persist sort order in the URL query parameters @admin-model-card @admin @functional 

The test case fails. I tested it on 10.122.10.107 server.

@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from 444c84b to d223d37 Compare April 23, 2026 11:49
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from cbbfe8a to 1fc2c72 Compare April 23, 2026 11:49
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from d223d37 to aa7fa8e Compare April 24, 2026 05:05
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch 2 times, most recently from 8754cc8 to e1462dc Compare April 24, 2026 05:09
@agatha197
Copy link
Copy Markdown
Contributor Author

Addressed feedback from @ironAiken2: the 26 failing tests were caused by requireConfirmInput added to the single-delete modal in the base PR (#6881). The single-delete dialog now requires the user to type the card name before the Delete button is enabled, but the POM's deleteModelCardByName helper and the direct delete steps in tests 5.1, 5.7, and 5.8 were not yet updated for this change.

Fixed by:

  • Adding getDeleteConfirmInput() locator to the POM
  • Updating deleteModelCardByName to fill the confirmation text input with the card name before clicking Delete
  • Adding the same fill step inline to tests 5.1, 5.7, and 5.8 where the deletion is done directly

@agatha197 agatha197 requested a review from ironAiken2 April 24, 2026 05:10
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from e1462dc to a8851e1 Compare April 24, 2026 05:16
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from aa7fa8e to 342c0ad Compare April 24, 2026 05:16
@github-actions github-actions Bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels Apr 24, 2026
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from 342c0ad to 00a4c36 Compare April 24, 2026 07:53
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from a8851e1 to 2762f32 Compare April 24, 2026 07:53
@agatha197 agatha197 requested a review from yomybaby April 24, 2026 08:07
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

E2E_WEBSERVER_ENDPOINT=http://10.122.10.107:8090 I ran the tests above, but almost all of them failed.

@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from 5acc0a4 to a461f34 Compare April 28, 2026 06:45
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from 00a4c36 to 3b46628 Compare April 28, 2026 06:45
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from a461f34 to f598b53 Compare April 28, 2026 07:56
…r option

- Add tests 5.7 and 5.8 to admin-model-card-delete.spec.ts
  - 5.7: delete model card + folder together, verify notification and Go to Trash URL with folder filter
  - 5.8: delete model card only, verify notification and Go to Trash URL without filter
- Add getAlsoDeleteFolderCheckbox() and getFolderNameLinkInDeleteDialog() to AdminModelCardPage POM
- Update E2E_COVERAGE_REPORT.md: Admin Model Store 22→26 features covered
@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from f598b53 to 5fa0945 Compare April 28, 2026 08:00
@agatha197 agatha197 force-pushed the 04-22-fix_fr-2651_list_all_model-store_folders_when_creating_a_model_card branch from 3b46628 to fd4eab0 Compare April 28, 2026 08:00
@agatha197 agatha197 requested a review from ironAiken2 April 28, 2026 08:03
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 left a comment

Choose a reason for hiding this comment

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

Error: locator.fill: Test timeout of 180000ms exceeded.
Call log:

  • waiting for getByRole('dialog', { name: 'Delete Model Cards' }).getByLabel(/Type.*to confirm/i)

    at e2e/admin-model-card/admin-model-card-delete.spec.ts:241:56

Could you check this one?

@agatha197 agatha197 force-pushed the 04-22-test_fr-2652_add_e2e_tests_for_admin_model_card_deletion_with_folder_option branch from 5fa0945 to a6ec9e4 Compare April 28, 2026 10:45
@github-actions
Copy link
Copy Markdown
Contributor

Coverage report for ./packages/backend.ai-ui

St.
Category Percentage Covered / Total
🟢 Statements 81.87% 429/524
🟡 Branches 70.43% 362/514
🟡 Functions 76.86% 93/121
🟢 Lines 83.19% 391/470

Test suite run success

319 tests passing in 13 suites.

Report generated by 🧪jest coverage report action from a6ec9e4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants