test: add full-stack Playwright integration test infrastructure
Sprint 12 Phase 2: Real integration tests with seed DB - R__seed_test_data.sql (Flyway repeatable, 7 members, strains, batches, docs, board, events) - TestResetController (profile-gated per-test DB reset) - docker-compose.test.yml (self-contained, tmpfs Postgres) - Dockerfile.playwright (v1.60.0, pre-installed deps) - 13 integration spec files, 70+ test cases (@smoke + @full) - seed-constants.ts, selectors.ts, api-client.ts test helpers
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* Centralized data-testid selectors for integration tests.
|
||||
* Naming convention: <page>-<component>-<identifier>
|
||||
*
|
||||
* Note: The actual data-testid attributes will be added incrementally
|
||||
* to frontend components during Phase 2E as tests are written.
|
||||
*/
|
||||
export const SEL = {
|
||||
// Sidebar / Navigation
|
||||
nav: {
|
||||
sidebar: '[data-testid="nav-sidebar"]',
|
||||
members: '[data-testid="nav-link-members"]',
|
||||
distributions: '[data-testid="nav-link-distributions"]',
|
||||
stock: '[data-testid="nav-link-stock"]',
|
||||
documents: '[data-testid="nav-link-documents"]',
|
||||
board: '[data-testid="nav-link-board"]',
|
||||
calendar: '[data-testid="nav-link-calendar"]',
|
||||
forum: '[data-testid="nav-link-forum"]',
|
||||
grow: '[data-testid="nav-link-grow"]',
|
||||
compliance: '[data-testid="nav-link-compliance"]',
|
||||
},
|
||||
// Members page
|
||||
members: {
|
||||
table: '[data-testid="members-table"]',
|
||||
searchInput: '[data-testid="members-search-input"]',
|
||||
addButton: '[data-testid="members-add-button"]',
|
||||
row: (id: string) => `[data-testid="members-row-${id}"]`,
|
||||
statusBadge: (id: string) => `[data-testid="members-status-${id}"]`,
|
||||
},
|
||||
// Documents page
|
||||
documents: {
|
||||
uploadButton: '[data-testid="documents-upload-button"]',
|
||||
uploadDialog: '[data-testid="documents-upload-dialog"]',
|
||||
titleInput: '[data-testid="documents-title-input"]',
|
||||
categorySelect: '[data-testid="documents-category-select"]',
|
||||
fileInput: '[data-testid="documents-file-input"]',
|
||||
submitUpload: '[data-testid="documents-submit-upload"]',
|
||||
downloadButton: (id: string) => `[data-testid="documents-download-${id}"]`,
|
||||
deleteButton: (id: string) => `[data-testid="documents-delete-${id}"]`,
|
||||
deleteConfirm: '[data-testid="documents-delete-confirm"]',
|
||||
categoryBadge: (category: string) =>
|
||||
`[data-testid="documents-category-${category}"]`,
|
||||
row: (id: string) => `[data-testid="documents-row-${id}"]`,
|
||||
},
|
||||
// Board page
|
||||
board: {
|
||||
createPositionButton: '[data-testid="board-create-position"]',
|
||||
electMemberButton: '[data-testid="board-elect-member"]',
|
||||
removeButton: (id: string) => `[data-testid="board-remove-${id}"]`,
|
||||
positionCard: (id: string) => `[data-testid="board-position-${id}"]`,
|
||||
},
|
||||
// Stock page
|
||||
stock: {
|
||||
addButton: '[data-testid="stock-add-button"]',
|
||||
recallButton: (id: string) => `[data-testid="stock-recall-${id}"]`,
|
||||
table: '[data-testid="stock-table"]',
|
||||
row: (id: string) => `[data-testid="stock-row-${id}"]`,
|
||||
},
|
||||
// Distributions page
|
||||
distributions: {
|
||||
newButton: '[data-testid="distributions-new-button"]',
|
||||
table: '[data-testid="distributions-table"]',
|
||||
row: (id: string) => `[data-testid="distributions-row-${id}"]`,
|
||||
},
|
||||
// Common/shared
|
||||
common: {
|
||||
toast: '[data-testid="toast"]',
|
||||
loadingSkeleton: '[data-testid="loading-skeleton"]',
|
||||
alertDialogConfirm: '[data-testid="alert-dialog-confirm"]',
|
||||
alertDialogCancel: '[data-testid="alert-dialog-cancel"]',
|
||||
},
|
||||
} as const
|
||||
Reference in New Issue
Block a user