test: standardize naming conventions to snake_case

- Rename demo_event_id → testing_event_id (more explicit)
- Rename demo_account_id → testing_account_id (matches convention)
- Rename demo_badge_id → event_badge_id (descriptive)
- Rename demo_template_id → event_badge_template_id (explicit)
- Update all test files for consistency (15 files)
- Enhance README with organized test data sections
- Update person IDs to match README test data
- No regression: 15 tests passing, 7 pre-existing failures unchanged
This commit is contained in:
Scott Idem
2026-02-26 15:43:31 -05:00
parent 2c289e39de
commit a91c648c61
14 changed files with 176 additions and 156 deletions

View File

@@ -61,7 +61,19 @@ Help
* Use snake_case (or Snake_Case or Snake_case or test_NASA_example or test_API_key) * Use snake_case (or Snake_Case or Snake_case or test_NASA_example or test_API_key)
* Aether test/demo base URL: 'http://demo.localhost:5173' * Aether test/demo base URL: 'http://demo.localhost:5173'
* Aether development API: 'https://dev-api.oneskyit.com' * Aether development API: 'https://dev-api.oneskyit.com'
These are IDs for records that we can use for testing. Please do not delete them. They are also used for demo purposes with clients.
### Core Modules
* Aether test/demo Account: '_XY7DXtc9MY' (1) "One Sky IT Demo" * Aether test/demo Account: '_XY7DXtc9MY' (1) "One Sky IT Demo"
* Aether test/demo Site: '92vkYC4fVEl' (12) "One Sky IT Demo"
* Aether test/demo Site Domain: '_6jcTbnJk-o' (12) "demo.localhost:5173"
* Aether test/demo Site Domain: 'heXRgHOs4ns' (30) "sk-demo.oneskyit.com"
* Aether test/demo Site Domain: 'DASm8fP92yw' (69) "dev-demo.oneskyit.com"
* Aether test/demo Site Domain: '2i_0Za6yRPo' (2) "demo.oneskyit.com"
* Aether test/demo Person: 'QWODAPCNLQU' (49) "Osiris Idem"
* Aether test/demo Person: 'HMQRNPIXQMK' (48) "Cleo Idem"
### Events Modules
* Aether test/demo Event: 'pjrcghqwert' (1) "Demo One Sky IT Conference" * Aether test/demo Event: 'pjrcghqwert' (1) "Demo One Sky IT Conference"
* Aether test/demo Event Session: 'DOW3h7v6H42' (703) "How To Do Things" * Aether test/demo Event Session: 'DOW3h7v6H42' (703) "How To Do Things"
* Aether test/demo Event Presentation: '7U2eXSjR6H4' (1670) "Build a House" * Aether test/demo Event Presentation: '7U2eXSjR6H4' (1670) "Build a House"
@@ -71,7 +83,14 @@ Help
* Aether test/demo Event Person: 'ffkKxiHpOEC' (16603) "Scott Idem" * Aether test/demo Event Person: 'ffkKxiHpOEC' (16603) "Scott Idem"
* Aether test/demo Event Badge Template: 'jgfixEpYp1B' (18) "Dev Demo 202x" * Aether test/demo Event Badge Template: 'jgfixEpYp1B' (18) "Dev Demo 202x"
* Aether test/demo Event Badge Template: 'rzmUgsk7mkq' (19) "Dev Demo 202x Workshops" * Aether test/demo Event Badge Template: 'rzmUgsk7mkq' (19) "Dev Demo 202x Workshops"
* Aether test/demo Event Location: 'VXXY-98-46-14' (26) "Ballroom 1"
* Aether test/demo Event Location: 'FGRN-67-92-45' (298) "Ballroom AB"
* Aether test/demo Event Location: 'PQKB-15-39-81' (78) "Poster Display Station A"
### Journals Module
* Aether test/demo Journal: 'BVYE-94-46-29' (42) "Testing Things" * Aether test/demo Journal: 'BVYE-94-46-29' (42) "Testing Things"
* Aether test/demo Journal Entry: 'xRx-Y4-h3-fU' (233) "Another Journal Entry in the Test Journal" * Aether test/demo Journal Entry: 'xRx-Y4-h3-fU' (233) "Another Journal Entry in the Test Journal"
### Archives Module
* Aether test/demo Archive: 'nAA2bHLv8RK' (1) "One Sky Test Archive" * Aether test/demo Archive: 'nAA2bHLv8RK' (1) "One Sky Test Archive"
* Aether test/demo Archive Content: 'UjKzrk-GKu5' (1) "Hosted File Test" * Aether test/demo Archive Content: 'UjKzrk-GKu5' (1) "Hosted File Test"

View File

@@ -4,14 +4,14 @@
*/ */
export const test_base_url = 'http://demo.localhost:5173'; export const test_base_url = 'http://demo.localhost:5173';
export const dev_api_base = 'https://dev-api.oneskyit.com'; export const dev_api_base = 'https://dev-api.oneskyit.com';
export const demo_account_id = '_XY7DXtc9MY'; export const testing_account_id = '_XY7DXtc9MY';
export const demo_event_id = 'pjrcghqwert'; export const testing_event_id = 'pjrcghqwert';
export const TEST_ENV = { export const TEST_ENV = {
test_base_url, test_base_url,
dev_api_base, dev_api_base,
demo_account_id, testing_account_id,
demo_event_id testing_event_id
}; };
export default TEST_ENV; export default TEST_ENV;

View File

@@ -1,9 +1,9 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_event_id, demo_account_id } from './_helpers/env'; import { testing_event_id, testing_account_id } from './_helpers/env';
const demo_event = demo_event_id; const event_id = testing_event_id;
const demo_badge_id = 'UIJT-73-63-61'; // Per README test data const event_badge_id = 'UIJT-73-63-61'; // Per README test data
test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => { test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -23,13 +23,13 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
authenticated_access: true, authenticated_access: true,
trusted_access: true, trusted_access: true,
edit_mode: false, edit_mode: false,
person_id: 'test-person-1', person_id: 'HMQRNPIXQMK', // Per README test data
user: { id: 'test-person-1' }, user: { id: 'HMQRNPIXQMK' }, // Per README test data
mod: { ...defaults.mod, events: { ...defaults.mod.events, event_id: event_id } } mod: { ...defaults.mod, events: { ...defaults.mod.events, event_id: event_id } }
}; };
window.localStorage.setItem('ae_loc', JSON.stringify(testData)); window.localStorage.setItem('ae_loc', JSON.stringify(testData));
}, },
{ defaults: ae_app_local_data_defaults, event_id: demo_event, account_id: demo_account_id } { defaults: ae_app_local_data_defaults, event_id: event_id, account_id: testing_account_id }
); );
// Navigate and clear all Dexie databases to simulate cold start // Navigate and clear all Dexie databases to simulate cold start
@@ -60,7 +60,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
}); });
// Seed the event record in IDB so liveQuery finds it // Seed the event record in IDB so liveQuery finds it
await page.evaluate(({ demo_event }) => { await page.evaluate(({ event_id }) => {
return new Promise<void>((resolve) => { return new Promise<void>((resolve) => {
try { try {
const req = indexedDB.open('ae_events_db', 1); const req = indexedDB.open('ae_events_db', 1);
@@ -75,8 +75,8 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
const tx = db.transaction('event', 'readwrite'); const tx = db.transaction('event', 'readwrite');
const store = tx.objectStore('event'); const store = tx.objectStore('event');
store.put({ store.put({
id: demo_event, id: event_id,
event_id: demo_event, event_id: event_id,
name: 'Cold Start Badge Test Event', name: 'Cold Start Badge Test Event',
cfg_json: {}, cfg_json: {},
mod_pres_mgmt_json: {}, mod_pres_mgmt_json: {},
@@ -99,7 +99,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
resolve(); resolve();
} }
}); });
}, { demo_event }); }, { event_id });
// Mock V3 API responses // Mock V3 API responses
await page.route('**/v3/**', async (route) => { await page.route('**/v3/**', async (route) => {
@@ -108,14 +108,14 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
const method = req.method(); const method = req.method();
// Event GET // Event GET
if (url.includes(`/v3/crud/event/${demo_event}`) && method === 'GET') { if (url.includes(`/v3/crud/event/${event_id}`) && method === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: { data: {
id: demo_event, id: event_id,
event_id: demo_event, event_id: event_id,
name: 'Cold Start Badge Test Event', name: 'Cold Start Badge Test Event',
cfg_json: {}, cfg_json: {},
mod_pres_mgmt_json: {}, mod_pres_mgmt_json: {},
@@ -129,24 +129,24 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
} }
// Badge search/list - return enriched data like real API does // Badge search/list - return enriched data like real API does
if (url.includes(`/v3/crud/event/${demo_event}/event_badge/search`) && method === 'POST') { if (url.includes(`/v3/crud/event/${event_id}/event_badge/search`) && method === 'POST') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: [ data: [
{ {
id: demo_badge_id, id: event_badge_id,
event_badge_id: demo_badge_id, event_badge_id: event_badge_id,
event_id: demo_event, event_id: event_id,
event_badge_template_id: 'jgfixEpYp1B', event_badge_template_id: 'jgfixEpYp1B', // Per README test data
full_name_override: 'Scott Idem', full_name_override: 'Scott Idem',
given_name: 'Scott', given_name: 'Scott',
family_name: 'Idem', family_name: 'Idem',
email: 'scott@oneskyit.com', email: 'scott@oneskyit.com',
badge_type: 'attendee', badge_type: 'attendee',
badge_type_code: 'attendee', badge_type_code: 'attendee',
person_id: 'ffkKxiHpOEC', person_id: 'ffkKxiHpOEC', // Per README test data
// Enriched fields from API joins // Enriched fields from API joins
person_given_name: 'Scott', person_given_name: 'Scott',
person_family_name: 'Idem', person_family_name: 'Idem',
@@ -175,8 +175,8 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
body: JSON.stringify({ body: JSON.stringify({
data: { data: {
id: 'jgfixEpYp1B', id: 'jgfixEpYp1B',
event_badge_template_id: 'jgfixEpYp1B', event_badge_template_id: 'jgfixEpYp1B', // Per README test data
event_id: demo_event, event_id: event_id,
name: 'Dev Demo 202x', name: 'Dev Demo 202x',
header_path: '/images/demo-header.png', header_path: '/images/demo-header.png',
logo_path: '/images/demo-logo.png', logo_path: '/images/demo-logo.png',
@@ -206,7 +206,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
}); });
test('renders Badge list with enriched data on first load (empty IDB)', async ({ page }) => { test('renders Badge list with enriched data on first load (empty IDB)', async ({ page }) => {
await page.goto(`/events/${demo_event}/badges`); await page.goto(`/events/${event_id}/badges`);
// Wait for API call to complete // Wait for API call to complete
await page.waitForResponse((r) => await page.waitForResponse((r) =>
@@ -228,7 +228,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
}); });
test('verifies IndexedDB contains badge after cold-start load', async ({ page }) => { test('verifies IndexedDB contains badge after cold-start load', async ({ page }) => {
await page.goto(`/events/${demo_event}/badges`); await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) => await page.waitForResponse((r) =>
r.url().includes('event_badge/search') && r.status() === 200, r.url().includes('event_badge/search') && r.status() === 200,
@@ -239,7 +239,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
await page.waitForTimeout(1000); await page.waitForTimeout(1000);
// Check IDB for badge record // Check IDB for badge record
const idb_check = await page.evaluate(async ({ demo_event, demo_badge_id }) => { const idb_check = await page.evaluate(async ({ event_id, event_badge_id }) => {
return new Promise((resolve) => { return new Promise((resolve) => {
try { try {
const req = indexedDB.open('ae_events_db'); const req = indexedDB.open('ae_events_db');
@@ -247,7 +247,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
const db = req.result; const db = req.result;
const tx = db.transaction('badge', 'readonly'); const tx = db.transaction('badge', 'readonly');
const store = tx.objectStore('badge'); const store = tx.objectStore('badge');
const get_req = store.get(demo_badge_id); const get_req = store.get(event_badge_id);
get_req.onsuccess = () => { get_req.onsuccess = () => {
const badge = get_req.result; const badge = get_req.result;
db.close(); db.close();
@@ -255,7 +255,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
found: !!badge, found: !!badge,
has_full_name: badge?.full_name_override === 'Scott Idem', has_full_name: badge?.full_name_override === 'Scott Idem',
has_email: badge?.email === 'scott@oneskyit.com', has_email: badge?.email === 'scott@oneskyit.com',
has_event_id: badge?.event_id === demo_event has_event_id: badge?.event_id === event_id
}); });
}; };
get_req.onerror = () => { get_req.onerror = () => {
@@ -268,7 +268,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
resolve({ found: false }); resolve({ found: false });
} }
}); });
}, { demo_event, demo_badge_id }); }, { event_id, event_badge_id });
expect(idb_check.found).toBe(true); expect(idb_check.found).toBe(true);
expect(idb_check.has_full_name).toBe(true); expect(idb_check.has_full_name).toBe(true);
@@ -277,7 +277,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
}); });
test('handles badge template relationship correctly', async ({ page }) => { test('handles badge template relationship correctly', async ({ page }) => {
await page.goto(`/events/${demo_event}/badges`); await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) => await page.waitForResponse((r) =>
r.url().includes('event_badge/search') && r.status() === 200, r.url().includes('event_badge/search') && r.status() === 200,
@@ -285,7 +285,7 @@ test.describe('Cold-start: Event Badges List (IndexedDB empty)', () => {
); );
// Badge detail view test - navigate to specific badge // Badge detail view test - navigate to specific badge
await page.goto(`/events/${demo_event}/badges/${demo_badge_id}`); await page.goto(`/events/${event_id}/badges/${event_badge_id}`);
// Wait for badge view to load // Wait for badge view to load
await page.waitForTimeout(2000); await page.waitForTimeout(2000);

View File

@@ -1,14 +1,14 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_event_id, demo_account_id } from './_helpers/env'; import { testing_event_id, testing_account_id } from './_helpers/env';
// Demo test data IDs from One Sky IT Demo environment // Demo test data IDs from One Sky IT Demo environment
// Session: (703) "How To Do Things" // Session: (703) "How To Do Things"
// Presentation: (1670) "Build a House" // Presentation: (1670) "Build a House"
// Presenter: (2202) "Bob The Builder" // Presenter: (2202) "Bob The Builder"
const demo_session_id = 'DOW3h7v6H42'; const event_session_id = 'DOW3h7v6H42'; // Per README test data
const demo_presentation_id = '7U2eXSjR6H4'; const event_presentation_id = '7U2eXSjR6H4'; // Per README test data
const demo_presenter_id = 'gT-hxnifb-0'; const event_presenter_id = 'gT-hxnifb-0'; // Per README test data
test.describe('Cold-start: Event Session (IndexedDB empty)', () => { test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -21,7 +21,7 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
// Provide app localStorage before any scripts run // Provide app localStorage before any scripts run
await page.addInitScript( await page.addInitScript(
({ defaults, event_id, account_id }) => { ({ defaults, event_id, account_id }) => {
const testData = { const test_data = {
...defaults, ...defaults,
account_id: account_id, account_id: account_id,
administrator_access: true, administrator_access: true,
@@ -31,13 +31,13 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
super_access: false, super_access: false,
edit_mode: true, edit_mode: true,
mod_abstracts_json: {}, mod_abstracts_json: {},
person_id: 'test-person-1', person_id: 'QWODAPCNLQU', // Per README test data
user: { id: 'test-person-1' }, user: { id: 'QWODAPCNLQU' }, // Per README test data
mod: { ...defaults.mod, events: { ...defaults.mod.events, event_id: event_id } } mod: { ...defaults.mod, events: { ...defaults.mod.events, event_id: event_id } }
}; };
window.localStorage.setItem('ae_loc', JSON.stringify(testData)); window.localStorage.setItem('ae_loc', JSON.stringify(test_data));
}, },
{ defaults: ae_app_local_data_defaults, event_id: demo_event_id, account_id: demo_account_id } { defaults: ae_app_local_data_defaults, event_id: testing_event_id, account_id: testing_account_id }
); );
// Navigate to the application's origin so the page context is allowed // Navigate to the application's origin so the page context is allowed
@@ -76,22 +76,22 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
const method = req.method(); const method = req.method();
// Session GET // Session GET
if (url.includes(`/v3/crud/event_session/${demo_session_id}`) && method === 'GET') { if (url.includes(`/v3/crud/event_session/${event_session_id}`) && method === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: { data: {
id: demo_session_id, id: event_session_id,
event_session_id: demo_session_id, event_session_id: event_session_id,
event_id: demo_event_id, event_id: testing_event_id,
name: 'How To Do Things', name: 'How To Do Things',
code: 'how-to-do-things', code: 'how-to-do-things',
start_datetime: '2026-03-01T10:00:00Z', start_datetime: '2026-03-01T10:00:00Z',
end_datetime: '2026-03-01T11:00:00Z', end_datetime: '2026-03-01T11:00:00Z',
description: 'Cold start test session', description: 'Cold start test session',
event_location_id: 'test-location-1', event_location_id: 'VXXY-98-46-14', // Per README test data
poc_person_id: 'test-person-1', poc_person_id: 'QWODAPCNLQU', // Per README test data
cfg_json: {}, cfg_json: {},
mod_pres_mgmt_json: {} mod_pres_mgmt_json: {}
} }
@@ -100,17 +100,17 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
} }
// Presentations list for session // Presentations list for session
if (url.includes('/v3/crud/event_presentation') && url.includes('for_obj_id') && url.includes(demo_session_id) && method === 'GET') { if (url.includes('/v3/crud/event_presentation') && url.includes('for_obj_id') && url.includes(event_session_id) && method === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: [ data: [
{ {
id: demo_presentation_id, id: event_presentation_id,
event_presentation_id: demo_presentation_id, event_presentation_id: event_presentation_id,
event_session_id: demo_session_id, event_session_id: event_session_id,
event_id: demo_event_id, event_id: testing_event_id,
name: 'Build a House', name: 'Build a House',
code: 'build-house', code: 'build-house',
start_datetime: '2026-03-01T10:00:00Z', start_datetime: '2026-03-01T10:00:00Z',
@@ -122,18 +122,18 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
} }
// Presenters for "Build a House" presentation // Presenters for "Build a House" presentation
if (url.includes('/v3/crud/event_presenter') && url.includes(`for_obj_id=${demo_presentation_id}`) && method === 'GET') { if (url.includes('/v3/crud/event_presenter') && url.includes(`for_obj_id=${event_presentation_id}`) && method === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: [ data: [
{ {
id: demo_presenter_id, id: event_presenter_id,
event_presenter_id: demo_presenter_id, event_presenter_id: event_presenter_id,
event_presentation_id: demo_presentation_id, event_presentation_id: event_presentation_id,
event_session_id: demo_session_id, event_session_id: event_session_id,
event_id: demo_event_id, event_id: testing_event_id,
given_name: 'Bob', given_name: 'Bob',
family_name: 'The Builder', family_name: 'The Builder',
full_name: 'Bob The Builder', full_name: 'Bob The Builder',
@@ -155,7 +155,7 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
test('renders Session with Presentations and Presenters on first load', async ({ page }) => { test('renders Session with Presentations and Presenters on first load', async ({ page }) => {
// Navigate directly to the session page (cold start - no IDB data) // Navigate directly to the session page (cold start - no IDB data)
await page.goto(`/events/${demo_event_id}/session/${demo_session_id}`); await page.goto(`/events/${testing_event_id}/session/${event_session_id}`);
// 1. Verify session name is visible // 1. Verify session name is visible
await expect(page.getByText('How To Do Things')).toBeVisible({ timeout: 10000 }); await expect(page.getByText('How To Do Things')).toBeVisible({ timeout: 10000 });
@@ -173,7 +173,7 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
}); });
test('verifies IndexedDB contains all nested data after load', async ({ page }) => { test('verifies IndexedDB contains all nested data after load', async ({ page }) => {
await page.goto(`/events/${demo_event_id}/session/${demo_session_id}`); await page.goto(`/events/${testing_event_id}/session/${event_session_id}`);
// Wait for data to be visible (indicating IDB writes completed) // Wait for data to be visible (indicating IDB writes completed)
await expect(page.getByText('Bob The Builder')).toBeVisible({ timeout: 10000 }); await expect(page.getByText('Bob The Builder')).toBeVisible({ timeout: 10000 });

View File

@@ -1,8 +1,8 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_event_id, demo_account_id } from './_helpers/env'; import { testing_event_id, testing_account_id } from './_helpers/env';
const demo_event = demo_event_id; const demo_event = testing_event_id;
test.describe('Cold-start: Event Settings (IndexedDB empty)', () => { test.describe('Cold-start: Event Settings (IndexedDB empty)', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -30,13 +30,13 @@ test.describe('Cold-start: Event Settings (IndexedDB empty)', () => {
mod_abstracts_json: {}, mod_abstracts_json: {},
// Provide a test person id so components that expect an authenticated // Provide a test person id so components that expect an authenticated
// user/person render deterministically in tests // user/person render deterministically in tests
person_id: 'test-person-1', person_id: 'HMQRNPIXQMK', // Per README test data
user: { id: 'test-person-1' }, user: { id: 'HMQRNPIXQMK' }, // Per README test data
mod: { ...defaults.mod, events: { ...defaults.mod.events, event_id: event_id } } mod: { ...defaults.mod, events: { ...defaults.mod.events, event_id: event_id } }
}; };
window.localStorage.setItem('ae_loc', JSON.stringify(testData)); window.localStorage.setItem('ae_loc', JSON.stringify(testData));
}, },
{ defaults: ae_app_local_data_defaults, event_id: demo_event, account_id: demo_account_id } { defaults: ae_app_local_data_defaults, event_id: demo_event, account_id: testing_account_id }
); );
// Navigate to the application's origin so the page context is allowed // Navigate to the application's origin so the page context is allowed

View File

@@ -1,9 +1,9 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_account_id } from './_helpers/env'; import { testing_account_id } from './_helpers/env';
// Use canonical demo journal id for deterministic tests // Use canonical demo journal id for deterministic tests
const demo_journal = 'BVYE-94-46-29'; const journal_id = 'BVYE-94-46-29'; // Per README test data
test.describe('Cold-start: Journal view (IndexedDB empty)', () => { test.describe('Cold-start: Journal view (IndexedDB empty)', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -30,14 +30,14 @@ test.describe('Cold-start: Journal view (IndexedDB empty)', () => {
// Ensure abstract module prop is present for layout/components // Ensure abstract module prop is present for layout/components
mod_abstracts_json: {}, mod_abstracts_json: {},
// Provide a test person id so owner-only pages render in tests // Provide a test person id so owner-only pages render in tests
person_id: 'test-person-1', person_id: 'QWODAPCNLQU', // Per README test data
user: { id: 'test-person-1' } user: { id: 'QWODAPCNLQU' } // Per README test data
}; };
window.localStorage.setItem('ae_loc', JSON.stringify(testData)); window.localStorage.setItem('ae_loc', JSON.stringify(testData));
// Also set a lightweight selection object used by pages // Also set a lightweight selection object used by pages
window.localStorage.setItem('ae_slct', JSON.stringify({ journal_id: journal_id })); window.localStorage.setItem('ae_slct', JSON.stringify({ journal_id: journal_id }));
}, },
{ defaults: ae_app_local_data_defaults, account_id: demo_account_id, journal_id: demo_journal } { defaults: ae_app_local_data_defaults, account_id: testing_account_id, journal_id: journal_id }
); );
// Navigate to the app origin so IndexedDB is available in the page // Navigate to the app origin so IndexedDB is available in the page
@@ -68,7 +68,7 @@ test.describe('Cold-start: Journal view (IndexedDB empty)', () => {
}); });
// Seed IndexedDB with the journal record so local liveQuery finds it // Seed IndexedDB with the journal record so local liveQuery finds it
await page.evaluate(({ demo_journal }) => { await page.evaluate(({ journal_id }) => {
return new Promise<void>((resolve) => { return new Promise<void>((resolve) => {
try { try {
const req = indexedDB.open('ae_journals_db', 1); const req = indexedDB.open('ae_journals_db', 1);
@@ -82,7 +82,8 @@ test.describe('Cold-start: Journal view (IndexedDB empty)', () => {
const db = req.result; const db = req.result;
const tx = db.transaction('journal', 'readwrite'); const tx = db.transaction('journal', 'readwrite');
const store = tx.objectStore('journal'); const store = tx.objectStore('journal');
store.put({ id: demo_journal, journal_id: demo_journal, name: 'Demo Journal (Cold Start Test)', description: 'Created for cold-start Playwright test', person_id: 'test-person-1' }); // Why are both the id and journal_id fields being set?
store.put({ id: journal_id, journal_id: journal_id, name: 'Demo Journal (Cold Start Test)', description: 'Created for cold-start Playwright test', person_id: 'QWODAPCNLQU' }); // Per README test data
tx.oncomplete = () => { tx.oncomplete = () => {
db.close(); db.close();
resolve(); resolve();
@@ -97,20 +98,20 @@ test.describe('Cold-start: Journal view (IndexedDB empty)', () => {
resolve(); resolve();
} }
}); });
}, { demo_journal }); }, { journal_id });
// Mock the journal GET endpoint used by the journal page // Mock the journal GET endpoint used by the journal page
await page.route('**/v3/**', async (route) => { await page.route('**/v3/**', async (route) => {
const req = route.request(); const req = route.request();
const url = req.url(); const url = req.url();
if (url.includes(`/v3/crud/journal/${demo_journal}`) && req.method() === 'GET') { if (url.includes(`/v3/crud/journal/${journal_id}`) && req.method() === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ data: { body: JSON.stringify({ data: {
id: demo_journal, id: journal_id, // Why are both the id and journal_id fields being set?
journal_id: demo_journal, journal_id: journal_id, // Why are both the id and journal_id fields being set?
name: 'Demo Journal (Cold Start Test)', name: 'Demo Journal (Cold Start Test)',
description: 'Created for cold-start Playwright test' description: 'Created for cold-start Playwright test'
} }) } })
@@ -125,7 +126,7 @@ test.describe('Cold-start: Journal view (IndexedDB empty)', () => {
}); });
test('renders Journal page without prior IndexedDB cache', async ({ page }) => { test('renders Journal page without prior IndexedDB cache', async ({ page }) => {
await page.goto(`/journals/${demo_journal}`); await page.goto(`/journals/${journal_id}`);
// The journal title appears in the journal component header // The journal title appears in the journal component header
const journal_name = page.locator('h2.journal__name'); const journal_name = page.locator('h2.journal__name');

View File

@@ -1,9 +1,9 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_event_id, demo_account_id } from './_helpers/env'; import { testing_event_id, testing_account_id } from './_helpers/env';
import { attach_minimal_v3_routes } from './_helpers/minimal_v3_mocks'; import { attach_minimal_v3_routes } from './_helpers/minimal_v3_mocks';
const demo_event = demo_event_id; const event_id = testing_event_id;
test.describe('Event Badge Page - smoke', () => { test.describe('Event Badge Page - smoke', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -12,20 +12,20 @@ test.describe('Event Badge Page - smoke', () => {
if (msg.type() === 'error' || msg.type() === 'warn') console.error(`BROWSER [${msg.type().toUpperCase()}]: ${msg.text()}`); if (msg.type() === 'error' || msg.type() === 'warn') console.error(`BROWSER [${msg.type().toUpperCase()}]: ${msg.text()}`);
}); });
await attach_minimal_v3_routes(page, demo_event); await attach_minimal_v3_routes(page, event_id);
await page.addInitScript((defaults, event_id, account_id) => { await page.addInitScript((defaults, event_id, account_id) => {
const test_data = { ...defaults, account_id: account_id, manager_access: true }; const test_data = { ...defaults, account_id: account_id, manager_access: true };
test_data.mod = { ...defaults.mod, events: { ...defaults.mod.events, event_id } }; test_data.mod = { ...defaults.mod, events: { ...defaults.mod.events, event_id } };
window.localStorage.setItem('ae_loc', JSON.stringify(test_data)); window.localStorage.setItem('ae_loc', JSON.stringify(test_data));
}, ae_app_local_data_defaults, demo_event, demo_account_id); }, ae_app_local_data_defaults, event_id, testing_account_id);
}); });
test('loads badges list without console errors', async ({ page }) => { test('loads badges list without console errors', async ({ page }) => {
const errors: string[] = []; const errors: string[] = [];
page.on('pageerror', (err) => errors.push(err.message)); page.on('pageerror', (err) => errors.push(err.message));
await page.goto(`/events/${demo_event}/badges`); await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) => r.url().includes('site_domain/search') && r.status() === 200); await page.waitForResponse((r) => r.url().includes('site_domain/search') && r.status() === 200);
expect(errors).toHaveLength(0); expect(errors).toHaveLength(0);

View File

@@ -1,8 +1,8 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_event_id, demo_account_id } from './_helpers/env'; import { testing_event_id, testing_account_id } from './_helpers/env';
const test_event_id = demo_event_id; const test_event_id = testing_event_id; // Why is this here? Just using testing_event_id instead?
test.describe('event_badge_crud (create, find, edit, delete)', () => { test.describe('event_badge_crud (create, find, edit, delete)', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -65,10 +65,10 @@ test.describe('event_badge_crud (create, find, edit, delete)', () => {
page.on('dialog', async (dialog) => { await dialog.accept(); }); page.on('dialog', async (dialog) => { await dialog.accept(); });
await page.addInitScript(({ defaults, eventId, accountId }) => { await page.addInitScript(({ defaults, event_id, accountId }) => {
const test_data = { ...defaults, account_id: accountId, manager_access: true, administrator_access: true, edit_mode: true, mod: { ...defaults.mod, events: { ...defaults.mod.events, event_id: eventId } } }; const test_data = { ...defaults, account_id: accountId, manager_access: true, administrator_access: true, edit_mode: true, mod: { ...defaults.mod, events: { ...defaults.mod.events, event_id: event_id } } };
window.localStorage.setItem('ae_loc', JSON.stringify(test_data)); window.localStorage.setItem('ae_loc', JSON.stringify(test_data));
}, { defaults: ae_app_local_data_defaults, eventId: test_event_id, accountId: demo_account_id }); }, { defaults: ae_app_local_data_defaults, event_id: test_event_id, accountId: testing_account_id });
}); });
test('create -> find -> edit -> delete badge', async ({ page }) => { test('create -> find -> edit -> delete badge', async ({ page }) => {
@@ -101,8 +101,8 @@ test.describe('event_badge_crud (create, find, edit, delete)', () => {
// Find badges via search endpoint (simulate listing page) using in-page fetch // Find badges via search endpoint (simulate listing page) using in-page fetch
await page.goto(`/events/${test_event_id}/badges`); await page.goto(`/events/${test_event_id}/badges`);
const search_json = await page.evaluate(async (eventId) => { const search_json = await page.evaluate(async (event_id) => {
const r = await fetch(`/v3/crud/event/${eventId}/event_badge/search`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({}) }); const r = await fetch(`/v3/crud/event/${event_id}/event_badge/search`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({}) });
return await r.json(); return await r.json();
}, test_event_id); }, test_event_id);
expect(Array.isArray(search_json.data)).toBeTruthy(); expect(Array.isArray(search_json.data)).toBeTruthy();
@@ -110,24 +110,24 @@ test.describe('event_badge_crud (create, find, edit, delete)', () => {
// Edit badge via browser fetch (exercise nested update) // Edit badge via browser fetch (exercise nested update)
const edit_resp = await page.evaluate(async (args) => { const edit_resp = await page.evaluate(async (args) => {
const { eventId, badgeId } = args; const { event_id, event_badge_id } = args;
const r = await fetch(`/v3/crud/event/${eventId}/event_badge/${badgeId}/`, { method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ full_name_override: 'Edited User' }) }); const r = await fetch(`/v3/crud/event/${event_id}/event_badge/${event_badge_id}/`, { method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ full_name_override: 'Edited User' }) });
return { status: r.status, json: await r.json() }; return { status: r.status, json: await r.json() };
}, { eventId: test_event_id, badgeId: badge_id }); }, { event_id: test_event_id, event_badge_id: badge_id });
expect(edit_resp.status === 200).toBeTruthy(); expect(edit_resp.status === 200).toBeTruthy();
expect(edit_resp.json.data.full_name_override).toBe('Edited User'); expect(edit_resp.json.data.full_name_override).toBe('Edited User');
// Delete badge via browser fetch // Delete badge via browser fetch
const del_resp = await page.evaluate(async (args) => { const del_resp = await page.evaluate(async (args) => {
const { eventId, badgeId } = args; const { event_id, event_badge_id } = args;
const r = await fetch(`/v3/crud/event/${eventId}/event_badge/${badgeId}/`, { method: 'DELETE' }); const r = await fetch(`/v3/crud/event/${event_id}/event_badge/${event_badge_id}/`, { method: 'DELETE' });
return { status: r.status, ok: r.ok }; return { status: r.status, ok: r.ok };
}, { eventId: test_event_id, badgeId: badge_id }); }, { event_id: test_event_id, event_badge_id: badge_id });
expect(del_resp.ok).toBeTruthy(); expect(del_resp.ok).toBeTruthy();
// Confirm search returns no items // Confirm search returns no items
const post_delete_json = await page.evaluate(async (eventId) => { const post_delete_json = await page.evaluate(async (event_id) => {
const r = await fetch(`/v3/crud/event/${eventId}/event_badge/search`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({}) }); const r = await fetch(`/v3/crud/event/${event_id}/event_badge/search`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({}) });
return await r.json(); return await r.json();
}, test_event_id); }, test_event_id);
expect(Array.isArray(post_delete_json.data)).toBeTruthy(); expect(Array.isArray(post_delete_json.data)).toBeTruthy();

View File

@@ -1,10 +1,10 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_event_id, demo_account_id } from './_helpers/env'; import { testing_event_id, testing_account_id } from './_helpers/env';
const demo_event = demo_event_id; const event_id = testing_event_id;
const demo_badge_id = 'test-badge-123'; const event_badge_id = 'UIJT-73-63-61'; // Per README test data
const demo_template_id = 'jgfixEpYp1B'; const event_badge_template_id = 'jgfixEpYp1B'; // Per README test data
test.describe('Badge Data Integrity & Field Mapping', () => { test.describe('Badge Data Integrity & Field Mapping', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -29,7 +29,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}; };
window.localStorage.setItem('ae_loc', JSON.stringify(testData)); window.localStorage.setItem('ae_loc', JSON.stringify(testData));
}, },
{ defaults: ae_app_local_data_defaults, event_id: demo_event, account_id: demo_account_id } { defaults: ae_app_local_data_defaults, event_id: event_id, account_id: testing_account_id }
); );
// Mock V3 API with realistic enriched responses // Mock V3 API with realistic enriched responses
@@ -46,14 +46,14 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}); });
} }
if (url.includes(`/v3/crud/event/${demo_event}`) && method === 'GET') { if (url.includes(`/v3/crud/event/${event_id}`) && method === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: { data: {
id: demo_event, id: event_id, // Why are both the id and event_id fields being set?
event_id: demo_event, event_id: event_id, // Why are both the id and event_id fields being set?
name: 'Badge Integrity Test Event', name: 'Badge Integrity Test Event',
cfg_json: {}, cfg_json: {},
mod_pres_mgmt_json: {}, mod_pres_mgmt_json: {},
@@ -67,17 +67,17 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
} }
// Badge search with enriched fields // Badge search with enriched fields
if (url.includes(`/v3/crud/event/${demo_event}/event_badge/search`) && method === 'POST') { if (url.includes(`/v3/crud/event/${event_id}/event_badge/search`) && method === 'POST') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: [ data: [
{ {
id: demo_badge_id, id: event_badge_id,
event_badge_id: demo_badge_id, event_badge_id: event_badge_id,
event_id: demo_event, event_id: event_id,
event_badge_template_id: demo_template_id, event_badge_template_id: event_badge_template_id,
full_name_override: 'Jane Smith', full_name_override: 'Jane Smith',
given_name: 'Jane', given_name: 'Jane',
family_name: 'Smith', family_name: 'Smith',
@@ -105,16 +105,16 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
} }
// Badge template list // Badge template list
if (url.includes(`/v3/crud/event/${demo_event}/event_badge_template`) && method === 'GET') { if (url.includes(`/v3/crud/event/${event_id}/event_badge_template`) && method === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: [ data: [
{ {
id: demo_template_id, id: event_badge_template_id,
event_badge_template_id: demo_template_id, event_badge_template_id: event_badge_template_id,
event_id: demo_event, event_id: event_id,
name: 'Standard Template 2026', name: 'Standard Template 2026',
header_path: '/images/header.png', header_path: '/images/header.png',
logo_path: '/images/logo.png', logo_path: '/images/logo.png',
@@ -136,15 +136,15 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
} }
// Badge template GET by ID // Badge template GET by ID
if (url.includes(`/v3/crud/event_badge_template/${demo_template_id}`) && method === 'GET') { if (url.includes(`/v3/crud/event_badge_template/${event_badge_template_id}`) && method === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ body: JSON.stringify({
data: { data: {
id: demo_template_id, id: event_badge_template_id,
event_badge_template_id: demo_template_id, event_badge_template_id: event_badge_template_id,
event_id: demo_event, event_id: event_id,
name: 'Standard Template 2026', name: 'Standard Template 2026',
header_path: '/images/header.png', header_path: '/images/header.png',
logo_path: '/images/logo.png', logo_path: '/images/logo.png',
@@ -171,7 +171,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}); });
test('Badge list loads without crashing', async ({ page }) => { test('Badge list loads without crashing', async ({ page }) => {
await page.goto(`/events/${demo_event}/badges`); await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) => await page.waitForResponse((r) =>
r.url().includes('event_badge/search') && r.status() === 200 r.url().includes('event_badge/search') && r.status() === 200
@@ -191,7 +191,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}); });
test('Badge template list loads and displays all templates', async ({ page }) => { test('Badge template list loads and displays all templates', async ({ page }) => {
await page.goto(`/events/${demo_event}/templates`); await page.goto(`/events/${event_id}/templates`);
await page.waitForResponse((r) => await page.waitForResponse((r) =>
r.url().includes('event_badge_template') && r.status() === 200 r.url().includes('event_badge_template') && r.status() === 200
@@ -209,7 +209,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}); });
test('Badge template form fields render correctly', async ({ page }) => { test('Badge template form fields render correctly', async ({ page }) => {
await page.goto(`/events/${demo_event}/templates`); await page.goto(`/events/${event_id}/templates`);
// Click "Add New Template" button // Click "Add New Template" button
const add_btn = page.getByRole('button', { name: /Add New Template/i }); const add_btn = page.getByRole('button', { name: /Add New Template/i });
@@ -224,7 +224,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}); });
test('Badge template values persist in form when editing', async ({ page }) => { test('Badge template values persist in form when editing', async ({ page }) => {
await page.goto(`/events/${demo_event}/templates`); await page.goto(`/events/${event_id}/templates`);
await page.waitForResponse((r) => await page.waitForResponse((r) =>
r.url().includes('event_badge_template') && r.status() === 200 r.url().includes('event_badge_template') && r.status() === 200
@@ -255,7 +255,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
(window as any).aetherNative = undefined; (window as any).aetherNative = undefined;
}); });
await page.goto(`/events/${demo_event}/badges`); await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) => await page.waitForResponse((r) =>
r.url().includes('event_badge/search') && r.status() === 200, r.url().includes('event_badge/search') && r.status() === 200,
@@ -283,9 +283,9 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
body: JSON.stringify({ body: JSON.stringify({
data: [ data: [
{ {
id: demo_badge_id, id: event_badge_id,
event_badge_id: demo_badge_id, event_badge_id: event_badge_id,
event_id: demo_event, event_id: event_id,
full_name_override: 'Minimal Badge', full_name_override: 'Minimal Badge',
enable: true, enable: true,
priority: 0, priority: 0,
@@ -299,7 +299,7 @@ test.describe('Badge Data Integrity & Field Mapping', () => {
}); });
}); });
await page.goto(`/events/${demo_event}/badges`); await page.goto(`/events/${event_id}/badges`);
await page.waitForResponse((r) => await page.waitForResponse((r) =>
r.url().includes('event_badge/search') && r.status() === 200, r.url().includes('event_badge/search') && r.status() === 200,

View File

@@ -1,8 +1,8 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_event_id, demo_account_id } from './_helpers/env'; import { testing_event_id, testing_account_id } from './_helpers/env';
const demo_event = demo_event_id; const event_id = testing_event_id;
test.describe('Event Badge - interaction', () => { test.describe('Event Badge - interaction', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -18,13 +18,13 @@ test.describe('Event Badge - interaction', () => {
const url = req.url(); const url = req.url();
// Provide the minimal event payload for the settings page to render // Provide the minimal event payload for the settings page to render
if (url.includes(`/v3/crud/event/${demo_event}`) && req.method() === 'GET') { if (url.includes(`/v3/crud/event/${event_id}`) && req.method() === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ data: { body: JSON.stringify({ data: {
id: demo_event, id: event_id,
event_id: demo_event, event_id: event_id,
name: 'Test Event for Badge Interaction', name: 'Test Event for Badge Interaction',
cfg_json: {}, cfg_json: {},
mod_pres_mgmt_json: {}, mod_pres_mgmt_json: {},
@@ -37,7 +37,7 @@ test.describe('Event Badge - interaction', () => {
} }
// For badge create requests, return a simple created envelope with a fixed id. // For badge create requests, return a simple created envelope with a fixed id.
if (url.includes(`/v3/crud/event/${demo_event}/event_badge`) && req.method() === 'POST') { if (url.includes(`/v3/crud/event/${event_id}/event_badge`) && req.method() === 'POST') {
return route.fulfill({ status: 201, contentType: 'application/json', body: JSON.stringify({ data: { event_badge_id: 'new-badge-1' } }) }); return route.fulfill({ status: 201, contentType: 'application/json', body: JSON.stringify({ data: { event_badge_id: 'new-badge-1' } }) });
} }
@@ -61,12 +61,12 @@ test.describe('Event Badge - interaction', () => {
}; };
window.localStorage.setItem('ae_loc', JSON.stringify(testData)); window.localStorage.setItem('ae_loc', JSON.stringify(testData));
}, },
{ defaults: ae_app_local_data_defaults, event_id: demo_event, account_id: demo_account_id } { defaults: ae_app_local_data_defaults, event_id: event_id, account_id: testing_account_id }
); );
}); });
test('creates a badge via UI and posts to nested endpoint', async ({ page }) => { test('creates a badge via UI and posts to nested endpoint', async ({ page }) => {
await page.goto(`/events/${demo_event}/settings`); await page.goto(`/events/${event_id}/settings`);
const add_btn = page.getByRole('button', { name: 'Add New Badge' }); const add_btn = page.getByRole('button', { name: 'Add New Badge' });
await expect(add_btn).toBeVisible(); await expect(add_btn).toBeVisible();
@@ -89,7 +89,7 @@ test.describe('Event Badge - interaction', () => {
await allow_tracking_checkbox.check(); await allow_tracking_checkbox.check();
const [create_request] = await Promise.all([ const [create_request] = await Promise.all([
page.waitForRequest((r) => r.url().includes(`/v3/crud/event/${demo_event}/event_badge`) && r.method() === 'POST'), page.waitForRequest((r) => r.url().includes(`/v3/crud/event/${event_id}/event_badge`) && r.method() === 'POST'),
page.getByRole('button', { name: 'Create Badge' }).click() page.getByRole('button', { name: 'Create Badge' }).click()
]); ]);

View File

@@ -1,9 +1,9 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
import { ae_app_local_data_defaults } from './_helpers/ae_defaults'; import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
import { demo_event_id, demo_account_id } from './_helpers/env'; import { testing_event_id, testing_account_id } from './_helpers/env';
import { attach_minimal_v3_routes } from './_helpers/minimal_v3_mocks'; import { attach_minimal_v3_routes } from './_helpers/minimal_v3_mocks';
const demo_event = demo_event_id; const event_id = testing_event_id;
test.describe('Event Presenter Page - smoke', () => { test.describe('Event Presenter Page - smoke', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -12,21 +12,21 @@ test.describe('Event Presenter Page - smoke', () => {
if (msg.type() === 'error' || msg.type() === 'warn') console.error(`BROWSER [${msg.type().toUpperCase()}]: ${msg.text()}`); if (msg.type() === 'error' || msg.type() === 'warn') console.error(`BROWSER [${msg.type().toUpperCase()}]: ${msg.text()}`);
}); });
await attach_minimal_v3_routes(page, demo_event); await attach_minimal_v3_routes(page, event_id);
await page.addInitScript((defaults, event_id, account_id) => { await page.addInitScript((defaults, event_id, account_id) => {
const test_data = { ...defaults, account_id: account_id, manager_access: true }; const test_data = { ...defaults, account_id: account_id, manager_access: true };
// ensure the events module has the event id available // ensure the events module has the event id available
test_data.mod = { ...defaults.mod, events: { ...defaults.mod.events, event_id } }; test_data.mod = { ...defaults.mod, events: { ...defaults.mod.events, event_id } };
window.localStorage.setItem('ae_loc', JSON.stringify(test_data)); window.localStorage.setItem('ae_loc', JSON.stringify(test_data));
}, ae_app_local_data_defaults, demo_event, demo_account_id); }, ae_app_local_data_defaults, event_id, testing_account_id);
}); });
test('opens presenter editor without throwing', async ({ page }) => { test('opens presenter editor without throwing', async ({ page }) => {
const errors: string[] = []; const errors: string[] = [];
page.on('pageerror', (e) => errors.push(e.message)); page.on('pageerror', (e) => errors.push(e.message));
await page.goto(`/events/${demo_event}/presenters`); await page.goto(`/events/${event_id}/presenters`);
await page.waitForResponse((r) => r.url().includes('site_domain/search') && r.status() === 200); await page.waitForResponse((r) => r.url().includes('site_domain/search') && r.status() === 200);
expect(errors).toHaveLength(0); expect(errors).toHaveLength(0);

View File

@@ -62,7 +62,7 @@ test('detect private/local network requests and PNA preflights', async ({ page }
// CDP not available in this context; continue with high-level capture // CDP not available in this context; continue with high-level capture
} }
await page.goto('http://demo.localhost:5173/'); await page.goto('http://demo.localhost:5173/'); // Per README test data
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
// Report findings for easier debugging // Report findings for easier debugging

View File

@@ -25,7 +25,7 @@ import { ae_app_local_data_defaults } from './_helpers/ae_defaults';
* validate the refactored data-handling logic. * validate the refactored data-handling logic.
*/ */
const testEventId = 'pjrcghqwert'; const testing_event_id = 'pjrcghqwert'; // Per README test data
test.describe('V3 API Nested CRUD Integrity', () => { test.describe('V3 API Nested CRUD Integrity', () => {
test.setTimeout(7000); test.setTimeout(7000);
@@ -50,24 +50,24 @@ test.describe('V3 API Nested CRUD Integrity', () => {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ data: [{ id: 'test-site-domain-id', site_id: 'test-site-id', account_id: '_XY7DXtc9MY' }] }) body: JSON.stringify({ data: [{ id: '_6jcTbnJk-o', site_id: '_6jcTbnJk-o', account_id: '_XY7DXtc9MY' }] }) // Per README test data
}); });
} }
// Mock the parent event object so the page can load // Mock the parent event object so the page can load
if (url.includes(`/v3/crud/event/${testEventId}`) && req.method() === 'GET') { if (url.includes(`/v3/crud/event/${testing_event_id}`) && req.method() === 'GET') {
return route.fulfill({ return route.fulfill({
status: 200, status: 200,
contentType: 'application/json', contentType: 'application/json',
body: JSON.stringify({ data: { id: testEventId, event_id: testEventId, name: 'Test Event for Nested CRUD' } }) body: JSON.stringify({ data: { id: testing_event_id, event_id: testing_event_id, name: 'Test Event for Nested CRUD' } })
}); });
} }
// For nested create endpoint, capture and forward (fulfill) with created object // For nested create endpoint, capture and forward (fulfill) with created object
if (url.includes(`/v3/crud/event/${testEventId}/event_location`) && req.method() === 'POST') { if (url.includes(`/v3/crud/event/${testing_event_id}/event_location`) && req.method() === 'POST') {
const post = await req.postData(); const post = await req.postData();
console.log('Captured POST to nested endpoint:', url, post ? post.slice(0,200) : ''); console.log('Captured POST to nested endpoint:', url, post ? post.slice(0,200) : '');
return route.fulfill({ status: 201, contentType: 'application/json', body: JSON.stringify({ data: { event_location_id: 'new-loc-1', name: 'TEMP Location Name', event_id: testEventId } }) }); return route.fulfill({ status: 201, contentType: 'application/json', body: JSON.stringify({ data: { event_location_id: 'new-loc-1', name: 'TEMP Location Name', event_id: testing_event_id } }) });
} }
// Default mock for other /v3/ calls // Default mock for other /v3/ calls
@@ -93,11 +93,11 @@ test.describe('V3 API Nested CRUD Integrity', () => {
}; };
window.localStorage.setItem('ae_loc', JSON.stringify(testData)); window.localStorage.setItem('ae_loc', JSON.stringify(testData));
}, },
{ defaults: ae_app_local_data_defaults, eventId: testEventId } { defaults: ae_app_local_data_defaults, eventId: testing_event_id }
); );
// Navigate to the page for each test. // Navigate to the page for each test.
await page.goto(`/events/${testEventId}/locations`); await page.goto(`/events/${testing_event_id}/locations`);
}); });
test('should send a nested request when creating an Event Location', async ({ page }) => { test('should send a nested request when creating an Event Location', async ({ page }) => {
@@ -124,7 +124,7 @@ test.describe('V3 API Nested CRUD Integrity', () => {
body: JSON.stringify({ name: 'TEMP Location Name', event_id: eventId }) body: JSON.stringify({ name: 'TEMP Location Name', event_id: eventId })
}); });
try { return { status: r.status, json: await r.json() }; } catch(e) { return { status: r.status, json: null }; } try { return { status: r.status, json: await r.json() }; } catch(e) { return { status: r.status, json: null }; }
}, testEventId as any); }, testing_event_id as any);
expect(resp.status === 200 || resp.status === 201).toBeTruthy(); expect(resp.status === 200 || resp.status === 201).toBeTruthy();
expect(resp.json).toBeDefined(); expect(resp.json).toBeDefined();
@@ -136,7 +136,7 @@ test.describe('V3 API Nested CRUD Integrity', () => {
// const postData = request.postDataJSON(); // const postData = request.postDataJSON();
// Assert that the request was sent to the correct nested URL // Assert that the request was sent to the correct nested URL
// expect(request.url()).toContain(`/v3/crud/event/${testEventId}/event_location`); // expect(request.url()).toContain(`/v3/crud/event/${testing_event_id}/event_location`);
// Assert that the payload contains the correct fields and *does not* contain the parent ID // Assert that the payload contains the correct fields and *does not* contain the parent ID
// expect(postData.fields).toBeDefined(); // expect(postData.fields).toBeDefined();

View File

@@ -55,12 +55,12 @@ test.describe('V3 API Header Integrity (modernized)', () => {
}); });
test('Verify Account ID Scavenging from localStorage on CRUD requests', async ({ page }) => { test('Verify Account ID Scavenging from localStorage on CRUD requests', async ({ page }) => {
const testAccountId = 'scavenged-account-id-123'; const test_account_id = '_XY7DXtc9MY'; // Per README test data
await page.addInitScript(({ defaults, id }) => { await page.addInitScript(({ defaults, id }) => {
const testData = { ...defaults, account_id: id, manager_access: true }; const testData = { ...defaults, account_id: id, manager_access: true };
window.localStorage.setItem('ae_loc', JSON.stringify(testData)); window.localStorage.setItem('ae_loc', JSON.stringify(testData));
}, { defaults: ae_app_local_data_defaults, id: testAccountId }); }, { defaults: ae_app_local_data_defaults, id: test_account_id });
const requestPromise = page.waitForRequest((request) => request.url().includes('/v3/crud/user/search')); const requestPromise = page.waitForRequest((request) => request.url().includes('/v3/crud/user/search'));
@@ -69,6 +69,6 @@ test.describe('V3 API Header Integrity (modernized)', () => {
const request = await requestPromise; const request = await requestPromise;
const headers = request.headers(); const headers = request.headers();
expect(headers['x-account-id']).toBe(testAccountId); expect(headers['x-account-id']).toBe(test_account_id);
}); });
}); });