Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e-tests/playwright/e2e/audit-log/auditor-catalog.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test.describe.serial("Audit Log check for Catalog Plugin", () => {
common = new Common(page);
catalogImport = new CatalogImport(page);
await common.loginAsGuest();
await uiHelper.goToPageUrl("/create", "Self-service");
await uiHelper.goToSelfServicePage();
});

test("Should fetch logs for entity-mutate event and validate log structure and values", async () => {
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/playwright/e2e/auth-providers/github.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ test.describe("Configure Github Provider", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("RHDH QE Admin");
await common.signOut();
await context.clearCookies();
Expand Down Expand Up @@ -238,7 +238,7 @@ test.describe("Configure Github Provider", async () => {
expect(actualDuration).toBeGreaterThan(threeDays - tolerance);
expect(actualDuration).toBeLessThan(threeDays + tolerance);

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("RHDH QE Admin");
await common.signOut();
await context.clearCookies();
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright/e2e/auth-providers/gitlab.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ test.describe("Configure GitLab Provider", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("user1");
await common.signOut();
await context.clearCookies();
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright/e2e/auth-providers/ldap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ test.describe("Configure LDAP Provider", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("User 1");
await common.signOut();
});
Expand Down
10 changes: 5 additions & 5 deletions e2e-tests/playwright/e2e/auth-providers/microsoft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ test.describe("Configure Microsoft Provider", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("TEST Zeus");
await common.signOut();
await context.clearCookies();
Expand All @@ -183,7 +183,7 @@ test.describe("Configure Microsoft Provider", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("TEST Zeus");
await common.signOut();
await context.clearCookies();
Expand Down Expand Up @@ -219,7 +219,7 @@ test.describe("Configure Microsoft Provider", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("TEST Zeus");
await common.signOut();
await context.clearCookies();
Expand All @@ -246,7 +246,7 @@ test.describe("Configure Microsoft Provider", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("TEST Zeus");
await common.signOut();
await context.clearCookies();
Expand Down Expand Up @@ -296,7 +296,7 @@ test.describe("Configure Microsoft Provider", async () => {
expect(actualDuration).toBeGreaterThan(threeDays - tolerance);
expect(actualDuration).toBeLessThan(threeDays + tolerance);

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("TEST Zeus");
await common.signOut();
});
Expand Down
22 changes: 11 additions & 11 deletions e2e-tests/playwright/e2e/auth-providers/oidc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");

await uiHelper.hideQuickstartIfVisible();
Expand Down Expand Up @@ -186,7 +186,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");
await common.signOut();
});
Expand All @@ -210,7 +210,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");
await common.signOut();
});
Expand All @@ -234,7 +234,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");
await common.signOut();

Expand Down Expand Up @@ -270,7 +270,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");
await common.signOut();

Expand All @@ -279,7 +279,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
process.env.DEFAULT_USER_PASSWORD,
);
expect(login2).toBe("Login successful");
await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Atena Minerva");
await common.signOut();
});
Expand All @@ -303,7 +303,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
);
expect(login).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Atena Minerva");
await common.signOut();
});
Expand Down Expand Up @@ -342,7 +342,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
expect(actualDuration).toBeGreaterThan(threeDays - tolerance);
expect(actualDuration).toBeLessThan(threeDays + tolerance);

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");
await common.signOut();
});
Expand Down Expand Up @@ -412,7 +412,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {

expect(oidcLogin).toBe("Login successful");

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");

expect(process.env.AUTH_PROVIDERS_GH_ORG_CLIENT_SECRET).toBeDefined();
Expand Down Expand Up @@ -451,7 +451,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {
await page.getByTitle("Sign out from GitHub").click();

// Sign out for OIDC
await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");
await common.signOut();
await context.clearCookies();
Expand Down Expand Up @@ -523,7 +523,7 @@ test.describe("Configure OIDC provider (using RHBK)", async () => {

await uiHelper.clickButtonByText("Don't log me out", { timeout: 60000 });

await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Zeus Giove");
await common.signOut();
});
Expand Down
6 changes: 1 addition & 5 deletions e2e-tests/playwright/e2e/catalog-timestamp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ test.describe("Test timestamp column on Catalog", () => {
});

test("Import an existing Git repository and verify `Created At` column and value in the Catalog Page", async () => {
await uiHelper.clickLink({
// TODO: RHDHBUGS-2564 - String not getting translated
// ariaLabel: t["rhdh"][lang]["menuItem.selfService"],
ariaLabel: "Self-service",
});
await uiHelper.goToSelfServicePage();
await uiHelper.clickButton(
t["scaffolder"][lang][
"templateListPage.contentHeader.registerExistingButtonTitle"
Expand Down
9 changes: 1 addition & 8 deletions e2e-tests/playwright/e2e/default-global-header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,7 @@ test.describe("Default Global Header", () => {
});

test("Verify that clicking on Self-service button opens the Templates page", async () => {
await uiHelper.clickLink({
// TODO: RHDHBUGS-2564 - String not getting translated
// ariaLabel: t["rhdh"][lang]["menuItem.selfService"],
ariaLabel: "Self-service",
});
// TODO: RHDHBUGS-2564 - String not getting translated
// await uiHelper.verifyHeading(t["rhdh"][lang]["menuItem.selfService"]);
await uiHelper.verifyHeading("Self-service");
await uiHelper.goToSelfServicePage();
});

test("Verify that clicking on Support button in HelpDropdown opens a new tab", async ({
Expand Down
3 changes: 1 addition & 2 deletions e2e-tests/playwright/e2e/extensions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,6 @@ test.describe("Admin > Extensions", () => {
);
await expect(page.getByRole("alert").first()).toContainText(
"The Analytics Provider Segment package requires a restart of the backend system to finish installing, updating, enabling or disabling.",
{ timeout: 10000 },
);
});

Expand Down Expand Up @@ -790,7 +789,7 @@ test.describe("Admin > Extensions", () => {
.getByText(
t["plugin.extensions"][lang]["alert.backendRestartRequired"],
),
).toBeVisible({ timeout: 10000 });
).toBeVisible();

const packageVerifications = [
{ rowTitle: "Name", rowValue: "Action" },
Expand Down
6 changes: 3 additions & 3 deletions e2e-tests/playwright/e2e/github-happy-path.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
});

test("Verify Profile is Github Account Name in the Settings page", async () => {
await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading(process.env.GH_USER2_ID);
await uiHelper.verifyHeading(`User Entity: ${process.env.GH_USER2_ID}`);
});
Expand Down Expand Up @@ -88,7 +88,7 @@
});

test("Verify all 12 Software Templates appear in the Create page", async () => {
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await uiHelper.goToSelfServicePage();
await uiHelper.verifyHeading("Templates");

for (const template of TEMPLATES) {
Expand Down Expand Up @@ -199,7 +199,7 @@

// TODO: https://issues.redhat.com/browse/RHDHBUGS-2099
test.fixme("Verify that the CI tab renders 5 most recent github actions and verify the table properly displays the actions when page sizes are changed and filters are applied", async () => {
await page.locator("a").getByText("CI", { exact: true }).first().click();

Check warning on line 202 in e2e-tests/playwright/e2e/github-happy-path.spec.ts

View workflow job for this annotation

GitHub Actions / TSC, ESLint and Prettier

Usage of raw locator detected. Use methods like .getByRole() or .getByText() instead of raw locators
await common.checkAndClickOnGHloginPopup();

const workflowRuns = await backstageShowcase.getWorkflowRuns();
Expand All @@ -213,7 +213,7 @@
test.fixme("Click on the Dependencies tab and verify that all the relations have been listed and displayed", async () => {
await uiHelper.clickTab("Dependencies");
for (const resource of RESOURCES) {
const resourceElement = page.locator(

Check warning on line 216 in e2e-tests/playwright/e2e/github-happy-path.spec.ts

View workflow job for this annotation

GitHub Actions / TSC, ESLint and Prettier

Usage of raw locator detected. Use methods like .getByRole() or .getByText() instead of raw locators
`#workspace:has-text("${resource}")`,
);
await resourceElement.scrollIntoViewIfNeeded();
Expand All @@ -223,7 +223,7 @@

// TODO: https://issues.redhat.com/browse/RHDHBUGS-2099
test.fixme("Sign out and verify that you return back to the Sign in page", async () => {
await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies();
});
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/playwright/e2e/guest-signin-happy-path.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ test.describe("Guest Signing Happy path", () => {
});

test("Verify Profile is Guest in the Settings page", async () => {
await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading("Guest");
await uiHelper.verifyHeading("User Entity: guest");
});

test("Sign Out and Verify that you return to the Sign-in page", async () => {
await uiHelper.goToPageUrl("/settings", "Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
let page;
let testHelper: TestHelper;
let uiHelper: UIhelper;
let common: Common;
let initialSearchCount: number;
let templatesFirstEntry: string[];
let catalogEntitiesFirstEntry: string[];
Expand All @@ -33,8 +34,9 @@
context = await browser.newContext();
page = await context.newPage();
uiHelper = new UIhelper(page);
common = new Common(page);
testHelper = new TestHelper(page);
await new Common(page).loginAsKeycloakUser();
await common.loginAsKeycloakUser();
await uiHelper.goToPageUrl("/", "Welcome back!");
});

Expand All @@ -60,7 +62,7 @@
}

await testHelper.selectOption("Date range...");
const datePicker = page.locator(".v5-MuiPaper-root", {

Check warning on line 65 in e2e-tests/playwright/e2e/plugins/adoption-insights/adoption-insights.spec.ts

View workflow job for this annotation

GitHub Actions / TSC, ESLint and Prettier

Usage of raw locator detected. Use methods like .getByRole() or .getByText() instead of raw locators
hasText: "Start date",
});
await expect(datePicker).toBeVisible();
Expand Down
12 changes: 3 additions & 9 deletions e2e-tests/playwright/e2e/plugins/bulk-import.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,8 @@ spec:
"Preview file",
);

await expect(await uiHelper.clickButton("Save")).not.toBeVisible({
timeout: 10000,
});
await expect(await uiHelper.clickButton("Import")).toBeDisabled({
timeout: 10000,
});
await expect(await uiHelper.clickButton("Save")).toBeHidden();
await expect(await uiHelper.clickButton("Import")).toBeDisabled();
});

test("Add a Repository, generate a PR, and confirm its preview", async () => {
Expand All @@ -175,9 +171,7 @@ spec:
await uiHelper.verifyRowInTableByUniqueText(newRepoDetails.repoName, [
"Ready to import",
]);
await expect(await uiHelper.clickButton("Import")).toBeDisabled({
timeout: 10000,
});
await expect(await uiHelper.clickButton("Import")).toBeDisabled();
});

test('Verify that the two selected repositories are listed: one with the status "Already imported" and another with the status "WAIT_PR_APPROVAL."', async () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright/e2e/plugins/http-request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test.describe("Testing scaffolder-backend-module-http-request to invoke an exter

test("Create a software template using http-request plugin", async () => {
test.setTimeout(130000);
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await uiHelper.goToSelfServicePage();
await uiHelper.verifyHeading("Templates");
await uiHelper.clickButton("Import an existing Git repository");
await catalogImport.registerExistingComponent(template, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe("Test Kubernetes Actions plugin", () => {
test.setTimeout(testInfo.timeout + 6500);

await common.loginAsGuest();
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await uiHelper.goToSelfServicePage();
});

test.beforeEach(async ({}, testInfo) => {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/playwright/e2e/plugins/quay/quay-actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test.describe("Test Quay Actions plugin", () => {
quayClient = new QuayClient();

await common.loginAsGuest();
await uiHelper.clickLink({ ariaLabel: "Self-service" });
await uiHelper.goToSelfServicePage();
});

test("Creates Quay repository", async () => {
Expand Down
4 changes: 4 additions & 0 deletions e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -679,11 +679,13 @@ test.describe("Test RBAC", () => {

test("Test catalog-entity read is denied", async ({ page }) => {
await page.reload();
await new Common(page).waitForLoad();
await uiHelper.openSidebar("Catalog");
await uiHelper.selectMuiBox("Kind", "Component");
await uiHelper.verifyTableIsEmpty();
await uiHelper.clickButton("Self-service");
await page.reload();
await new Common(page).waitForLoad();
await uiHelper.verifyText(
"No templates found that match your filter. Learn more about",
false,
Expand All @@ -692,6 +694,7 @@ test.describe("Test RBAC", () => {

test("Test catalog-entity refresh is denied", async () => {
await page.reload();
await new Common(page).waitForLoad();
await uiHelper.openSidebar("Catalog");
expect(
await uiHelper.isBtnVisibleByTitle("Schedule entity refresh"),
Expand All @@ -700,6 +703,7 @@ test.describe("Test RBAC", () => {

test("Test catalog-entity create is allowed", async () => {
await page.reload();
await new Common(page).waitForLoad();
await uiHelper.openSidebar("Catalog");
await uiHelper.clickButton("Self-service");
await uiHelper.verifyLinkVisible("Import an existing Git repository");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,14 @@ test.describe.serial("Test Scaffolder Backend Module Annotator", () => {
]);

await uiHelper.clickButton("Create");
await page.waitForTimeout(5000);
await uiHelper.clickLink("Open in catalog");

const linkLocator = page
.locator("a")
.filter({ hasText: "Open in catalog" })
.first();
// scaffolder might take a bit longer to create the entity, so we wait for the link to be visible before clicking
await linkLocator.waitFor({ state: "visible", timeout: 60_000 });
await linkLocator.click();
});

test("Verify custom label is added to scaffolded component", async () => {
Expand Down
Loading
Loading