Skip to content

Commit 5f37447

Browse files
authored
chore(e2e): quick start e2e (#3147)
1 parent 603306f commit 5f37447

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { expect, test } from "@playwright/test";
2+
import { Common } from "../../utils/common";
3+
import { UIhelper } from "../../utils/ui-helper";
4+
5+
test.describe("Test Quick Start plugin", () => {
6+
let uiHelper: UIhelper;
7+
let common: Common;
8+
9+
test.beforeEach(async ({ page }) => {
10+
common = new Common(page);
11+
await common.loginAsKeycloakUser();
12+
uiHelper = new UIhelper(page);
13+
});
14+
15+
test("Access Quick start from Global Header", async ({ page }) => {
16+
await page.waitForTimeout(1000);
17+
if (await page.getByRole("button", { name: "Hide" }).isHidden()) {
18+
await uiHelper.clickButtonByLabel("Help");
19+
await uiHelper.clickByDataTestId("quickstart-button");
20+
console.log("Quick start button clicked");
21+
}
22+
await expect(page.getByRole("button", { name: "Hide" })).toBeVisible();
23+
await uiHelper.verifyText("Let's get you started with Developer Hub");
24+
await uiHelper.verifyText("We'll guide you through a few quick steps");
25+
await uiHelper.verifyText("Not started");
26+
await uiHelper.clickButtonByText("Set up authentication");
27+
await uiHelper.verifyButtonURL(
28+
"Learn more",
29+
"https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/html/authentication_in_red_hat_developer_hub/",
30+
);
31+
await uiHelper.clickButtonByText("Configure RBAC");
32+
await uiHelper.verifyButtonURL("Manage access", "/rbac");
33+
await uiHelper.clickButtonByText("Configure Git");
34+
await uiHelper.verifyButtonURL(
35+
"Learn more",
36+
"https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/html/integrating_red_hat_developer_hub_with_github/",
37+
);
38+
await uiHelper.clickButtonByText("Manage plugins");
39+
await uiHelper.verifyButtonURL("Explore plugins", "/extensions");
40+
await uiHelper.clickButtonByText("Explore plugins");
41+
await uiHelper.verifyText("Catalog");
42+
await uiHelper.verifyText(/Plugins \((\d+)\)/);
43+
await uiHelper.verifyText("25% progress");
44+
await uiHelper.clickButton("Hide");
45+
await expect(page.getByRole("button", { name: "Hide" })).toBeHidden();
46+
});
47+
});

e2e-tests/playwright/utils/ui-helper.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ export class UIhelper {
132132
}
133133
}
134134

135+
async clickButtonByLabel(label: string | RegExp) {
136+
await this.page.getByRole("button", { name: label }).first().click();
137+
}
138+
135139
/**
136140
* Conditionally clicks on "Mark all read" if visible, then clicks on "Mark All".
137141
* This method handles the two-step process of marking all notifications as read.

0 commit comments

Comments
 (0)