import { test } from '@playwright/test';

export type AutomationStatus = 'automated' | 'partial' | 'manual';

/**
 * Marks a test as MANUAL — annotates it and skips execution in automated runs.
 * The test body should document the required manual steps as comments.
 *
 * In the HTML test plan report this test appears as 🔴 MANUAL.
 */
export function markManual(reason: string): void {
  test.info().annotations.push({ type: 'automationStatus', description: 'manual' });
  test.info().annotations.push({ type: 'manualReason', description: reason });
  test.skip(true, `⚠️  MANUAL TEST — ${reason}`);
}

/**
 * Marks a test as PARTIALLY automatable — automated steps run normally;
 * manual steps are annotated but skipped.
 *
 * In the HTML test plan report this test appears as ⚡ PARTIAL.
 */
export function markPartial(notes: string): void {
  test.info().annotations.push({ type: 'automationStatus', description: 'partial' });
  test.info().annotations.push({ type: 'partialNotes', description: notes });
}

/** Tags a test as "write" type — the result must be attached to the report. */
export function markWrite(): void {
  test.info().annotations.push({ type: 'testType', description: 'write' });
}
