Skip to content
Open
Show file tree
Hide file tree
Changes from 184 commits
Commits
Show all changes
191 commits
Select commit Hold shift + click to select a range
d9d832d
Add make api utilities for generating code from openapi spec file as …
enriqueb-nortal Aug 20, 2025
5848183
Move the python files around
stegbk Aug 20, 2025
2add880
Add families to spec
stegbk Aug 21, 2025
b03baed
Fixed Python code moving
enriqueb-nortal Aug 21, 2025
a6ecb50
Leaving backend/api/generated/app/ empty
enriqueb-nortal Aug 21, 2025
9c27e6e
Merge pull request #2 from nortal/PR003946-19
enriqueb-nortal Aug 21, 2025
720b943
Merge branch 'PR003946-19' into kcs/update_spec_with_families
enriqueb-nortal Aug 21, 2025
ef4fdc2
Move family spec to correct location
stegbk Aug 21, 2025
7f5215c
Merge pull request #3 from nortal/kcs/update_spec_with_families
enriqueb-nortal Aug 21, 2025
d58fe81
Need to update user module and openapi.spec for this (#5)
stegbk Aug 22, 2025
fbd3410
Enriqueb/family endpoint impl (#6)
enriqueb-nortal Aug 29, 2025
ed5bf66
Family endpoints - PynamoDB implementation
enriqueb-nortal Sep 1, 2025
7dacc4f
Cloudformation templates PR003946-20 (#4)
iris-nortal Sep 2, 2025
9598c92
Family endpoints - PynamoDB implementation (#7)
enriqueb-nortal Sep 2, 2025
64de327
Merge remote-tracking branch 'origin/dev' into enriqueb/family/pynamo…
enriqueb-nortal Sep 2, 2025
73c579f
Adds userId as a GSI on userDetails
enriqueb-nortal Sep 2, 2025
038083e
doc(cloudformation/backend): update deployment instructions
iris-nortal Sep 3, 2025
3fab025
Implements endpoints from admin controller
enriqueb-nortal Sep 4, 2025
962bfab
Add React frontend with role-based navigation and animal configuration
stegbk Sep 7, 2025
5f0d025
Fix authentication and add demo guide with security improvements
stegbk Sep 7, 2025
bab4e05
Merge pull request #8 from nortal/enriqueb/userdetails/adds-userId-gsi
iris-nortal Sep 8, 2025
f400eef
Merge pull request #9 from nortal/enriqueb/admin/endpoints-implementa…
stegbk Sep 8, 2025
42dd2d4
feat: Add AWS Cognito authentication system for CMZ Chatbot Platform
stegbk Sep 8, 2025
d7a0ede
feat: Complete Cognito authentication controller integration
stegbk Sep 9, 2025
7232b3b
Merge pull request #12 from nortal/kcs/cognito-authentication
stegbk Sep 9, 2025
154e2a7
Add React frontend with role-based navigation and animal configuration
stegbk Sep 7, 2025
9ba179c
Merge pull request #10 from nortal/kcs/frontend-ui-system
stegbk Sep 9, 2025
e4efabd
feat: Complete Animals endpoints with hexagonal architecture and full…
stegbk Sep 9, 2025
2eb74c0
Fix security scan configuration for GitHub Actions
stegbk Sep 9, 2025
6d01c68
Fix TruffleHog secrets scanning configuration
stegbk Sep 9, 2025
3a2b633
Fix shell injection vulnerabilities in DAST workflow
stegbk Sep 9, 2025
4fb8b1f
Fix remaining security scan issues
stegbk Sep 9, 2025
6f7f239
Fix security workflow issues
stegbk Sep 9, 2025
ff2f0da
Fix remaining shellcheck errors in security workflows
stegbk Sep 9, 2025
089176b
Fix shell injection vulnerability in DAST workflow
stegbk Sep 9, 2025
55d3a9b
Fix multiple shell injection vulnerabilities in GitHub Actions workflows
stegbk Sep 9, 2025
64cbf7e
Disable GitGuardian secrets scan due to API key configuration issue
stegbk Sep 9, 2025
0521809
Temporarily disable CodeQL scanning to resolve workflow failures
stegbk Sep 9, 2025
30a3e3c
Merge pull request #11 from nortal/kcs/hexagonal-architecture
stegbk Sep 9, 2025
72e7f86
Implement frontend-backend API integration for CMZ Animal Configuration
stegbk Sep 9, 2025
5f226cf
Fix unused imports in animals_controller.py
stegbk Sep 9, 2025
c0b7f68
Improve API service security configuration
stegbk Sep 9, 2025
62731a4
Implement Copilot-style code quality improvements
stegbk Sep 9, 2025
863de02
Add comprehensive session documentation for frontend-backend integration
stegbk Sep 10, 2025
105032a
Fix critical integration issues discovered during comprehensive testing
stegbk Sep 10, 2025
3818824
Merge pull request #13 from nortal/kcs/frontend-api-integration
stegbk Sep 10, 2025
503ef26
Add comprehensive cURL-based integration test framework
stegbk Sep 10, 2025
a6853f3
Add project-level cURL test framework documentation
stegbk Sep 10, 2025
be488a3
Fix datetime deprecation warnings
stegbk Sep 10, 2025
e659b59
Fix DynamoDB GSI configuration to handle nullable familyId
stegbk Sep 10, 2025
dac8fe1
Address GitHub Advanced Security code quality issues
stegbk Sep 10, 2025
a5c01e4
Fix: Restore uuid import needed by test fixtures
stegbk Sep 10, 2025
172a271
Merge pull request #14 from nortal/kcs/curl-test-framework
stegbk Sep 10, 2025
164967d
Implement API validation foundation: 5 critical tickets
stegbk Sep 10, 2025
1c74098
Implement 5 High-Priority API Validation Tickets
stegbk Sep 10, 2025
dba0506
Add implementation files for validation tickets
stegbk Sep 10, 2025
e60f06e
Fix unused import security issues flagged by GitHub Advanced Security
stegbk Sep 10, 2025
e4d4ed4
Merge pull request #15 from nortal/feature/api-validation-foundation
stegbk Sep 10, 2025
3ac677e
Implement 5 high-priority API validation tickets
stegbk Sep 10, 2025
629ccd9
Fix test configuration and expectations for DynamoDB-free testing
stegbk Sep 10, 2025
a13de3c
Address GitHub Copilot feedback: optimize imports and add env vars
stegbk Sep 10, 2025
758ad1d
Add development session history for API validation implementation
stegbk Sep 10, 2025
261755c
Merge pull request #16 from nortal/feature/api-validation-foundation
stegbk Sep 10, 2025
1aaa275
Implement 5 high-priority API validation tickets with comprehensive t…
stegbk Sep 11, 2025
84f1de4
Add comprehensive session history documentation
stegbk Sep 11, 2025
7e39961
Update history with final security review and validation results
stegbk Sep 11, 2025
b619a36
Merge pull request #17 from nortal/feature/api-validation-foundation
stegbk Sep 11, 2025
867bbc6
Enhance Jira automation and /nextfive command workflow
stegbk Sep 11, 2025
88cfbaf
Add completed tickets reference to documentation
stegbk Sep 11, 2025
dc44b1e
Merge pull request #18 from nortal/feature/api-validation-foundation
stegbk Sep 11, 2025
be20e45
Implement PR003946-87 password policy validation and PR003946-67 casc…
stegbk Sep 11, 2025
5b9eec6
Clean up unused import in auth_controller.py
stegbk Sep 11, 2025
03c44c8
Update /nextfive template with correct Copilot reviewer syntax
stegbk Sep 11, 2025
4e2cd0b
Address Copilot review feedback
stegbk Sep 11, 2025
393ee87
Merge pull request #19 from nortal/feature/api-validation-foundation
stegbk Sep 11, 2025
a52db6f
Implement 5 missing API endpoints with comprehensive testing and vali…
stegbk Sep 11, 2025
3b1ecd4
Add comprehensive session history for API endpoint implementation
stegbk Sep 11, 2025
60f6f8b
Address Copilot and GitHub Advanced Security review feedback
stegbk Sep 11, 2025
63670ef
Add secure JIRA credential management system
stegbk Sep 11, 2025
0929115
Implement 5 priority API validation improvements for epic PR003946-61
stegbk Sep 11, 2025
0347d3b
Fix CodeQL issues: remove unused imports and invalid ValidationError …
stegbk Sep 11, 2025
f13a364
Merge pull request #20 from nortal/feature/api-validation-foundation
stegbk Sep 11, 2025
56874de
Changes to claude.md
stegbk Sep 11, 2025
1100ea9
Merge pull request #21 from nortal/feature/api-validation-foundation
stegbk Sep 11, 2025
1d0906e
feat: implement 5 high-priority API validation enhancements
stegbk Sep 11, 2025
84a71bc
fix: address Copilot review feedback - fix grammar in validation erro…
stegbk Sep 11, 2025
72c902e
Merge pull request #23 from nortal/feature/api-validation-enhancements
stegbk Sep 11, 2025
97c16dc
feat: implement complete frontend-backend animal management integration
stegbk Sep 11, 2025
a8d98af
Update UI testing report with additional control validation
stegbk Sep 12, 2025
e8b1147
Fix OpenAPI code generation quality issues and model regeneration
stegbk Sep 12, 2025
b893488
Add comprehensive session history documentation and enhanced /nextfiv…
stegbk Sep 12, 2025
39f6ca2
Merge pull request #25 from nortal/feature/frontend-backend-integrati…
stegbk Sep 12, 2025
f80d475
Enhance /nextfive template with multiple ticket support and advanced …
stegbk Sep 12, 2025
85159ba
Merge pull request #26 from nortal/feature/frontend-backend-integrati…
stegbk Sep 12, 2025
ea9092b
Complete API Testing Infrastructure & Validation Improvements
stegbk Sep 12, 2025
3c3534d
Fix GitHub Advanced Security scanner issues
stegbk Sep 12, 2025
6c56277
Fix Jira automation script accuracy issue
stegbk Sep 12, 2025
5724c7b
Address Copilot review comments
stegbk Sep 12, 2025
7efc59d
Complete quality assurance validation
stegbk Sep 12, 2025
d9eecae
Fix final unused import flagged by security scanner
stegbk Sep 12, 2025
a67511c
Address CodeQL security scanning issues
stegbk Sep 12, 2025
a85f69f
Fix CodeQL security scanning issues
stegbk Sep 12, 2025
93ea9f0
Merge pull request #27 from nortal/feature/api-automated-testing-updates
stegbk Sep 12, 2025
d537cb1
feat: implement API validation framework with PR003946-70 complete
stegbk Sep 12, 2025
a61109e
refactor: add error code constants to validation utilities
stegbk Sep 12, 2025
9573076
fix: complete OpenAPI regeneration and Docker daemon resolution
stegbk Sep 12, 2025
95ab34b
Fix authentication implementation and implement two-step Playwright v…
stegbk Sep 12, 2025
e90f4a6
Security improvements for CodeQL compliance
stegbk Sep 12, 2025
fe96b57
Address GitHub Advanced Security CodeQL findings
stegbk Sep 12, 2025
9f945c6
Merge pull request #28 from nortal/feature/api-validation-improvement…
stegbk Sep 12, 2025
be9a349
Add authentication testing improvements and Jira automation scripts
stegbk Sep 12, 2025
69e64b8
Merge pull request #29 from nortal/feature/authentication-testing-art…
stegbk Sep 12, 2025
3493544
Add comprehensive function-level unit tests for TDD enablement
stegbk Sep 12, 2025
c05a0be
Merge remote-tracking branch 'origin/dev' into feature/function-level…
stegbk Sep 12, 2025
7017c3f
Add comprehensive function-level unit tests for TDD enablement
stegbk Sep 12, 2025
50e55d3
Fix CodeQL issues: move imports to top-level, add missing method, rem…
stegbk Sep 12, 2025
a84fa6e
Comprehensive CodeQL fixes: resolve all 38 issues
stegbk Sep 12, 2025
a9773af
Fix CodeQL and Copilot review issues
stegbk Sep 12, 2025
005ee2c
Merge pull request #30 from nortal/feature/function-level-unit-tests
stegbk Sep 13, 2025
17b0697
Add controller fixes and Playwright tests for animal configuration
stegbk Sep 13, 2025
f3bff1b
Merge remote-tracking branch 'origin/dev' into feature/api-validation…
stegbk Sep 13, 2025
243a64d
Fix CodeQL issues: Replace 'do some magic!' placeholders with proper …
stegbk Sep 13, 2025
f1f4ed7
Fix CodeQL failures: Replace 'do some magic!' placeholders with prope…
stegbk Sep 13, 2025
ef93e8c
Fix CodeQL error and warnings: resolve 1 error + 25+ warnings
stegbk Sep 13, 2025
2ea2a8a
Merge pull request #31 from nortal/feature/api-validation-function-te…
stegbk Sep 13, 2025
f7fcb88
WIP: Animal config fixes - personality validation pattern and seriali…
stegbk Sep 13, 2025
28938ca
Fix UI default values and DynamoDB consistency issues
stegbk Sep 13, 2025
a919a45
Fix UI defaults and DynamoDB data consistency issues
stegbk Sep 13, 2025
b3eaf30
Implement comprehensive security fixes for CodeQL findings
stegbk Sep 13, 2025
0ebe4ee
Address all PR review feedback and resolve open comments
stegbk Sep 13, 2025
891e6c2
Clean up unused variables and imports to resolve CodeQL findings
stegbk Sep 13, 2025
a7f0c4c
Merge pull request #32 from nortal/feature/fix-ui-defaults-and-data-c…
stegbk Sep 13, 2025
c25bf63
Enhance /nextfive command with intelligent discovery and quality gates
stegbk Sep 13, 2025
7abe281
Merge pull request #33 from nortal/feature/nextfive-enhancements-2025…
stegbk Sep 13, 2025
daf81e6
Implement comprehensive retrospective learnings and /nextfive enhance…
stegbk Sep 13, 2025
616c1c8
Implement TDD Foundation: 5 Core API Validation Tickets
stegbk Sep 13, 2025
a7cea5a
Address Copilot review feedback: security and code quality fixes
stegbk Sep 13, 2025
5b979a1
Merge pull request #35 from nortal/feature/tdd-foundation-tickets-202…
stegbk Sep 13, 2025
4d1b6e0
Implement tab-aware form validation for Animal Configuration modal
stegbk Sep 14, 2025
a4def75
Merge pull request #37 from nortal/feature/tab-aware-form-validation-…
stegbk Sep 14, 2025
4bca7c7
Implement comprehensive TDD framework with Jira integration and multi…
stegbk Sep 14, 2025
a435fc4
Merge pull request #38 from nortal/feature/tdd-framework-comprehensiv…
stegbk Sep 14, 2025
e9d6eb0
Implement 3/5 high-priority API validation tickets with systematic ap…
stegbk Sep 14, 2025
8182074
Implement comprehensive OpenAPI template-based solution for placehold…
stegbk Sep 14, 2025
c02df2a
Security fix: Change file permissions from 0o755 to 0o644
stegbk Sep 14, 2025
685f01a
CodeQL security fix: Replace regex patterns with safe string replacem…
stegbk Sep 14, 2025
3221a3c
Code quality fix: Address all GitHub Advanced Security findings
stegbk Sep 14, 2025
c60828e
Security fix: Set restrictive file permissions for generated scripts
stegbk Sep 14, 2025
7ad3efd
Fix: Resolve OpenAPI template integration issues and security findings
stegbk Sep 14, 2025
807b513
docs: Add OpenAPI template integration and security scanner learnings
stegbk Sep 14, 2025
f4de030
Merge pull request #39 from nortal/feature/api-validation-next-five-2…
stegbk Sep 14, 2025
38a95bc
feat: Add authentication fixes and animal config investigation
stegbk Sep 15, 2025
dbb36b8
feat(PR003946-147): Implement comprehensive frontend-backend regressi…
stegbk Sep 15, 2025
a9fab64
docs: Add Animal Configuration Edit validation session documentation
stegbk Sep 15, 2025
b10742d
fix: resolve code review comments from Copilot and GitHub Advanced Se…
stegbk Sep 15, 2025
ae800c2
fix: resolve hardcoded JWT secret security vulnerability
stegbk Sep 15, 2025
edfb712
Merge pull request #40 from nortal/feature/pr003946-147-regression-pr…
stegbk Sep 15, 2025
fe146ad
Merge pull request #34 from nortal/feature/retrospective-learnings-20…
stegbk Sep 16, 2025
5ae8f8b
feat: Add comprehensive Claude Code command framework and validation …
stegbk Sep 16, 2025
ed2bc81
fix: Allow natural language punctuation in animal personality fields …
stegbk Sep 17, 2025
9283edb
feat: Fix text validation patterns to support natural language (#43)
stegbk Sep 17, 2025
5ad7c25
feat: Implement API validation improvements for PR003946 epic (#44)
stegbk Sep 17, 2025
50f2b16
feat: Implement Chat History Epic (PR003946-156 to PR003946-160) (#45)
stegbk Sep 19, 2025
380a385
feat: Implement Chat History Epic (PR003946-170) - Conversation Manag…
stegbk Sep 19, 2025
21caa1d
fix: Resolve authentication, family creation, and API endpoint issues…
stegbk Sep 19, 2025
8331383
feat: Implement conversation history endpoints and fix animal ID para…
stegbk Oct 2, 2025
d247ef9
feat: Implement conversation/chat endpoints with ChatGPT integration …
stegbk Oct 5, 2025
e2884ab
fix: Upgrade dependencies to address CVE warnings (#52)
stegbk Oct 5, 2025
e51ce34
feat: Add automated fix for recurring post-generation issues (#53)
stegbk Oct 9, 2025
928f568
checkpoint: pre-code-review-fixes state with Guardrails system
stegbk Oct 10, 2025
378a832
fix(dead-code): remove deprecated later.py and later_controller.py
stegbk Oct 10, 2025
f323a4d
docs: add code review fix reports and assessment
stegbk Oct 10, 2025
fbcd3d3
fix: Resolve CodeQL security and quality issues
stegbk Oct 10, 2025
1fc4b8f
docs: add security note about structured logging
stegbk Oct 10, 2025
fb6d7b7
fix(security): Add log injection sanitization for user-provided values
stegbk Oct 10, 2025
e5fd524
fix(security): Implement defense-in-depth log injection protection
stegbk Oct 10, 2025
afa6709
fix: Bug #7 and FLAKE8 cleanup - resolve import-before-use errors
stegbk Oct 13, 2025
d9e51c8
feat: PHASE 0.5 - Implement systemPrompt DynamoDB persistence
stegbk Oct 17, 2025
2683d8b
docs: add critical /convo_turn/stream endpoint discovery to ENDPOINT-…
stegbk Oct 18, 2025
045837d
fix: Animal Details Modal close button now works in both edit and vie…
stegbk Oct 18, 2025
10bd90b
docs: add Playwright MCP tool documentation to test files
stegbk Oct 18, 2025
91f5e49
fix: resolve test collection errors preventing 594 tests from running
stegbk Oct 19, 2025
c7be1e1
fix: update unit tests to handle tuple returns from API handlers (20/…
stegbk Oct 19, 2025
aff5a59
feat: MVP reorganization - simplified navigation and AI Provider Sett…
stegbk Oct 20, 2025
14b43bb
feat: Add Spec Kit for specification-driven development
stegbk Oct 20, 2025
2fef0b5
fix: Resolve family.py handler forwarding chains
stegbk Oct 20, 2025
ea0a799
test: Improve unit test coverage and add security edge cases
stegbk Oct 20, 2025
dd77ed2
chore: Session work checkpoint - various improvements
stegbk Oct 20, 2025
1e38726
fix(handlers): Resolve critical handler forwarding chain issues (T001…
stegbk Oct 20, 2025
5515dc3
test(coverage): Add comprehensive test suite (T007-T009)
stegbk Oct 20, 2025
8801f0e
test(coverage): Complete test suite improvements (T010-T012)
stegbk Oct 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
191 changes: 191 additions & 0 deletions #jira_stories_playwright_validation.md#
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Jira Stories for Playwright Validation

## Story 1: DynamoDB Persistence Validation

**Summary**: Validate Playwright E2E Tests with DynamoDB Persistence

**Issue Type**: Task
**Parent Epic**: PR003946-61
**Story Points**: 8
**Priority**: High
**Labels**: backend, testing, dynamodb, playwright
**Billable**: Billable

**Description**:
As a developer, I want comprehensive validation of Playwright end-to-end tests using DynamoDB as the persistence layer to ensure data integrity and proper CRUD operations during browser automation testing.

### Background
Currently our Playwright tests may not be fully validating the DynamoDB persistence layer integration. We need to ensure that all user interactions (login, family management, animal configurations, conversations) properly persist to and retrieve from DynamoDB tables during E2E testing.

### Technical Context
- API Backend: Flask/Connexion with OpenAPI-first development
- Persistence: AWS DynamoDB with 10+ production tables
- Test Environment: Playwright browser automation with 6 browser configurations
- Tables: quest-dev-family, quest-dev-users, quest-dev-animals, quest-dev-conversations
- Test Users: parent1@test.cmz.org, student1@test.cmz.org, test@cmz.org, user_parent_001@cmz.org
- Environment: AWS_PROFILE=cmz, AWS_REGION=us-west-2

### Scope/Endpoints
All Playwright E2E tests that interact with backend API endpoints requiring DynamoDB persistence.

### Acceptance Criteria

**AC1: Login Flow DynamoDB Persistence**
- **Given** a Playwright test runs login for parent1@test.cmz.org
- **When** authentication succeeds and user accesses dashboard
- **Then** verify user record exists in quest-dev-users table with correct JWT token hash
- **And** verify login timestamp is recorded in DynamoDB within 5 seconds of test execution
- **Test**: `aws dynamodb get-item --table-name quest-dev-users --key '{"userId":{"S":"parent1@test.cmz.org"}}'`

**AC2: Family CRUD Operations Persistence**
- **Given** a Playwright test creates a new family via the family management UI
- **When** family data is submitted with familyName "Test Family E2E"
- **Then** verify family record exists in quest-dev-family table with generated familyId
- **And** verify created.at and modified.at timestamps are ISO format and within test execution time
- **Test**: `aws dynamodb scan --table-name quest-dev-family --filter-expression "familyName = :name" --expression-attribute-values '{":name":{"S":"Test Family E2E"}}'`

**AC3: Animal Configuration Persistence**
- **Given** a Playwright test modifies animal chatbot settings for "Luna the Lion"
- **When** configuration changes are saved (personality, response style, knowledge base)
- **Then** verify updated animal record in quest-dev-animals table matches UI changes
- **And** verify configuration version number incremented by 1
- **Test**: `aws dynamodb get-item --table-name quest-dev-animals --key '{"animalId":{"S":"luna-lion"}}'` and compare config fields

**AC4: Conversation History Persistence**
- **Given** a Playwright test conducts a chat conversation with 3+ message exchanges
- **When** each message is sent and received in the chat interface
- **Then** verify complete conversation thread exists in quest-dev-conversations table
- **And** verify message timestamps are sequential and within test execution window
- **Test**: `aws dynamodb query --table-name quest-dev-conversations --key-condition-expression "sessionId = :sid"`

**AC5: Cross-Browser DynamoDB Consistency**
- **Given** Playwright tests run across all 6 browser configurations (Chrome, Firefox, Safari, Edge, Mobile Chrome, Mobile Safari)
- **When** each browser performs identical login → family creation → animal interaction sequence
- **Then** verify DynamoDB contains 6 distinct user sessions with unique sessionIds
- **And** verify no data corruption or race conditions between concurrent browser sessions
- **Test**: Count distinct sessionIds in quest-dev-conversations for test timeframe must equal 6

**AC6: Test Data Isolation and Cleanup**
- **Given** Playwright test suite runs with --workers=2 (concurrent execution)
- **When** tests complete successfully or fail
- **Then** verify test data is prefixed with "test-" or "e2e-" for identification
- **And** verify automated cleanup removes all test records within 60 seconds of test completion
- **Test**: `aws dynamodb scan --table-name quest-dev-family --filter-expression "begins_with(familyId, :prefix)" --expression-attribute-values '{":prefix":{"S":"test-"}}'` returns 0 items post-cleanup

**AC7: DynamoDB Error Handling Validation**
- **Given** DynamoDB table is temporarily unavailable (simulate with invalid credentials)
- **When** Playwright test attempts family creation
- **Then** verify UI displays "Data service temporarily unavailable" error message
- **And** verify test doesn't crash and can recover when service restored
- **Test**: Mock DynamoDB failure, verify error UI element exists, restore service, verify recovery

---

## Story 2: Local File Persistence Mode Validation

**Summary**: Validate Playwright E2E Tests with Local File Persistence Mode

**Issue Type**: Task
**Parent Epic**: PR003946-61
**Story Points**: 5
**Priority**: Normal
**Labels**: backend, testing, file-persistence, playwright
**Billable**: Billable

**Description**:
As a developer, I want comprehensive validation of Playwright end-to-end tests using local file persistence mode (PERSISTENCE_MODE=file) to ensure data integrity and proper CRUD operations during browser automation testing in offline/development scenarios.

### Background
Our API supports both DynamoDB and local file persistence modes. We need to ensure Playwright E2E tests work correctly when the API is configured for local file persistence (PERSISTENCE_MODE=file), providing a complete testing solution for development environments without AWS dependencies.

### Technical Context
- API Backend: Flask/Connexion with OpenAPI-first development
- Persistence: Local file system with JSON-based storage
- Test Environment: Playwright browser automation with 6 browser configurations
- Storage: Local files in configured directory structure
- Test Users: Same authentication users but stored in local files
- Environment: PERSISTENCE_MODE=file, no AWS dependencies required

### Scope/Endpoints
All Playwright E2E tests that interact with backend API endpoints, configured for local file persistence mode.

### Acceptance Criteria

**AC1: File-Based Login Persistence**
- **Given** API runs with PERSISTENCE_MODE=file and Playwright test performs login
- **When** parent1@test.cmz.org authenticates successfully
- **Then** verify user data file exists at `./data/users/parent1@test.cmz.org.json`
- **And** verify file contains valid JWT token hash and login timestamp
- **Test**: `cat ./data/users/parent1@test.cmz.org.json | jq '.lastLogin'` returns timestamp within 5 seconds

**AC2: File-Based Family CRUD Operations**
- **Given** PERSISTENCE_MODE=file and Playwright test creates family "File Test Family"
- **When** family creation form is submitted via UI
- **Then** verify family file exists at `./data/families/{generated-uuid}.json`
- **And** verify file contains familyName "File Test Family" and ISO timestamps
- **Test**: `find ./data/families -name "*.json" -exec grep -l "File Test Family" {} \;` returns exactly 1 file

**AC3: File-Based Animal Configuration**
- **Given** PERSISTENCE_MODE=file and Playwright test modifies Luna's chatbot settings
- **When** personality changes from "Friendly" to "Educational" via UI
- **Then** verify `./data/animals/luna-lion.json` contains `"personality": "Educational"`
- **And** verify configVersion incremented and modifiedAt updated
- **Test**: `cat ./data/animals/luna-lion.json | jq '.personality'` equals "Educational"

**AC4: File-Based Conversation Storage**
- **Given** PERSISTENCE_MODE=file and Playwright test conducts 5-message conversation
- **When** each message exchange completes in chat interface
- **Then** verify conversation file exists at `./data/conversations/{sessionId}.json`
- **And** verify file contains array of 5 message objects with sequential timestamps
- **Test**: `cat ./data/conversations/{sessionId}.json | jq '.messages | length'` equals 5

**AC5: Cross-Browser File Consistency**
- **Given** PERSISTENCE_MODE=file and 3 concurrent browser sessions perform identical operations
- **When** each browser creates family with same name "Concurrent Test Family"
- **Then** verify 3 separate family files exist with unique UUIDs
- **And** verify no file corruption or incomplete writes
- **Test**: `find ./data/families -name "*.json" -exec grep -l "Concurrent Test Family" {} \; | wc -l` equals 3

**AC6: File System Error Handling**
- **Given** PERSISTENCE_MODE=file and data directory is read-only
- **When** Playwright test attempts to create family
- **Then** verify UI displays "Unable to save data" error message
- **And** verify error logged contains "Permission denied" or similar file system error
- **Test**: Set `chmod 444 ./data/families` before test, verify error UI element exists

**AC7: File-Based Test Cleanup**
- **Given** PERSISTENCE_MODE=file and Playwright test suite completes
- **When** cleanup phase executes
- **Then** verify all files with "test-" prefix are removed from all data directories
- **And** verify production data files remain unchanged
- **Test**: `find ./data -name "*test-*" | wc -l` equals 0 after cleanup

**AC8: DynamoDB-to-File Mode Compatibility**
- **Given** API switches from DynamoDB to PERSISTENCE_MODE=file mid-test
- **When** existing session continues with file-based operations
- **Then** verify same API responses and UI behavior as DynamoDB mode
- **And** verify session continuity maintained across persistence mode switch
- **Test**: Compare API response schemas between modes, verify identical structure

**AC9: File Performance Under Load**
- **Given** PERSISTENCE_MODE=file and 6 concurrent Playwright sessions
- **When** each session performs 10 rapid CRUD operations
- **Then** verify all 60 operations complete within 30 seconds
- **And** verify no file locking conflicts or partial writes
- **Test**: Measure operation completion time, verify all expected files exist and are valid JSON

---

## Creation Instructions

These stories can be created in Jira using:

1. **Manual Creation**: Copy the content above into new Jira tickets
2. **Existing Scripts**: Use `/scripts/update_jira_simple.sh` workflow if it supports creation
3. **Direct API**: Use the working Jira API authentication from your established patterns

Remember to:
- Set **Billable** field to "Billable"
- Link to **Parent Epic**: PR003946-61
- Add appropriate **Labels**: backend, testing, dynamodb/file-persistence, playwright
- Set **Story Points**: 8 for DynamoDB story, 5 for file persistence storyB
1 change: 1 addition & 0 deletions .#jira_stories_playwright_validation.md
Loading
Loading