This brief details a high-level testing strategy for the FoodStuff-NetSuite integration, centered on the end-to-end order processing flow via XML. Testing validates inbound PO creation as SOs, custom record management, script-driven syncing for fulfillments, invoices, and credit memos, plus error handling. Use sandbox environments to simulate XML exchanges, focusing on data mapping accuracy, status updates, and resubmission logic for reliable integration.
Overall Testing Flow
This section outlines the step-by-step technical flow for testing the integration, starting with the primary inbound process from FoodStuff. Since direct PO testing from FoodStuff may not be feasible in all environments, a fallback to standalone SO creation is included. Use sandbox setups to simulate and validate each step, focusing on XML handling, custom record updates, and script executions.
- Primary Inbound Flow: PO from FoodStuff to SO Creation in NetSuite:
- FoodStuff generates and sends a Purchase Order (PO) as an XML file (e.g., via SFTP or API endpoint).
- NetSuite receives the XML, parses it, and validates schema (e.g., required fields like customer ID, items, quantities).
- Match the customer: If the parent customer (e.g., FSSI/FSNI) exists in NetSuite, link to it; otherwise, create a new customer record with mapped details (name, address, etc.).
- Create a Sales Order (SO) in NetSuite from the PO data, populating fields like line items, pricing, and subtotals. Log any parsing errors (e.g., invalid XML) and trigger notifications.
- Verify SO creation: Check for accurate mapping (e.g., XML subtotal matches SO total) and status as “pending fulfillment.”
- Fallback for Testing: Standalone SO Creation in NetSuite:
- As direct PO from FoodStuff may not be testable, manually create a standalone SO in NetSuite with a valid parent customer (e.g., FSSI/FSNI).
- Ensure SO includes test data mimicking PO XML (e.g., items, quantities, customer details) for consistency.
- Testing Methods:
- Manual/Functional Testing: Create SO via NetSuite UI or CSV import; validate against expected PO-like data using custom scripts to compare fields.
- Regression Testing: Re-run after script changes to ensure SO setup doesn’t break downstream flows; automate with Selenium for UI creation.
- Data Validation: Use NetSuite’s SuiteAnalytics to query SO records and confirm parent customer linkage (e.g., FSSI/FSNI).
- Verification: Check SO status and fields match simulated XML inputs; log discrepancies in Jira.
- Scheduled Script Execution:
- Run the “Script Deployment – NetSuite International (Astro Hospitality Ltd | Berica Ltd)” scheduled script.
- The script creates a new custom record linked to the SO (if not already in an existing record), attaching the customer name and SO in the SO field.
- Populate XML Order Message subtotal fields from the XML data; set status to “success” if synced successfully.
- Testing Methods:
- Unit Testing: Test script components (e.g., custom record creation) in NetSuite’s debugger; mock SO inputs with Jest-like assertions for field population.
- Integration Testing: Schedule script runs via NetSuite admin console; monitor logs for custom record creation and status updates.
- Verification: Query custom records post-execution; assert “success” status and XML data integrity using XML validation tools.
- Inbound/Outbound Testing with XML Simulation:
- For in/out validation, copy a sample XML from FoodStuff’s live account.
- Paste it into the custom record’s “API XML Response” field under “FoodStuff eXchange PO API” and save the record to simulate response handling.
- Testing Methods:
- Functional Testing: Manually paste and save XML in UI; validate schema compliance with Oxygen XML Editor.
- End-to-End Testing: Automate XML insertion via NetSuite REST API; simulate full inbound-outbound cycle with mock FoodStuff responses.
- Error Injection: Test with corrupted XML to ensure save failures are handled gracefully.
- Verification: Retrieve record via API and parse XML to confirm details (e.g., PO API fields) match live samples.
- Fulfillment Processing:
- Create one or more Item Fulfillments (IFs) for the attached SO.
- Upon script run, all IFs related to the SO are added to the custom record’s body-level IF field.
- Generate XML for IFs in the “ASN Shipping” sub-tab, including item details and fulfilled quantities; set status to “success” for synced IFs.
- Testing Methods:
- Functional Testing: Create IFs via NetSuite UI or API; run script and check sub-tab population.
- Integration Testing: Use SoapUI to automate IF creation and XML generation; verify multi-IF handling.
- Performance Testing: Simulate high-volume fulfillments (e.g., 50 IFs) with JMeter to test script throughput.
- Verification: Assert XML contents (items, quantities) in ASN sub-tab match IF data; confirm “success” status via record queries.
- Invoice Processing:
- Create an invoice for the SO in the custom record and run the script.
- The invoice links to the custom record, with XML generated in the “INV” sub-tab.
- For multiple invoices on the SO: All are attached, “Partial Invoice” checkbox is checked, but XML upload to FoodStuff fails—status updates to “did not sync as the SO contains multiple invoices.”
- Post-sync: Check “Sync to FoodStuff” checkbox once the invoice is successfully synced.
- Testing Methods:
- Functional Testing: Generate single/multi-invoices via UI; execute script and validate linking/checkbox logic.
- Negative Testing: Force multi-invoice scenarios to test failure status and non-upload behavior.
- Verification: Parse INV sub-tab XML for accuracy (totals, taxes); query records for sync flags.
- Credit Memo Processing:
- If credit memos are created for the invoice, they link to the custom record with XML in the sub-tab and sync status.
- Credit memo XML becomes available in FoodStuff.
- For multiple credit memos: All applied to the invoice are listed in the custom record.
- Testing Methods:
- Functional Testing: Create single/multi-credit memos linked to invoices; run script to check sub-tab and listing.
- Integration Testing: Automate via API to simulate applications; verify XML availability in mock FoodStuff endpoint.
- Edge Case Testing: Test partial applications or invalid memos for error handling.
- Verification: Confirm all memos listed and XML details (e.g., adjustments) match via record exports.
- Error Handling and Resubmission:
- If any XML upload fails, the “Resubmit Acknowledgment” checkbox in the custom record is automatically checked by the script.
- User can edit XML data (e.g., fix mistakes) and save the record.
- On next script run, failed records are reprocessed for syncing with FoodStuff; update status to “Success” and uncheck the resubmit box.
- Testing Methods:
- Verification: Log checkbox states and statuses pre/post-run; assert successful reprocessing via end-to-end traces.
Conclusion
A structured and phased testing approach ensures the technical robustness of the FoodStuff to NetSuite order integration. Focusing on XML validation, accurate data mapping, and reliable round-trip communication helps identify and resolve issues early. Incorporating automation for unit, integration, and end-to-end tests improves efficiency and repeatability, while non-functional tests like performance and security scanning safeguard system stability. Continuous monitoring and thorough documentation will maintain integration quality and support smooth operations.