Skip to content

Commit 168c0ca

Browse files
fix(e2e): apply Playwright assertion fixes in oxlint pedantic PR
Use plain await for deployment restart, expect().toBeVisible() for the About card link, and table-scoped verifyText for catalog Name checks. Register restartDeployment as an assert helper for expect-expect. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5a38cc9 commit 168c0ca

5 files changed

Lines changed: 7 additions & 18 deletions

File tree

e2e-tests/oxlint.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ export default defineConfig({
166166
"verifyTextInSelector",
167167
"verifyPartialTextInSelector",
168168
"loginAsGuest",
169+
"restartDeployment",
169170
"waitForTitle",
170171
],
171172
},

e2e-tests/playwright/e2e/external-database/verify-tls-config-with-external-azure-db.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test, expect } from "@support/coverage/test";
1+
import { test } from "@support/coverage/test";
22
import { UIhelper } from "../../utils/ui-helper";
33
import { Common } from "../../utils/common";
44
import { KubeClient, getRhdhDeploymentName } from "../../utils/kube-client";
@@ -92,9 +92,7 @@ test.describe("Verify TLS configuration with Azure Database for PostgreSQL healt
9292
user: azureUser,
9393
password: azurePassword,
9494
});
95-
await expect(
96-
kubeClient.restartDeployment(deploymentName, namespace),
97-
).resolves.toBeUndefined();
95+
await kubeClient.restartDeployment(deploymentName, namespace);
9896
});
9997

10098
test("Verify successful DB connection", async ({ page }) => {

e2e-tests/playwright/e2e/external-database/verify-tls-config-with-external-rds.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { test, expect } from "@support/coverage/test";
1+
import { test } from "@support/coverage/test";
22
import { UIhelper } from "../../utils/ui-helper";
33
import { Common } from "../../utils/common";
44
import { KubeClient, getRhdhDeploymentName } from "../../utils/kube-client";
@@ -88,9 +88,7 @@ test.describe("Verify TLS configuration with RDS PostgreSQL health check", () =>
8888
user: rdsUser,
8989
password: rdsPassword,
9090
});
91-
await expect(
92-
kubeClient.restartDeployment(deploymentName, namespace),
93-
).resolves.toBeUndefined();
91+
await kubeClient.restartDeployment(deploymentName, namespace);
9492
});
9593

9694
test("Verify successful DB connection", async ({ page }) => {

e2e-tests/playwright/e2e/plugins/scaffolder-relation-processor/scaffolder-relation-processor.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ test.describe.serial("Test Scaffolder Relation Processor Plugin", () => {
5151

5252
test("Register the template for scaffolder relation processor", async () => {
5353
await uiHelper.openSidebar("Catalog");
54-
// Wait for the Catalog page table to fully load before proceeding
55-
await expect(page.getByText("Name", { exact: true }).first()).toBeVisible({
56-
timeout: 20000,
57-
});
54+
await uiHelper.verifyText("Name");
5855

5956
await uiHelper.clickButton("Self-service");
6057
await uiHelper.verifyHeading("Self-service");

e2e-tests/playwright/support/pages/backstage-showcase.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ export class BackstageShowcase {
5858
async verifyAboutCardIsDisplayed() {
5959
const url =
6060
"https://github.com/redhat-developer/rhdh/tree/main/catalog-entities/components/";
61-
const isLinkVisible = await this.page
62-
.locator(`a[href="${url}"]`)
63-
.isVisible();
64-
if (!isLinkVisible) {
65-
throw new Error("About card is not displayed");
66-
}
61+
await expect(this.page.locator(`a[href="${url}"]`)).toBeVisible();
6762
}
6863

6964
async verifyPRRows(

0 commit comments

Comments
 (0)