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

@@ -1,14 +1,14 @@
import { test, expect } from '@playwright/test';
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
// Session: (703) "How To Do Things"
// Presentation: (1670) "Build a House"
// Presenter: (2202) "Bob The Builder"
const demo_session_id = 'DOW3h7v6H42';
const demo_presentation_id = '7U2eXSjR6H4';
const demo_presenter_id = 'gT-hxnifb-0';
const event_session_id = 'DOW3h7v6H42'; // Per README test data
const event_presentation_id = '7U2eXSjR6H4'; // Per README test data
const event_presenter_id = 'gT-hxnifb-0'; // Per README test data
test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
test.beforeEach(async ({ page }) => {
@@ -21,7 +21,7 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
// Provide app localStorage before any scripts run
await page.addInitScript(
({ defaults, event_id, account_id }) => {
const testData = {
const test_data = {
...defaults,
account_id: account_id,
administrator_access: true,
@@ -31,13 +31,13 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
super_access: false,
edit_mode: true,
mod_abstracts_json: {},
person_id: 'test-person-1',
user: { id: 'test-person-1' },
person_id: 'QWODAPCNLQU', // Per README test data
user: { id: 'QWODAPCNLQU' }, // Per README test data
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
@@ -76,22 +76,22 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
const method = req.method();
// 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({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
data: {
id: demo_session_id,
event_session_id: demo_session_id,
event_id: demo_event_id,
id: event_session_id,
event_session_id: event_session_id,
event_id: testing_event_id,
name: 'How To Do Things',
code: 'how-to-do-things',
start_datetime: '2026-03-01T10:00:00Z',
end_datetime: '2026-03-01T11:00:00Z',
description: 'Cold start test session',
event_location_id: 'test-location-1',
poc_person_id: 'test-person-1',
event_location_id: 'VXXY-98-46-14', // Per README test data
poc_person_id: 'QWODAPCNLQU', // Per README test data
cfg_json: {},
mod_pres_mgmt_json: {}
}
@@ -100,17 +100,17 @@ test.describe('Cold-start: Event Session (IndexedDB empty)', () => {
}
// 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({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
data: [
{
id: demo_presentation_id,
event_presentation_id: demo_presentation_id,
event_session_id: demo_session_id,
event_id: demo_event_id,
id: event_presentation_id,
event_presentation_id: event_presentation_id,
event_session_id: event_session_id,
event_id: testing_event_id,
name: 'Build a House',
code: 'build-house',
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
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({
status: 200,
contentType: 'application/json',
body: JSON.stringify({
data: [
{
id: demo_presenter_id,
event_presenter_id: demo_presenter_id,
event_presentation_id: demo_presentation_id,
event_session_id: demo_session_id,
event_id: demo_event_id,
id: event_presenter_id,
event_presenter_id: event_presenter_id,
event_presentation_id: event_presentation_id,
event_session_id: event_session_id,
event_id: testing_event_id,
given_name: 'Bob',
family_name: '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 }) => {
// 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
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 }) => {
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)
await expect(page.getByText('Bob The Builder')).toBeVisible({ timeout: 10000 });