Skip to content

Instantly share code, notes, and snippets.

@fabrizioc1
Created January 13, 2012 00:47
Show Gist options
  • Save fabrizioc1/1604056 to your computer and use it in GitHub Desktop.
Save fabrizioc1/1604056 to your computer and use it in GitHub Desktop.
CTO cache invalidation
@MQC9056 @inventory @invalidation
Feature: Inventory Cache Invalidation
As a SonyStyle user
In order to place an order for a product
SonyStyle must display accurate inventory information.
# This is to make sure an invalidation is only trigged when a product becomes in stock or goes out of stock
# SPEC00090005226 = "Intel Core i7-2630QM quad-core processor (2.0GHz) with Turbo Boost up to 2.90GHz"
Scenario: US CTO component in stock changes quantity and remains in stock
Given we will receive a "GCTO" inventory feed
And component "SPEC00090005226" has a quantity of "150" available on "8/8/2011 12:00 AM" for "US" PBOM "SERIE0000000367" in the database
And component "SPEC00090005226" has a quantity of "250" available on "8/8/2011 12:00 AM" for "US" PBOM "SERIE0000000367" in the feed
And component "SPEC00090005226" is shown as "In Stock" in the "US" page for "US-VPCL2190X-LBOM"
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "0" cache invalidations
And component "SPEC00090005226" should be shown as "In Stock" in the "US" page for "US-VPCL2190X-LBOM"
# This is a test to make sure only one invalidation is generated for multiple inventory updates for the same cache key (sku,region,pbom)
Scenario: US CTO component out of stock get multiple inventory record updates
Given we will receive a "GCTO" inventory feed
And component "SPEC00090005226" is shown as "Out Of Stock" in the "US" page for "US-VPCL2190X-LBOM"
And component "SPEC00090005226" has a quantity of "300" available on "Aug 1 2011" for "US" PBOM "SERIE0000000367" in the feed
And component "SPEC00090005226" has a quantity of "200" available on "Aug 8 2011" for "US" PBOM "SERIE0000000367" in the feed
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "1" cache invalidation
And the cache invalidations should include "INV:productId:8198552921666298190:SERIE0000000367:US"
And component "SPEC00090005226" should be shown as "In Stock" in the "US" page for "US-VPCL2190X-LBOM"
# ESD has to be set on the earliest available inventory for the default component for the target option class
# SPEC00090005069 = "i5-2410M processor (2.30GHz) with Turbo Boost up to 2.90GH" (default processor selected)
Scenario: US CTO component changes ESD for PBOM
Given we will receive a "GCTO" inventory feed
And the ESD is shown as "Aug 22 2011" in the "US" page for "US-VPCL2190X-LBOM"
And component "SPEC00090005069" has a ESD of "Aug 25 2011" available on "Aug 1 2011" for "US" PBOM "SERIE0000000367" in the feed
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "1" cache invalidation
And the cache invalidation should be "INV:productId:8198552921666300805:SERIE0000000367:US"
And the ESD should be shown as "Aug 25 2011" in the "US" page for "US-VPCL2190X-LBOM"
Scenario: US CTO shared component out of stock for 2 PBOMs becomes in stock for only one PBOM
Given we will receive a "GCTO" inventory feed
And component "SPEC00090005226" is shown as "Out Of Stock" in the "US" page for "US-VPCL2190X-LBOM"
And component "SPEC00090005226" is shown as "Out Of Stock" in the "US" page for "US-VPCF2190X-LBOM"
And component "SPEC00090005226" has a quantity of "200" available on "Aug 8 2011" for "US" PBOM "SERIE0000000367" in the feed
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "1" cache invalidation
And the cache invalidation should be "INV:productId:8198552921666298190:SERIE0000000367:US"
And component "SPEC00090005226" should be shown as "In Stock" in the "US" page for "US-VPCL2190X-LBOM"
And component "SPEC00090005226" should be shown as "Out Of Stock" in the "US" page for "US-VPCF2190X-LBOM"
Scenario: US CTO shared component out of stock for 2 PBOMs becomes in stock for both PBOMs
Given we will receive a "GCTO" inventory feed
And component "SPEC00090005226" is shown as "Out Of Stock" in the "US" page for "US-VPCL2190X-LBOM"
And component "SPEC00090005226" is shown as "Out Of Stock" in the "US" page for "US-VPCF2190X-LBOM"
And component "SPEC00090005226" has a quantity of "200" available on "Aug 8 2011" for "US" PBOM "SERIE0000000367" in the feed
And component "SPEC00090005226" has a quantity of "100" available on "Aug 1 2011" for "US" PBOM "SERIE0000000376" in the feed
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "2" cache invalidations
And the cache invalidations should include "INV:productId:8198552921666298190:SERIE0000000367:US"
And the cache invalidations should include "INV:productId:8198552921666298190:SERIE0000000376:US"
And component "SPEC00090005226" should be shown as "In Stock" in the "US" page for "US-VPCL2190X-LBOM"
And component "SPEC00090005226" should be shown as "In Stock" in the "US" page for "US-VPCF2190X-LBOM"
# SPEC00090005075 = "Intel; Core; i5-2410M processor (2.30GHz) with Turbo Boost up to 2.90GHz"
Scenario: Canada CTO component out of stock becomes in stock using inventory from the "PA" region
Given we will receive a "GCTO" inventory feed
And component "SPEC00090005075" is shown as "Out Of Stock" in the "CA" page for "CA-VPCSB290S-LBOM"
And component "SPEC00090005075" has a quantity of "300" available on "Aug 1 2011" for PBOM "SKU002000016163" and region "PA" in the feed
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "1" cache invalidation
And the cache invalidations should include "INV:productId:8198552921666303661:SKU002000016163:PA"
And component "SPEC00090005075" should be shown as "In Stock" in the "CA" page for "CA-VPCSB290S-LBOM"
Scenario: Canada CTO component out of stock becomes in stock using inventory from the "CA" region
Given we will receive a "GCTO" inventory feed
And component "SPEC00090005075" is shown as "Out Of Stock" in the "CA" page for "CA-VPCSB290S-LBOM"
And component "SPEC00090005075" has new feed quantity of "300" available on "Aug 1 2011" for PBOM "SKU002000016163" and region "CA" with ESD "Aug 22 2011"
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "1" cache invalidation
And the cache invalidations should include "INV:productId:8198552921666303661:SKU002000016163:CA"
And component "SPEC00090005075" should be shown as "In Stock" in the "CA" page for "CA-VPCSB290S-LBOM"
# Changes for Non-CTO products
Scenario: US regular product goes out of stock and becomes in stock
Given we will receive a "SAP_SEL" inventory feed
And product "DSCTX10" is shown as "Out Of Stock" in the "US" store product page
And product "DSCTX10" has a quantity of "42" available on "Aug 10 2011" for the "US" region
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "1" cache invalidation
And the cache invalidations should include "INV:productId:8198552921666290114:US"
And product "DSCTX10" should be shown as "In Stock" in the "US" store product page
Scenario: CA regular product goes out of stock and becomes in stock
Given we will receive a "SOCAN" inventory feed
And product "DSCTX10" is shown as "Out Of Stock" in the "CA" store product page
And product "DSCTX10" has a quantity of "24" available on "Aug 10 2011" for the "CA" region
And the inventory feed process is running
And the inventory feed file is in the pending directory
When the "Inventory Feed" job finished running successfully
And the "DynaCache Invalidation" job finished running successfully
Then there should be "1" cache invalidation
And the cache invalidations should include "INV:productId:8198552921666290114:CA"
And product "DSCTX10" should be shown as "In Stock" in the "CA" store product page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment