{
  "product": "WP All Import Pro",
  "tested_version": "5.1.0",
  "format": "MANUAL_REPRODUCTION_SPECIFICATION_NOT_NATIVE_TEMPLATE_IMPORT",
  "fixture": "wpai-functional-20261016",
  "warning": "Use a disposable WordPress installation with a backup. All rows are synthetic. Post IDs shown in results belong to that one test and will differ elsewhere.",
  "files": {
    "baseline.csv": "external_id,title,description,price\nEXT-A,Fixture Alpha,Imported alpha description,10.00\nEXT-B,Fixture Beta,Imported beta description,20.00\nEXT-C,Fixture Gamma,Imported gamma description,30.00\n",
    "selective-update.csv": "external_id,title,description,price\nEXT-A,Fixture Alpha updated,CSV description should not replace manual edit,12.50\nEXT-B,Fixture Beta updated,,\nEXT-C,Fixture Gamma updated,CSV gamma description should remain excluded,30.00\n",
    "bad-target-ids.csv": "target_id,external_id,title,description,price\n-1,BAD-A,Invalid negative target,Must not be inserted,99\n999999999,BAD-B,Missing target,Must not be inserted,99\nnot-an-id,BAD-C,Nonnumeric target,Must not be inserted,99\n"
  },
  "mapping": {
    "post_type": "post",
    "title": "{title[1]}",
    "content": "{description[1]}",
    "unique_key": "catalog-fixture-{external_id[1]}",
    "custom_fields": {
      "_catalog_external_id": "{external_id[1]}",
      "_catalog_price": "{price[1]}",
      "_catalog_fixture": "wpai-functional-20261016"
    }
  },
  "steps": [
    "Import baseline.csv as a new ordinary post import; expect three created records.",
    "Rerun the same saved import job and same file; verify the same three post IDs, zero created, three updated.",
    "Manually change EXT-A post content to MANUAL_DESCRIPTION_MUST_SURVIVE.",
    "Change the saved job to update only Title and custom field _catalog_price; disable Content and other field updates. Replace its source with selective-update.csv; run the same job.",
    "Verify updated titles and prices, unchanged IDs, manual EXT-A content retained, EXT-B price cleared to empty and its original content retained.",
    "Create a separate update-existing-only import with post-ID matching {target_id[1]}, disable create-new-records, use bad-target-ids.csv from persistent uploads storage. The large target ID must not exist on the disposable installation.",
    "Run with logs enabled; require three actual record log sections and counters zero created, zero updated, three skipped, count three, completion flags zero. Verify the earlier three fixture rows remain unchanged."
  ],
  "expected_results": [
    {
      "test": "native_csv_first_import",
      "expected": {
        "rows": 3,
        "created": 3,
        "external_ids": [
          "EXT-A",
          "EXT-B",
          "EXT-C"
        ]
      },
      "observed": {
        "rows": {
          "EXT-A": {
            "ID": 5,
            "title": "Fixture Alpha",
            "description": "Imported alpha description",
            "price": "10.00"
          },
          "EXT-B": {
            "ID": 6,
            "title": "Fixture Beta",
            "description": "Imported beta description",
            "price": "20.00"
          },
          "EXT-C": {
            "ID": 7,
            "title": "Fixture Gamma",
            "description": "Imported gamma description",
            "price": "30.00"
          }
        },
        "created": 3,
        "updated": 0,
        "skipped": 0
      },
      "status": "PASS",
      "limitations": [
        "Synthetic posts and custom fields; WooCommerce product addon is not part of this fixture."
      ]
    },
    {
      "test": "same_csv_reimport_keeps_record_ids",
      "expected": {
        "count": 3,
        "post_ids": [
          5,
          6,
          7
        ],
        "new_posts": 0
      },
      "observed": {
        "count": 3,
        "post_ids": [
          5,
          6,
          7
        ],
        "created": 0,
        "updated": 3,
        "skipped": 0
      },
      "status": "PASS",
      "limitations": [
        "Identity is configured with the external_id unique key; changing that key would change the matching strategy."
      ]
    },
    {
      "test": "selective_update_preserves_manual_description",
      "expected": {
        "EXT-A.title": "Fixture Alpha updated",
        "EXT-A.description": "MANUAL_DESCRIPTION_MUST_SURVIVE",
        "EXT-A.price": "12.50",
        "same_ids": true
      },
      "observed": {
        "EXT-A": {
          "ID": 5,
          "title": "Fixture Alpha updated",
          "description": "MANUAL_DESCRIPTION_MUST_SURVIVE",
          "price": "12.50"
        },
        "EXT-B": {
          "ID": 6,
          "title": "Fixture Beta updated",
          "description": "Imported beta description",
          "price": ""
        },
        "EXT-C": {
          "ID": 7,
          "title": "Fixture Gamma updated",
          "description": "Imported gamma description",
          "price": "30.00"
        }
      },
      "status": "PASS",
      "limitations": [
        "Preservation depends on disabling Content updates; this does not claim all editorial fields are automatically protected."
      ]
    },
    {
      "test": "blank_selected_field_and_unselected_content",
      "expected": {
        "EXT-B.price": "",
        "EXT-B.description": "Imported beta description",
        "count": 3
      },
      "observed": {
        "ID": 6,
        "title": "Fixture Beta updated",
        "description": "Imported beta description",
        "price": ""
      },
      "status": "PASS",
      "limitations": [
        "This fixture selects the price field for update and expects the blank cell to clear it. A keep-existing-on-blank policy needs an additional configuration or filter."
      ]
    },
    {
      "test": "nonexistent_and_invalid_post_ids_do_not_create_posts",
      "expected": {
        "created": 0,
        "updated": 0,
        "skipped": 3,
        "count": 3,
        "unchanged_fixture_rows": true
      },
      "observed": {
        "created": 0,
        "updated": 0,
        "skipped": 3,
        "count": 3,
        "imported": 0,
        "iteration": 1,
        "triggered": 0,
        "processing": 0,
        "executing": 0,
        "rows": {
          "EXT-A": {
            "ID": 5,
            "title": "Fixture Alpha updated",
            "description": "MANUAL_DESCRIPTION_MUST_SURVIVE",
            "price": "12.50"
          },
          "EXT-B": {
            "ID": 6,
            "title": "Fixture Beta updated",
            "description": "Imported beta description",
            "price": ""
          },
          "EXT-C": {
            "ID": 7,
            "title": "Fixture Gamma updated",
            "description": "Imported gamma description",
            "price": "30.00"
          }
        }
      },
      "status": "PASS",
      "limitations": [
        "Update-existing-only mode with post-ID matching is tested; this does not assert duplicate or blank external IDs are automatically validated for new imports."
      ]
    }
  ],
  "limits": [
    "Ordinary synthetic posts and custom fields, not WooCommerce products.",
    "No remote images, cron, external account services, large dataset throughput or 6.x behavior tested.",
    "Same import job and stable unique key tested; not a blanket duplicate/blank identifier guarantee."
  ]
}
