feat(restapi): migrate Katalon ModuleOrders/OrderCreate to pytest#142
Merged
Conversation
Migrates the single REAL Katalon script (OrderCreate/Script1629368773186)
from vc-quality-gate-katalon into the refactored project, expanding the
existing 6-test orders module to 15 tests that mirror the Katalon
end-to-end lifecycle.
Endpoints (all verified from Object Repository .rs files, none guessed):
POST /api/order/customerOrders create
GET /api/order/customerOrders/{id} get by id
GET /api/order/customerOrders/number/{number} get by number
PUT /api/order/customerOrders update
PUT /api/order/customerOrders/recalculate recalculate
DELETE /api/order/customerOrders?ids= delete
POST /api/order/customerOrders/search search
POST /api/order/customerOrders/searchChanges search changes
GET /api/order/customerOrders/{id}/payments/new generate payment
GET /api/order/customerOrders/{id}/shipments/new generate shipment
GET /api/order/customerOrders/{id}/changes changes by id
GET /api/order/customerOrders/indexed/searchEnabled indexed flag
GET /api/order/dashboardStatistics stats
POST /api/order/customerOrders/{id}/processPayment/{paymentId}
Files:
- restapi/operations/order_operations.py (new): OrderOperations class
- restapi/operations/__init__.py: export OrderOperations
- restapi/constants.py: ORDER_TEMPLATE, ORDER_LINE_ITEM_TEMPLATE
- tests/restapi/orders/conftest.py (new): order_ops, seed_order_customer,
make_order(with_item=...) factory with cleanup
- tests/restapi/orders/test_orders.py: rewritten to use ops class +
full lifecycle coverage (payments-new, shipments-new, recalculate,
searchChanges delta, get-by-number, delete-then-search, 64-char limit)
Local result: 14 passed, 1 xfailed, in 27s.
The single xfail (test_order_search_changes_count_grows_after_update)
is environmental: the demo backend writes Order change records
asynchronously with lag exceeding the test runtime (verified empirically
against pre-seeded vs freshly created orders). Endpoint contract is
exercised; xfail strict=False so it XPASSes if change tracking becomes
synchronous.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 the single REAL Katalon script (OrderCreate/Script1629368773186) from vc-quality-gate-katalon into the refactored project, expanding the existing 6-test orders module to 15 tests that mirror the Katalon end-to-end lifecycle.
Endpoints (all verified from Object Repository .rs files, none guessed):
POST /api/order/customerOrders create
GET /api/order/customerOrders/{id} get by id
GET /api/order/customerOrders/number/{number} get by number
PUT /api/order/customerOrders update
PUT /api/order/customerOrders/recalculate recalculate
DELETE /api/order/customerOrders?ids= delete
POST /api/order/customerOrders/search search
POST /api/order/customerOrders/searchChanges search changes
GET /api/order/customerOrders/{id}/payments/new generate payment
GET /api/order/customerOrders/{id}/shipments/new generate shipment
GET /api/order/customerOrders/{id}/changes changes by id
GET /api/order/customerOrders/indexed/searchEnabled indexed flag
GET /api/order/dashboardStatistics stats
POST /api/order/customerOrders/{id}/processPayment/{paymentId}
Files:
Local result: 14 passed, 1 xfailed, in 27s.
The single xfail (test_order_search_changes_count_grows_after_update) is environmental: the demo backend writes Order change records asynchronously with lag exceeding the test runtime (verified empirically against pre-seeded vs freshly created orders). Endpoint contract is exercised; xfail strict=False so it XPASSes if change tracking becomes synchronous.