Skip to content

Commit a170470

Browse files
committed
feat: Added error dropdown expansion if visible for CI
1 parent ed0ccb7 commit a170470

File tree

1 file changed

+52
-12
lines changed

1 file changed

+52
-12
lines changed

specs/openapi/execute-contract-tests/execute-contract-tests-excluded.spec.ts

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
verifyRightSidebarStatus,
1010
} from "../helpers/execute-contract-tests-helper";
1111

12-
1312
type Counts = Parameters<typeof validateSummaryAndTableCounts>[1];
1413

1514
async function runAndVerifyCounts(
@@ -18,6 +17,7 @@ async function runAndVerifyCounts(
1817
) {
1918
await contractPage.enterServiceUrl(ORDER_BFF_SERVICE_URL);
2019
await contractPage.clickRunContractTests();
20+
await contractPage.handlePrereqErrorIfVisible();
2121
await verifyRightSidebarStatus(
2222
contractPage,
2323
"Done",
@@ -32,7 +32,6 @@ async function runAndVerifyCounts(
3232
await validateSummaryAndTableCounts(contractPage, expectedCounts);
3333
}
3434

35-
3635
test.describe("API Contract testing with test exclusion and inclusion", () => {
3736
test(
3837
"Exclude specific tests and verify excluded tests are not executed",
@@ -56,18 +55,36 @@ test.describe("API Contract testing with test exclusion and inclusion", () => {
5655
});
5756

5857
await test.step("Exclude single test and verify counts decrease", async () => {
59-
await contractPage.selectTestForExclusionOrInclusion("/products", "POST", "201");
58+
await contractPage.selectTestForExclusionOrInclusion(
59+
"/products",
60+
"POST",
61+
"201",
62+
);
6063
await contractPage.clickExcludeButton();
6164
await runAndVerifyCounts(contractPage, {
62-
success: 0, failed: 20, total: 23, error: 0, notcovered: 2, excluded: 1,
65+
success: 0,
66+
failed: 20,
67+
total: 23,
68+
error: 0,
69+
notcovered: 2,
70+
excluded: 1,
6371
});
6472
});
6573

6674
await test.step("Include single test and verify counts are restored", async () => {
67-
await contractPage.selectTestForExclusionOrInclusion("/products", "POST", "201");
75+
await contractPage.selectTestForExclusionOrInclusion(
76+
"/products",
77+
"POST",
78+
"201",
79+
);
6880
await contractPage.clickIncludeButton();
6981
await runAndVerifyCounts(contractPage, {
70-
success: 12, failed: 20, total: 34, error: 0, notcovered: 2, excluded: 0,
82+
success: 12,
83+
failed: 20,
84+
total: 34,
85+
error: 0,
86+
notcovered: 2,
87+
excluded: 0,
7188
});
7289
});
7390

@@ -78,7 +95,12 @@ test.describe("API Contract testing with test exclusion and inclusion", () => {
7895
]);
7996
await contractPage.clickExcludeButton();
8097
await runAndVerifyCounts(contractPage, {
81-
success: 0, failed: 15, total: 19, error: 0, notcovered: 2, excluded: 2,
98+
success: 0,
99+
failed: 15,
100+
total: 19,
101+
error: 0,
102+
notcovered: 2,
103+
excluded: 2,
82104
});
83105
});
84106

@@ -89,18 +111,36 @@ test.describe("API Contract testing with test exclusion and inclusion", () => {
89111
]);
90112
await contractPage.clickIncludeButton();
91113
await runAndVerifyCounts(contractPage, {
92-
success: 12, failed: 20, total: 34, error: 0, notcovered: 2, excluded: 0,
114+
success: 12,
115+
failed: 20,
116+
total: 34,
117+
error: 0,
118+
notcovered: 2,
119+
excluded: 0,
93120
});
94121
});
95122

96123
await test.step("Verify error when mixing inclusive and exclusive operations", async () => {
97-
await contractPage.selectTestForExclusionOrInclusion("/products", "POST", "201");
124+
await contractPage.selectTestForExclusionOrInclusion(
125+
"/products",
126+
"POST",
127+
"201",
128+
);
98129
await contractPage.clickExcludeButton();
99130

100-
await contractPage.selectTestForExclusionOrInclusion("/products", "POST", "201");
101-
await contractPage.selectTestForExclusionOrInclusion("/products", "POST", "202");
131+
await contractPage.selectTestForExclusionOrInclusion(
132+
"/products",
133+
"POST",
134+
"201",
135+
);
136+
await contractPage.selectTestForExclusionOrInclusion(
137+
"/products",
138+
"POST",
139+
"202",
140+
);
102141

103-
const actualErrorMessage = await contractPage.getMixedOperationErrorText();
142+
const actualErrorMessage =
143+
await contractPage.getMixedOperationErrorText();
104144
expect(actualErrorMessage).toContain(
105145
"A combination of inclusive and exclusive operations have been selected, Please select only one type",
106146
);

0 commit comments

Comments
 (0)