All files / generators/_collections preset-configs.const.ts

100% Statements 81/81
100% Branches 0/0
100% Functions 0/0
100% Lines 81/81

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 821x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import { DyE2E_FormSuiteGenerate_Options } from '../_models/form-suite-generate-options.interface';
import { DyE2E_ViewportSuiteGenerate_Options } from '../_models/viewport-suite-generate-options.interface';
import { DyE2E_CWVSuiteGenerate_Options } from '../../cwv/_models/cwv-suite-generate-options.interface';
import { DyE2E_TestRunMode_Type } from '../../contracts/_enums/test-run-mode-type.enum';
 
/**
 * Preset config templates — consumer-projekt copy-paste-eli ezeket
 * a `dye2e generate-*` parancsok-hoz.
 */
 
export const DYE2E_PRESET_LOGIN_FORM: DyE2E_FormSuiteGenerate_Options = {
  formSettings: {
    key: 'login',
    fields: [
      { key: 'email', type: 'text', label: 'Email', required: true, maxLength: 254, testId: 'login-email' },
      { key: 'password', type: 'password', label: 'Password', required: true, minLength: 8, maxLength: 128, testId: 'login-password' },
      { key: 'rememberMe', type: 'checkbox', label: 'Remember me', required: false, testId: 'login-remember' },
    ],
  },
  formRoute: '/login',
  formSelector: 'dynamo-form-new',
  suiteSettings: {
    runMode: DyE2E_TestRunMode_Type.full,
    describePrefix: 'Login form',
  },
};
 
export const DYE2E_PRESET_REGISTER_FORM: DyE2E_FormSuiteGenerate_Options = {
  formSettings: {
    key: 'register',
    fields: [
      { key: 'username', type: 'text', label: 'Username', required: true, minLength: 3, maxLength: 32, testId: 'register-username' },
      { key: 'email', type: 'text', label: 'Email', required: true, maxLength: 254, testId: 'register-email' },
      { key: 'password', type: 'password', label: 'Password', required: true, minLength: 8, maxLength: 128, testId: 'register-password' },
      { key: 'passwordConfirm', type: 'password', label: 'Confirm Password', required: true, minLength: 8, testId: 'register-password-confirm' },
      { key: 'acceptedTerms', type: 'checkbox', label: 'Accept terms', required: true, testId: 'register-accepted-terms' },
    ],
  },
  formRoute: '/register',
  formSelector: 'dynamo-form-new',
  suiteSettings: {
    runMode: DyE2E_TestRunMode_Type.full,
    describePrefix: 'Register form',
  },
};
 
export const DYE2E_PRESET_VIEWPORT_AUDIT_STANDARD: DyE2E_ViewportSuiteGenerate_Options = {
  routes: [
    { key: 'home', label: 'Home', path: '/' },
    { key: 'login', label: 'Login', path: '/login' },
  ],
  themes: ['dark'],
  checkOverflow: true,
  checkTouchTargets: true,
  takeScreenshot: true,
  screenshotDir: 'e2e/screenshots',
};
 
export const DYE2E_PRESET_CWV_DIAG_STANDARD: DyE2E_CWVSuiteGenerate_Options = {
  routes: [
    { key: 'home', label: 'Home', path: '/' },
    { key: 'login', label: 'Login', path: '/login' },
  ],
  iterationsPerRoute: 5,
  thresholds: {
    lcp_p75_ms: 2500,
    cls_p75: 0.1,
    inp_p75_ms: 200,
    ttfb_p75_ms: 800,
    fcp_p75_ms: 1800,
  },
  reportDir: 'e2e/cwv-report',
};
 
/** Map a preset-kulcsoktol a config-objektumig — `dye2e preset --name <key>` parancshoz. */
export const DYE2E_PRESET_REGISTRY: Record<string, unknown> = {
  'login-form': DYE2E_PRESET_LOGIN_FORM,
  'register-form': DYE2E_PRESET_REGISTER_FORM,
  'viewport-audit-standard': DYE2E_PRESET_VIEWPORT_AUDIT_STANDARD,
  'cwv-diag-standard': DYE2E_PRESET_CWV_DIAG_STANDARD,
};