1- import { test } from "../../../utils/eyesFixture" ;
2- import { PRODUCT_SEARCH_BFF_SPEC_FIX_TYPO } from "../../specNames" ;
1+ import { test , expect } from "../../../utils/eyesFixture" ;
2+ import {
3+ PRODUCT_SEARCH_BFF_SPEC_FIX_TYPO ,
4+ ORDER_BFF_SERVICE_URL ,
5+ } from "../../specNames" ;
36import { ServiceSpecConfigPage } from "../../../page-objects/service-spec-config-page" ;
7+ import { ApiContractPage } from "../../../page-objects/api-contract-page" ;
8+ import { validateSummaryAndTableCounts } from "../helpers/execute-contract-tests-helper" ;
49
510test . describe ( "Fix Spec Typo - Conditional Update" , ( ) => {
611 test (
@@ -14,12 +19,41 @@ test.describe("Fix Spec Typo - Conditional Update", () => {
1419 PRODUCT_SEARCH_BFF_SPEC_FIX_TYPO ,
1520 ) ;
1621
22+ const contractPage = new ApiContractPage (
23+ page ,
24+ testInfo ,
25+ eyes ,
26+ PRODUCT_SEARCH_BFF_SPEC_FIX_TYPO ,
27+ ) ;
28+
1729 await configPage . navigateToSpec ( PRODUCT_SEARCH_BFF_SPEC_FIX_TYPO ) ;
1830
1931 await test . step ( "Typo detected: Fixing /ordres to /orders" , async ( ) => {
2032 await configPage . editSpecInEditor ( " /ordres:" , " /orders:" ) ;
2133 await configPage . clickSaveAfterEdit ( ) ;
34+ } ) ;
35+
36+ //TODO: Add Backward Compatibility
37+ await test . step ( "Check Backward Compataibility" , async ( ) => {
38+ await configPage . runBackwardCompatibilityTest ( ) ;
39+ const toastText = await configPage . getAlertMessageText ( ) ;
40+ expect ( toastText ) . toBe ( "Changes are backward compatible" ) ;
41+ await configPage . dismissAlert ( ) ;
42+ await expect ( page . locator ( "#alert-container" ) ) . toBeEmpty ( ) ;
43+ } ) ;
44+ //TODO: RUn Contract Test and Assert Count
45+ await test . step ( "Run contract test for spec with fixed typo and assert count" , async ( ) => {
2246 await configPage . verifyEndpointInContractTable ( "/orders" ) ;
47+ await contractPage . enterServiceUrl ( ORDER_BFF_SERVICE_URL ) ;
48+ await contractPage . clickRunContractTests ( ) ;
49+ await validateSummaryAndTableCounts ( contractPage , {
50+ success : 12 ,
51+ failed : 20 ,
52+ total : 33 ,
53+ error : 0 ,
54+ notcovered : 1 ,
55+ excluded : 0 ,
56+ } ) ;
2357 } ) ;
2458 } ,
2559 ) ;
0 commit comments