feat(restapi): migrate Katalon ModuleContent to pytest#143
Merged
Conversation
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>
REST API Test Results290 tests 288 ✅ 26s ⏱️ Results for commit 9e82338. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.