|
| 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 | +}); |
0 commit comments