From qa-addquote
Add a new quote test scenario to the Karate integration test suite. Works in both RemotePricing2 (RP2) and RemotePricingAPI (RP1). Auto-detects the repo and adapts templates, provider lists, and field options accordingly.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qa-addquote:qa-addquoteThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Run this before any user interaction.** Check for the base template file to determine the repo:
Run this before any user interaction. Check for the base template file to determine the repo:
ls tests/integration/karate/src/test/resources/data/templates/common/ 2>/dev/null
rp2_base_template.json present → RP2 mode (RemotePricing2)
cache, quoteMasterIdrequestBuilderUrl + responseBuilderUrlrp1_base_template.json present → RP1 mode (RemotePricingAPI)
rp1_request_responseuseCallback, callbackTimeout, initialDelay, maxRetries, retryInterval, cacheremotePricingUrlheader Authorization = accessTokenIf neither file found, ask the user which repo/platform they're working in.
Required Fields:
suppliers - Provider name(s) — must match MongoDB provider_credentials.provider_namespeed - Speed specification(s) e.g. 'ETHERNET 100M', 'ETHERNET 1G', 'ALL'testType - 'success' | 'no-coverage' | 'validation-error'environments - Comma-separated envs e.g. 'stage,uat,prod'Validation Fields:
validateRequestedConfig - 'true' (all fields), 'false' (disabled), or specific fields like 'speed,product,accessMedium,term'assertions - Field-level assertions e.g. 'provider=AT&T Wireline; mrc!=0'Product/Service Fields (with defaults):
products - Product type(s) (default: 'Ethernet - Switched')terms - Contract term(s) (default: '12'). Use 'ALL' for 12,24,36,60accessMediums - Access medium(s) (default: 'Fiber')Location Fields (one required):
location - Single address objectlocations - Array of addresses (multi-address)locationA + locationZ - P2P addressesLocation Object Properties:
address, city, state, state_abbv, country, zipCodezipPlus4, county, latitude, longitudesource, rdi, usps_match, time_zone, utc_offsetsecondaryComponents (array with favoriteLocationId)Request Options:
forceFetch - Force fresh fetch, bypass ES cache (default: false)quoteMasterId - Override quote master IDalternativesPolicy - Alternatives policy overrideRP2-only Fields:
useCallback - Use webhook callback instead of polling (default: false)callbackTimeout - Callback timeout in ms (default: 60000)initialDelay - Initial polling delay in ms (default: 8000)maxRetries - Max polling retries (default: global retryCount)retryInterval - Polling interval in ms (default: global retryInterval)cache - Enable response caching (default: false)Provider-Specific:
suppliersApiRequestAttributes - Provider-specific API attributesAsk the user using AskUserQuestion:
Question 1 (header: "API Type")
If LMX Adapter:
features/quote/LMX/ folder* def entityId = lmxEntityId in BackgroundentityId: '#(entityId)'@lmxAsk the user using AskUserQuestion:
Question (header: "Provider")
List available providers by reading the folders in src/test/resources/features/quote/.
RP2 Standard Providers (when in RP2 mode):
RP2 LMX Adapter Providers (in features/quote/LMX/) (RP2 only):
RP1 Providers (when in RP1 mode):
Ask which provider/feature file to add the scenario to, then skip to Step 5.
RP2 mode + LMX Adapter (from Step 1):
features/quote/LMX/ folder{Provider_Name}_DTAG_Quote.featureRP2 Standard / RP1 — Folder question:
Question (header: "Folder")
If "Existing folder": Ask which folder to use. If "New folder": Ask for the new folder name.
Question (header: "File Name")
Then create the folder (if new) and feature file using the appropriate template below.
Feature: {Provider Name} Quote Tests
Testing {Provider Name} integration through RP2
Background:
* url requestBuilderUrl
* def responseBuilderUrl = responseBuilderUrl
# ================================================================================
# Single Address Test Suite
# Use /qa-addquote to add scenarios to this feature file
# ================================================================================
@{provider_tag} @quote
Scenario Outline: {Provider} <scenario> - <speed>
* def suppliers = getValueOrDefault('<suppliers>', '{Default Supplier Name}')
* def products = getValueOrDefault('<products>', '{Default Product}')
* def terms = getValueOrDefault('<terms>', '12')
* def accessMediums = getValueOrDefault('<accessMediums>', 'Fiber')
* def validateRequestedConfig = getValueOrDefault('<validateRequestedConfig>', 'true')
* def location = { address: "<address>", city: "<city>", state: "<state>", country: "<country>", zipCode: "<zipCode>", zipPlus4: "<zipPlus4>", latitude: <latitude>, longitude: <longitude>, county: "<county>" }
* def testData = { suppliers: '#(suppliers)', speed: '<speed>', location: '#(location)', testType: '<testType>', environments: '<environments>', products: '#(products)', terms: '#(terms)', accessMediums: '#(accessMediums)', validateRequestedConfig: '#(validateRequestedConfig)' }
* call read('classpath:helpers/quote_scenario_template.feature') testData
Examples:
| scenario | suppliers | speed | address | city | state | country | zipCode | zipPlus4 | latitude | longitude | county | testType | environments | products | terms | accessMediums | validateRequestedConfig |
Feature: {Provider Name} - DTAG Quote Tests
Testing {Provider Name} - DTAG LMX Adapter integration through RP2
Background:
* url requestBuilderUrl
* def responseBuilderUrl = responseBuilderUrl
* def entityId = lmxEntityId
# ================================================================================
# LMX Adapter Test Suite
# Entity IDs: Stage: 1637, UAT: 6125, Prod: 6125
# Use /qa-addquote to add scenarios to this feature file
# ================================================================================
@lmx @{provider_tag} @quote
Scenario Outline: <scenario>
* def suppliers = getValueOrDefault('<suppliers>', '{Provider Name} - DTAG')
* def products = getValueOrDefault('<products>', 'Dedicated Internet')
* def terms = getValueOrDefault('<terms>', '12')
* def accessMediums = getValueOrDefault('<accessMediums>', 'Fiber')
* def validateRequestedConfig = getValueOrDefault('<validateRequestedConfig>', 'true')
* def location = { address: "<address>", city: "<city>", state: "<state>", country: "<country>", zipCode: "<zipCode>", zipPlus4: "<zipPlus4>", latitude: <latitude>, longitude: <longitude>, county: "<county>" }
* def testData = { suppliers: '#(suppliers)', speed: '<speed>', location: '#(location)', testType: '<testType>', environments: '<environments>', products: '#(products)', terms: '#(terms)', accessMediums: '#(accessMediums)', validateRequestedConfig: '#(validateRequestedConfig)', entityId: '#(entityId)' }
* call read('classpath:helpers/quote_scenario_template.feature') testData
Examples:
| scenario | suppliers | speed | address | city | state | country | zipCode | zipPlus4 | latitude | longitude | county | testType | environments | products | terms | accessMediums | validateRequestedConfig |
Feature: {Provider Name} Quote Tests
Background:
* url remotePricingUrl
# ================================================================================
# Single Address Test Suite
# Use /qa-addquote to add scenarios to this feature file
# ================================================================================
@{provider_tag} @quote
Scenario Outline: {Provider} <scenario> - <speed>
* def suppliers = getValueOrDefault('<suppliers>', '{Default Supplier Name}')
* def products = getValueOrDefault('<products>', 'Ethernet - Switched')
* def terms = getValueOrDefault('<terms>', '12')
* def accessMediums = getValueOrDefault('<accessMediums>', 'Fiber')
* def validateRequestedConfig = getValueOrDefault('<validateRequestedConfig>', 'true')
* def location = { address: "<address>", city: "<city>", state: "<state>", country: "<country>", zipCode: "<zipCode>", zipPlus4: "<zipPlus4>", latitude: <latitude>, longitude: <longitude>, county: "<county>" }
* def testData = { suppliers: '#(suppliers)', speed: '<speed>', location: '#(location)', testType: '<testType>', environments: '<environments>', products: '#(products)', terms: '#(terms)', accessMediums: '#(accessMediums)', validateRequestedConfig: '#(validateRequestedConfig)' }
* call read('classpath:helpers/quote_scenario_template.feature') testData
Examples:
| scenario | suppliers | speed | address | city | state | country | zipCode | zipPlus4 | latitude | longitude | county | testType | environments | products | terms | accessMediums | validateRequestedConfig |
# RP2 — Stage (default)
cd tests/integration/karate
./gradlew test '-Dkarate.options=--tags @{provider_tag} --tags ~@bug --tags ~@uat --tags ~@prod' -Dkarate.mock.callback=false
# RP2 — UAT
./gradlew test '-Dkarate.options=--tags @{provider_tag} --tags ~@bug --tags ~@stage --tags ~@prod' \
-Dkarate.env=uat -Dkarate.scenario.env=uat -Dkarate.mock.callback=false
# RP1 — Stage
cd tests/integration/karate
./gradlew test '-Dkarate.options=--tags @{provider_tag} --tags ~@bug --tags ~@uat --tags ~@prod'
# RP1 — UAT
MYSQL_HOST=$MYSQL_HOST_UAT MYSQL_PASSWORD=$MYSQL_PASSWORD_UAT \
./gradlew test '-Dkarate.options=--tags @{provider_tag} --tags ~@bug --tags ~@stage --tags ~@prod' \
-Dkarate.env=uat -Dkarate.scenario.env=uat
No runner updates needed — the @provider_tag in the feature file determines which tests run.
For providers that need custom polling intervals or other advanced options, add them to testData:
# RP2 — custom polling (for slower APIs)
* def testData = { suppliers: '#(suppliers)', speed: '<speed>', location: '#(location)', testType: '<testType>', environments: '<environments>', retryInterval: 4000, maxRetries: 30 }
# Extended location fields (for providers requiring metadata)
* def location = { address: "<address>", city: "<city>", state: "<state>", state_abbv: "<state_abbv>", country: "<country>", zipCode: "<zipCode>", source: "source_2", rdi: "Commercial", secondaryComponents: [{ secondaryDesignator: '', secondaryNumber: '', favoriteLocationId: 0 }] }
Question (header: "Addresses")
Ask for the address details. User can provide in any format:
Ask how many addresses, then collect them. For multi-address scenarios:
locationGroups definition in the Background section (if not already present)Ask for both A-side and Z-side address details. For P2P scenarios:
p2pLocationPairs definition in the Background section (if not already present)@p2p tagExample P2P Background setup:
* def p2pLocationPairs =
"""
{
"LOCATION_PAIR_NAME": {
"a": { "address": "...", "city": "...", "state": "...", "country": "...", "zipCode": "...", "county": "...", "latitude": 0.0, "longitude": 0.0 },
"z": { "address": "...", "city": "...", "state": "...", "country": "...", "zipCode": "...", "county": "...", "latitude": 0.0, "longitude": 0.0 }
}
}
"""
Some suppliers require API request attributes to be passed with the quote request.
Question (header: "API Attributes")
Collect API request attributes for each product that needs them. Add to Background:
# {Supplier} API request attributes for {Product} product
* def {productVar}ApiRequestAttributes =
"""
[
{
"supplier": {
"name": "{Supplier Name}"
},
"products": [
{
"id": {product_id},
"name": "{Product Name}",
"apiRequestAttributes": {
"{Attribute Name}": {
"selectedValue": "{value}"
}
}
}
]
}
]
"""
Also add suppliersApiRequestAttributes: '#(apiRequestAttrs)' to the testData object.
IMPORTANT: Ask for EVERY scenario — each can have different product/term/access medium.
Read the existing feature file to determine current defaults.
Question (header: "Defaults")
Question (header: "Speed")
Question (header: "Test Type")
Question (header: "Validation")
Question: "Enable strict verification that returned services match your request?"
Options:
"Yes - All fields": set validateRequestedConfig to 'true'
"Yes - Custom fields": set to comma-separated list e.g. 'speed,product'
"No": omit from testData
Question (header: "Environments")
For each address provided:
nullIf any address information cannot be determined exactly, leave those fields blank/null and note in the summary.
Add the new scenario row(s) to the appropriate Examples table:
| {scenario_name} | | {speed} | {address} | {city} | {state} | {country} | {zipCode} | {zipPlus4} | {latitude} | {longitude} | {county} | {testType} | {environments} | {products} | {terms} | {accessMediums} | {validateRequestedConfig} |
validateRequestedConfig empty to use default ('true')'false' for no-coverage tests'speed,product') for custom validationQuestion (header: "Add More")
If "Yes": Return to Step 5.
Provide a summary of ALL scenarios added during this session:
Question (header: "Run Tests")
If "Yes": Execute the appropriate run command and report results.
null for latitude/longitude when not provided (not empty string)Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub connected2fiberteam/cb-qa-claude-plugins --plugin qa-addquote