Skip to content

feat(restapi): migrate Katalon ModuleContent to pytest#143

Merged
Lenajava1 merged 1 commit into
devfrom
vcst-migrate-katalon-content
Apr 17, 2026
Merged

feat(restapi): migrate Katalon ModuleContent to pytest#143
Lenajava1 merged 1 commit into
devfrom
vcst-migrate-katalon-content

Conversation

@Lenajava1
Copy link
Copy Markdown
Collaborator

Migrates all 7 REAL Katalon scripts in ModuleContent (Blog, Menu, NameValidation, Pages, Theme, ThemeUpload, UploadBlacklistCheck) into the refactored project. Replaces the previous thin smoke-tests with full lifecycle coverage backed by typed Operations classes.

Endpoints (all verified from .rs files; no guessing):
GET /api/content/{storeId}/stats
POST /api/content/{type}/{storeId}/folder
POST /api/content/{type}/{storeId}?folderUrl= (multipart)
GET /api/content/{type}/{storeId}?relativeUrl=
GET /api/content/{type}/{storeId}/search?keyword=
GET /api/content/{type}/{storeId}/move?oldUrl=&newUrl= (yes, GET)
GET /api/content/{type}/{storeId}/unpack?archivePath=&destPath=
DELETE /api/content/{type}/{storeId}?urls=
GET /api/cms/{storeId}/menu
GET /api/cms/{storeId}/menu/{listId}
POST /api/cms/{storeId}/menu
DELETE /api/cms/{storeId}/menu?ids= (NB: .rs file says ?listIds= but
the platform returns 500 — use ?ids=)
GET /api/cms/{storeId}/menu/checkname?name=&language=

Files:

  • restapi/operations/cms_content_operations.py (new): CmsContentOperations
    • MenuLinkOperations
  • restapi/operations/init.py: export both
  • tests/restapi/content/conftest.py (new): cms_content_ops, menu_ops, store_id, make_content_folder, make_menu_link_list, ensure_exe_in_blacklist (session-scoped, mutates settings — for serial tests)
  • tests/restapi/content/test_content.py: rewritten with 7 lifecycle tests
    • parametrized name-validation (4 cases) and blacklist-rejection (3 cases)

Local result: 14 passed, 1 skipped, 1 xfailed in 11s.

The skip is test_theme_zip_upload_and_unpack — needs a real .zip fixture with a known internal file (Katalon shipped qwetheme_test_x.zip).

The xfail is test_menu_lifecycle: DELETE /api/cms/{store}/menu is a silent no-op on vcptcore-demo (?ids= returns 204 without removing; ?listIds= per the .rs file returns 500 NPE). All other lifecycle steps (checkname, create, get-by-id, rename) succeed; xfail strict=False so it XPASSes if the backend is fixed.

Migrates all 7 REAL Katalon scripts in ModuleContent (Blog, Menu,
NameValidation, Pages, Theme, ThemeUpload, UploadBlacklistCheck) into
the refactored project. Replaces the previous thin smoke-tests with
full lifecycle coverage backed by typed Operations classes.

Endpoints (all verified from .rs files; no guessing):
  GET    /api/content/{storeId}/stats
  POST   /api/content/{type}/{storeId}/folder
  POST   /api/content/{type}/{storeId}?folderUrl= (multipart)
  GET    /api/content/{type}/{storeId}?relativeUrl=
  GET    /api/content/{type}/{storeId}/search?keyword=
  GET    /api/content/{type}/{storeId}/move?oldUrl=&newUrl=  (yes, GET)
  GET    /api/content/{type}/{storeId}/unpack?archivePath=&destPath=
  DELETE /api/content/{type}/{storeId}?urls=
  GET    /api/cms/{storeId}/menu
  GET    /api/cms/{storeId}/menu/{listId}
  POST   /api/cms/{storeId}/menu
  DELETE /api/cms/{storeId}/menu?ids=    (NB: .rs file says ?listIds= but
                                          the platform returns 500 — use ?ids=)
  GET    /api/cms/{storeId}/menu/checkname?name=&language=

Files:
- restapi/operations/cms_content_operations.py (new): CmsContentOperations
  + MenuLinkOperations
- restapi/operations/__init__.py: export both
- tests/restapi/content/conftest.py (new): cms_content_ops, menu_ops,
  store_id, make_content_folder, make_menu_link_list, ensure_exe_in_blacklist
  (session-scoped, mutates settings — for serial tests)
- tests/restapi/content/test_content.py: rewritten with 7 lifecycle tests
  + parametrized name-validation (4 cases) and blacklist-rejection (3 cases)

Local result: 14 passed, 1 skipped, 1 xfailed in 11s.

The skip is test_theme_zip_upload_and_unpack — needs a real .zip fixture
with a known internal file (Katalon shipped qwetheme_test_x.zip).

The xfail is test_menu_lifecycle: DELETE /api/cms/{store}/menu is a silent
no-op on vcptcore-demo (?ids= returns 204 without removing; ?listIds= per
the .rs file returns 500 NPE). All other lifecycle steps (checkname,
create, get-by-id, rename) succeed; xfail strict=False so it XPASSes if
the backend is fixed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

REST API Test Results

290 tests   288 ✅  26s ⏱️
  4 suites    2 💤
  4 files      0 ❌

Results for commit 9e82338.

@Lenajava1 Lenajava1 merged commit 9bda4ea into dev Apr 17, 2026
3 checks passed
@Lenajava1 Lenajava1 deleted the vcst-migrate-katalon-content branch April 29, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant