- Created Page Object Model structure for all trainer-facing pages - Implemented complete test coverage for trainer journey steps 1-8 - Added centralized test data management with test users and events - Updated run-tests.sh with --trainer-journey option for easy execution - Enhanced documentation with test setup, usage, and troubleshooting guides - Created verification scripts to ensure proper test environment setup - Prepared framework for Phase 2/3 features (email, check-in, certificates) This implementation provides a solid foundation for testing the complete trainer user journey and can be easily extended as new features are deployed.
80 lines
2.5 KiB
TypeScript
80 lines
2.5 KiB
TypeScript
import { defineConfig, devices } from '@playwright/test';
|
|
import { config as dotenvConfig } from 'dotenv';
|
|
import path from 'path';
|
|
import { VerbosityController, VerbosityLevel, parseVerbosityArgs } from './tests/e2e/utils/VerbosityController';
|
|
import { createCustomReporter } from './tests/e2e/reporters/reporterFactory';
|
|
|
|
// Load environment variables
|
|
dotenvConfig();
|
|
|
|
// Set minimal verbosity
|
|
const verbosity = VerbosityController.getInstance();
|
|
verbosity.setLevel(VerbosityLevel.MINIMAL);
|
|
|
|
// Staging server configuration
|
|
export const STAGING_CONFIG = {
|
|
url: 'wordpress-974670-5399585.cloudwaysapps.com',
|
|
ip: '146.190.76.204',
|
|
sshUser: 'roodev',
|
|
path: '/home/974670.cloudwaysapps.com/uberrxmprk/public_html'
|
|
} as const;
|
|
|
|
export default defineConfig({
|
|
testDir: './tests/e2e',
|
|
timeout: 30000,
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
|
|
// Minimal reporting configuration
|
|
reporter: [
|
|
['dot'], // Most minimal reporter - just shows dots for passes and brief failure messages
|
|
],
|
|
|
|
// Global test configuration
|
|
use: {
|
|
baseURL: `https://${STAGING_CONFIG.url}`,
|
|
trace: 'retain-on-failure',
|
|
|
|
// Screenshot configuration based on verbosity
|
|
screenshot: {
|
|
mode: 'only-on-failure',
|
|
fullPage: true
|
|
},
|
|
|
|
// Video configuration based on verbosity
|
|
video: {
|
|
mode: 'retain-on-failure',
|
|
size: { width: 1280, height: 720 }
|
|
},
|
|
|
|
// Minimal logging configuration
|
|
contextOptions: {
|
|
logger: {
|
|
isEnabled: (name, severity) => severity === 'error', // Only enable error logging
|
|
log: (name, severity, message) => {
|
|
if (severity === 'error') {
|
|
console.error(`[${name}] ${message}`);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
|
|
// Test projects configuration
|
|
// REDUCED: Only run tests on Chromium desktop for faster, focused CI.
|
|
projects: [
|
|
{
|
|
name: 'chromium',
|
|
use: {
|
|
...devices['Desktop Chrome'],
|
|
viewport: { width: 1920, height: 1080 }
|
|
},
|
|
}
|
|
],
|
|
|
|
// Global setup configuration
|
|
globalSetup: require.resolve('./tests/e2e/global-setup'),
|
|
globalTeardown: require.resolve('./tests/e2e/global-teardown'),
|
|
});
|