DigitalConsumer.FixMyGlass/playwright-tests/business-logic/rules/RuleEngineBuiltins.ts
maguire-arman 404dda6556 Adds Playwright test framework for FMG
Initial commit of the Playwright test framework, including:
- Configuration files for Playwright, Docker, and Sauce Labs
- Test case structure and page object models
- CI/CD pipeline configuration
- Utilities and business logic implementations

This framework will be used for end-to-end testing of the FMG application.
2025-04-07 15:40:31 -04:00

44 lines
No EOL
1.5 KiB
TypeScript

import TestCase from "@business-logic/types/TestCase";
import { Rule } from "../types/RuleEngine";
import EnumUtils from "../../impl/utils/EnumUtils";
// File containing Rule Engine Builtin Rules for JSON Data Validation
export enum BuiltInRules {
//Custom Rules
}
// Built-Ins shouldn't depend on other rules, custom rules however are supposed to depend on them
export const builtInRules: Rule<TestCase>[] =
[
//{
// id: BuiltInRules.TransactionExists,
// name: "Transaction Exists Rule",
// check: (testCase: TestCase) => {
// return testCase.transaction != null;
// }
// }, {
// id: BuiltInRules.PricingExists,
// name: "Pricing must exist on Transaction Rule",
// check: (testCase: TestCase) => {
// return testCase.transaction != null && testCase.transaction.pricing != null;
// }
// }, {
// id: BuiltInRules.TerminationIsMod,
// name: "OpportunityType Termination requires TransactionSubType Mod",
// check: (testCase: TestCase) => {
// // Check old transactions
// for (var transaction of testCase.oldTransactions) {
// if (transaction.opportunityType == OpportunityTypes.Termination)
// return transaction.subType == TransactionSubTypes.Mod;
// }
// // Check transaction
// if (testCase.transaction.opportunityType == OpportunityTypes.Termination)
// return testCase.transaction.subType == TransactionSubTypes.Mod;
// return true;
// },
// dependsOn: [BuiltInRules.TransactionExists]
// }, {
];