DigitalConsumer.FixMyGlass/playwright-tests/business-logic/rules/RuleEngineBuiltins.ts
maguire-arman a2ca9134d1 Initializes Playwright test framework
Sets up the core infrastructure for Playwright-based automated testing, including:
- Docker support for consistent environments
- Azure Pipelines configuration for CI/CD
- Page Object Model structure for maintainable tests
- Test data, validation, and rule engine implementation
- Test configuration for alerts and other scenarios
2025-05-08 15:45:05 -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]
// }, {
];