Skip to content

Commit f38e411

Browse files
committed
Conditionals
1 parent ee55bff commit f38e411

File tree

12 files changed

+21
-4
lines changed

12 files changed

+21
-4
lines changed

e2e-tests/eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export default [
101101
"playwright/valid-describe-callback": "off", // Allow async describe callbacks
102102
"playwright/valid-expect": "error", // Keep this as error to catch missing matchers
103103
"playwright/no-wait-for-selector": "off", // Allow wait for selector
104-
"playwright/no-conditional-in-test": "off", // Allow conditional in test
105104
"playwright/no-wait-for-timeout": "off", // Allow wait for timeout
106105
"playwright/no-skipped-test": [
107106
"warn",

e2e-tests/playwright/e2e/configuration-test/config-map.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ test.describe("Change app-config at e2e test runtime", () => {
1818

1919
// Start with a common name, but let KubeClient find the actual ConfigMap
2020
const configMapName = "app-config-rhdh";
21+
// eslint-disable-next-line playwright/no-conditional-in-test
2122
const namespace = process.env.NAME_SPACE_RUNTIME || "showcase-runtime";
2223
const deploymentName = "rhdh-developer-hub";
2324

e2e-tests/playwright/e2e/extensions.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ test.describe("Admin > Extensions > Catalog", () => {
138138
await expect(page.getByRole("button", { name: "✔" })).toBeVisible();
139139
await uiHelper.clickButton("Reset");
140140
await expect(page.getByText("pluginConfig:")).toBeHidden();
141+
// eslint-disable-next-line playwright/no-conditional-in-test
141142
const modifier = isMac ? "Meta" : "Control";
142143
await page.keyboard.press(`${modifier}+KeyA`);
143144
await page.keyboard.press(`${modifier}+KeyV`);

e2e-tests/playwright/e2e/plugins/adoption-insights/adoption-insights.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Common } from "../../../utils/common";
33
import { UIhelper } from "../../../utils/ui-helper";
44
import { TestHelper } from "../../../support/pages/adoption-insights";
55

6+
/* eslint-disable playwright/no-conditional-in-test */
7+
68
test.describe.serial("Test Adoption Insights", () => {
79
test.beforeAll(async () => {
810
test.info().annotations.push({

e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111

1212
// Pre-req : plugin-bulk-import & plugin-bulk-import-backend-dynamic
1313
test.describe("Bulk Import plugin", () => {
14-
test.describe.configure({ retries: process.env.CI ? 2 : 0 , mode: "serial"});
14+
test.describe.configure({ retries: process.env.CI ? 2 : 0, mode: "serial" });
1515
test.skip(() => process.env.JOB_NAME.includes("osd-gcp")); // skipping due to RHIDP-5704 on OSD Env
1616

1717
let page: Page;

e2e-tests/playwright/e2e/plugins/keycloak/catalog-users.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ test.describe("Test Keycloak plugin", () => {
4747
);
4848
expect(userFound).not.toBeNull();
4949

50+
// eslint-disable-next-line playwright/no-conditional-in-test
5051
if (userFound) {
5152
await keycloak.checkUserDetails(
5253
page,
@@ -86,6 +87,7 @@ test.describe("Test Keycloak plugin metrics", () => {
8687
const domain = host.split(".").slice(1).join(".");
8788

8889
const metricsRoute = await kubeClient.getRoute(namespace, routerName);
90+
// eslint-disable-next-line playwright/no-conditional-in-test
8991
if (!metricsRoute) {
9092
const service = await kubeClient.getServiceByLabel(
9193
namespace,

e2e-tests/playwright/e2e/plugins/middleware.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test.describe("Test middleware plugin", () => {
1414
const common = new Common(page);
1515

1616
await common.loginAsGuest();
17-
await page.goto("/simple-chat", { waitUntil: "networkidle" });
17+
await page.goto("/simple-chat", { waitUntil: "domcontentloaded" });
1818
await page.getByRole("checkbox", { name: "Use Proxy" }).check();
1919
await page.getByRole("textbox").fill("hi");
2020

@@ -26,7 +26,8 @@ test.describe("Test middleware plugin", () => {
2626
const headers = await response.allHeaders();
2727
console.log("All headers:", headers);
2828
console.log("Target header:", headers["x-proxy-test-header"]);
29+
30+
// eslint-disable-next-line playwright/valid-expect
2931
expect(headers["x-proxy-test-header"]);
30-
expect(headers["x-proxy-test-header"]).toBeTruthy();
3132
});
3233
});

e2e-tests/playwright/e2e/plugins/quick-start.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ test.describe("Test Quick Start plugin", () => {
2020

2121
test("Access Quick start from Global Header", async ({ page }) => {
2222
await page.waitForTimeout(1000);
23+
// eslint-disable-next-line playwright/no-conditional-in-test
2324
if (await page.getByRole("button", { name: "Hide" }).isHidden()) {
2425
await uiHelper.clickButtonByLabel("Help");
2526
await uiHelper.clickByDataTestId("quickstart-button");

e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ test.describe.serial("Test RBAC", () => {
243243
const lines = fileContent.trim().split("\n");
244244

245245
const header = "userEntityRef,displayName,email,lastAuthTime";
246+
// eslint-disable-next-line playwright/no-conditional-in-test
246247
if (lines[0] !== header) {
247248
throw new Error("Header does not match");
248249
}
@@ -251,6 +252,7 @@ test.describe.serial("Test RBAC", () => {
251252
const allUsersValid = lines
252253
.slice(1)
253254
.every((line) => line.startsWith("user:default"));
255+
// eslint-disable-next-line playwright/no-conditional-in-test
254256
if (!allUsersValid) {
255257
throw new Error("Not all users info are valid");
256258
}
@@ -394,7 +396,9 @@ test.describe.serial("Test RBAC", () => {
394396
nextButton2 = page.locator('[data-testid="nextButton-2"]');
395397
matchNextButton2 = await nextButton2.all();
396398
attempts++;
399+
// eslint-disable-next-line playwright/no-conditional-in-test
397400
} while (matchNextButton2.length > 1 && attempts < 5);
401+
// eslint-disable-next-line playwright/no-force-option
398402
await nextButton2.click({ force: true });
399403
await page.waitForTimeout(1_000);
400404
await uiHelper.clickButton("Save");
@@ -489,12 +493,14 @@ test.describe.serial("Test RBAC", () => {
489493

490494
const policiesResponse = await rbacApi.getPolicies();
491495

496+
// eslint-disable-next-line playwright/no-conditional-in-test
492497
if (!rolesResponse.ok()) {
493498
throw Error(
494499
`RBAC rolesResponse API call failed with status code ${rolesResponse.status()}`,
495500
);
496501
}
497502

503+
// eslint-disable-next-line playwright/no-conditional-in-test
498504
if (!policiesResponse.ok()) {
499505
throw Error(
500506
`RBAC policiesResponse API call failed with status code ${policiesResponse.status()}`,

e2e-tests/playwright/e2e/plugins/topology/topology.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ test.describe("Test Topology Plugin", () => {
5555
// Determine resource type and run appropriate test
5656
const resourceType = await getResourceType(page);
5757

58+
// eslint-disable-next-line playwright/no-conditional-in-test
5859
if (resourceType === "ingress") {
5960
await testIngressResources(page, uiHelper);
6061
} else {

0 commit comments

Comments
 (0)