mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
2253d05618
Remove the nested v3/ subdirectory by moving all active source code, tests, configs, and assets directly to the project root. Archive v2/ (dead code, 847MB) to v2-archive.tar.gz. Key changes: - Move v3/src/ → src/, v3/tests/ → tests/, v3/packages/ → packages/ - Move v3/tsconfig.json, v3/vitest.config.ts to root - Merge v3/package.json into root package.json (ESM, scripts, deps, exports) - Merge v3/scripts/ into scripts/, v3/implementation/ into docs/implementation/ - Update all CI workflows to remove "cd v3 &&" and v3/ path prefixes - Fix all init installer path resolution (3-level-up → 2-level-up) - Fix hooks to use "node ./dist/cli/bundle.js" instead of bare "aqe" - Update settings.json ADR/DDD directories to docs/implementation/ - Fix helper scripts (statusline, adr-compliance, ddd-tracker, guidance-hooks) - Update 58 agent definitions: aqe/v3/ → aqe/ memory namespaces - Update 15 guidance shards: v3/src/ → src/ path references - Fix sync interfaces: remove v3/ and v2/ path references - Fix test path calculations (process.cwd() + '..' no longer needed) - Fix flaky perf test threshold (500ms → 1000ms for CI environments) - Fix complexity-analyzer test to match ADR-051 keyword-based eligibility Build passes, 17,901 tests pass, CLI and MCP bundles verified. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
170 lines
3.8 KiB
TypeScript
170 lines
3.8 KiB
TypeScript
/**
|
|
* Test Data Fixtures for Sauce Demo E2E Tests
|
|
*
|
|
* Generated by: qe-queen-coordinator
|
|
*/
|
|
|
|
export const testData = {
|
|
// Valid test user (for registration tests)
|
|
validUser: {
|
|
firstName: 'Test',
|
|
lastName: 'User',
|
|
email: `test_${Date.now()}@example.com`,
|
|
password: 'TestPassword123!'
|
|
},
|
|
|
|
// Invalid credentials for negative testing
|
|
invalidCredentials: {
|
|
email: 'invalid@nonexistent.com',
|
|
password: 'WrongPassword123!'
|
|
},
|
|
|
|
// Products from the catalog
|
|
products: {
|
|
greyJacket: {
|
|
name: 'Grey jacket',
|
|
slug: 'grey-jacket',
|
|
price: '55.00',
|
|
currency: 'GBP'
|
|
},
|
|
noirJacket: {
|
|
name: 'Noir jacket',
|
|
slug: 'noir-jacket',
|
|
price: '60.00',
|
|
currency: 'GBP'
|
|
},
|
|
stripedTop: {
|
|
name: 'Striped top',
|
|
slug: 'striped-top',
|
|
price: '50.00',
|
|
currency: 'GBP'
|
|
},
|
|
blackHeels: {
|
|
name: 'Black heels',
|
|
slug: 'black-heels',
|
|
price: '45.00',
|
|
currency: 'GBP'
|
|
},
|
|
bronzeSandals: {
|
|
name: 'Bronze sandals',
|
|
slug: 'bronze-sandals',
|
|
price: '39.99',
|
|
currency: 'GBP'
|
|
}
|
|
},
|
|
|
|
// Shipping address for checkout
|
|
shippingAddress: {
|
|
uk: {
|
|
firstName: 'Test',
|
|
lastName: 'Customer',
|
|
address1: '123 Test Street',
|
|
address2: 'Apt 4B',
|
|
city: 'London',
|
|
country: 'United Kingdom',
|
|
state: 'Greater London',
|
|
zip: 'SW1A 1AA'
|
|
},
|
|
us: {
|
|
firstName: 'Test',
|
|
lastName: 'Customer',
|
|
address1: '456 Main Street',
|
|
address2: 'Suite 100',
|
|
city: 'New York',
|
|
country: 'United States',
|
|
state: 'New York',
|
|
zip: '10001'
|
|
}
|
|
},
|
|
|
|
// Test payment card (Shopify test mode)
|
|
testPaymentCard: {
|
|
success: {
|
|
number: '4242424242424242',
|
|
expiry: '12/25',
|
|
cvv: '123',
|
|
name: 'Test Customer'
|
|
},
|
|
declined: {
|
|
number: '4000000000000002',
|
|
expiry: '12/25',
|
|
cvv: '123',
|
|
name: 'Test Customer'
|
|
}
|
|
},
|
|
|
|
// Promo codes for testing
|
|
promoCodes: {
|
|
valid: 'TESTCODE10',
|
|
invalid: 'INVALIDCODE',
|
|
expired: 'EXPIRED2024'
|
|
},
|
|
|
|
// Search queries
|
|
searchQueries: {
|
|
validProduct: 'jacket',
|
|
noResults: 'xyznonexistent123',
|
|
partialMatch: 'grey',
|
|
multipleResults: 'sandals'
|
|
},
|
|
|
|
// XSS payloads for security testing
|
|
securityPayloads: {
|
|
xss: {
|
|
scriptTag: '<script>alert("xss")</script>',
|
|
imgOnerror: '<img src=x onerror=alert("xss")>',
|
|
svgOnload: '<svg onload=alert("xss")>',
|
|
eventHandler: '" onmouseover="alert(\'xss\')"',
|
|
urlEncodedScript: '%3Cscript%3Ealert(%22xss%22)%3C%2Fscript%3E'
|
|
},
|
|
sqlInjection: {
|
|
basic: "' OR '1'='1",
|
|
union: "' UNION SELECT * FROM users --",
|
|
dropTable: "'; DROP TABLE users; --"
|
|
}
|
|
},
|
|
|
|
// Expected page titles/URLs
|
|
expectedUrls: {
|
|
home: '/',
|
|
catalog: '/collections/all',
|
|
cart: '/cart',
|
|
login: '/account/login',
|
|
register: '/account/register',
|
|
search: '/search',
|
|
checkout: '/checkouts/'
|
|
},
|
|
|
|
// Timeouts for different operations
|
|
timeouts: {
|
|
navigation: 30000,
|
|
ajax: 10000,
|
|
animation: 1000,
|
|
checkout: 60000
|
|
}
|
|
};
|
|
|
|
/**
|
|
* Generate unique email for registration tests
|
|
*/
|
|
export function generateUniqueEmail(): string {
|
|
return `test_user_${Date.now()}_${Math.random().toString(36).substr(2, 5)}@example.com`;
|
|
}
|
|
|
|
/**
|
|
* Generate random string for testing
|
|
*/
|
|
export function generateRandomString(length: number = 10): string {
|
|
return Math.random().toString(36).substr(2, length);
|
|
}
|
|
|
|
/**
|
|
* Format currency amount
|
|
*/
|
|
export function formatPrice(amount: number, currency: string = 'GBP'): string {
|
|
return new Intl.NumberFormat('en-GB', {
|
|
style: 'currency',
|
|
currency
|
|
}).format(amount);
|
|
}
|