Files
frontend-judge/backend/src/types.ts
T
2026-07-07 09:29:56 +03:00

46 lines
906 B
TypeScript

export type CheckType =
| "selector-exists"
| "text-contains"
| "attribute-equals"
| "css-property"
| "element-count"
| "interaction-text-contains"
| "interaction-attribute-equals"
| "interaction-css-property"
| "interaction-element-count"
| "visual-match";
export type CheckDefinition = {
id?: string;
type: CheckType;
selector?: string;
value?: string;
attribute?: string;
property?: string;
actionSelector?: string;
inputSelector?: string;
inputValue?: string;
count?: number;
threshold?: number;
weight?: number;
message: string;
};
export type CheckResult = {
type: CheckType;
message: string;
passed: boolean;
details?: string;
score?: number;
weight?: number;
};
export type JudgeResult = {
passed: boolean;
score: number;
passingScore: number;
results: CheckResult[];
screenshotPath?: string;
diffScreenshotPath?: string;
};