Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(e2e): add e2e tests for global header #2412

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
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
7 changes: 7 additions & 0 deletions .ibm/pipelines/resources/config_map/app-config-rhdh.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
app:
support:
url: https://github.com/redhat-developer/rhdh/issues
items:
- title: Red Hat Developer Hub
links:
- url: https://access.redhat.com/products/red-hat-developer-hub
title: Product Information
baseUrl: ${RHDH_BASE_URL}
title: Red Hat Developer Hub
branding:
Expand Down
3 changes: 1 addition & 2 deletions .ibm/pipelines/value_files/values_showcase-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,8 @@ global:
disabled: false
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import
disabled: false
# Disable global header plugin for now. See https://issues.redhat.com/browse/RHIDP-5474
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header
disabled: true
disabled: false
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page
disabled: false
# Enable tech-radar plugin.
Expand Down
21 changes: 19 additions & 2 deletions .ibm/pipelines/value_files/values_showcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,17 @@ global:
disabled: false
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-bulk-import
disabled: false
# Disable global header plugin for now. See https://issues.redhat.com/browse/RHIDP-5474
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header
disabled: true
disabled: false
# Enable notifications plugins.
- package: ./dynamic-plugins/dist/backstage-plugin-notifications
disabled: false
- package: ./dynamic-plugins/dist/backstage-plugin-notifications-backend-dynamic
disabled: false
- package: ./dynamic-plugins/dist/backstage-plugin-signals-backend-dynamic
disabled: false
- package: ./dynamic-plugins/dist/backstage-plugin-signals
disabled: false
# Enable tech-radar plugins.
- package: ./dynamic-plugins/dist/backstage-community-plugin-tech-radar
disabled: false
Expand Down Expand Up @@ -143,6 +151,15 @@ upstream:
commonLabels:
backstage.io/kubernetes-id: developer-hub
backstage:
appConfig:
backend:
auth:
dangerouslyDisableDefaultAuthPolicy: true
externalAccess:
- type: static
options:
token: test-token
subject: test-subject
image:
pullPolicy: Always
registry: quay.io
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/playwright/e2e/audit-log/scaffold.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ test.describe("Audit Log check for Catalog Plugin", () => {
common = new Common(page);
catalogImport = new CatalogImport(page);
await common.loginAsGuest();
await uiHelper.openSidebar("Create");
await uiHelper.clickLinkByAriaLabel("Create...");
});

test("Should fetch logs for ScaffolderParameterSchemaFetch event and validate log structure and values", async ({
baseURL,
}) => {
await uiHelper.clickButton("Register Existing Component");
await catalogImport.registerExistingComponent(template, false);
await uiHelper.openSidebar("Create");
await uiHelper.clickLinkByAriaLabel("Create...");
await common.waitForLoad();
await uiHelper.clickBtnInCard("Hello World 2", "Choose");
await LogUtils.validateLogEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test.describe("Standard authentication providers: Basic authentication", () => {
// Guest login should work
await common.loginAsGuest();
await page.goto("/");
await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
});

Expand Down Expand Up @@ -125,15 +125,15 @@ test.describe("Standard authentication providers: Basic authentication", () => {
constants.AZURE_LOGIN_PASSWORD,
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyParagraph(constants.AZURE_LOGIN_USERNAME);

// check no entities are in the catalog
const api = new APIHelper();
api.UseStaticToken(constants.STATIC_API_TOKEN);
const catalogUsers = await api.getAllCatalogUsersFromAPI();
expect(catalogUsers.totalItems).toBe(0);
await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
});

Expand Down
14 changes: 7 additions & 7 deletions e2e-tests/playwright/e2e/authProviders/github-provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test.describe("Standard authentication providers: Github Provider", () => {
timeout: 90 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
});

Expand Down Expand Up @@ -242,7 +242,7 @@ test.describe("Standard authentication providers: Github Provider", () => {
constants.GH_USER_PASSWORD,
constants.AUTH_PROVIDERS_GH_USER_2FA,
);
await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies();
});
Expand Down Expand Up @@ -339,7 +339,7 @@ test.describe("Standard authentication providers: Github Provider", () => {
timeout: 90 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();

await waitForNextSync("github", syncTime);
Expand Down Expand Up @@ -384,7 +384,7 @@ test.describe("Standard authentication providers: Github Provider", () => {
timeout: 60 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies();
});
Expand Down Expand Up @@ -452,7 +452,7 @@ test.describe("Standard authentication providers: Github Provider", () => {
timeout: 30 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies();
});
Expand Down Expand Up @@ -530,7 +530,7 @@ test.describe("Standard authentication providers: Github Provider", () => {
constants.GH_TEAMS["team_2"].name + "_renamed",
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
// user should see the entities again
await expect(async () => {
await page.reload();
Expand All @@ -549,7 +549,7 @@ test.describe("Standard authentication providers: Github Provider", () => {
constants.GH_TEAMS["team_2"].name + "_renamed",
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
timeout: 90 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies();
});
Expand Down Expand Up @@ -342,7 +342,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
timeout: 120 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies(); // If we don't clear cookies, Microsoft Login popup will present the last logger user

Expand Down Expand Up @@ -395,7 +395,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
timeout: 120 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies(); // If we don't clear cookies, Microsoft Login popup will present the last logger user
});
Expand Down Expand Up @@ -429,7 +429,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
constants.RHSSO76_DEFAULT_PASSWORD,
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies(); // If we don't clear cookies, Microsoft Login popup will present the last logger user

Expand Down Expand Up @@ -469,7 +469,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
timeout: 30 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies(); // If we don't clear cookies, Microsoft Login popup will present the last logger user
});
Expand Down Expand Up @@ -531,7 +531,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
constants.RHSSO76_DEFAULT_PASSWORD,
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies(); // If we don't clear cookies, Microsoft Login popup will present the last logger user
});
Expand Down Expand Up @@ -566,7 +566,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
constants.RHSSO76_DEFAULT_PASSWORD,
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies();

Expand Down Expand Up @@ -655,7 +655,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
constants.MSGRAPH_GROUPS["group_6"].displayName + "_renamed",
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
// user should see the entities again
await expect(async () => {
await page.reload();
Expand All @@ -674,7 +674,7 @@ test.describe("Standard authentication providers: Micorsoft Azure EntraID", () =
constants.MSGRAPH_GROUPS["group_6"].displayName + "_renamed",
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
await context.clearCookies(); // If we don't clear cookies, Microsoft Login popup will present the last logger user
});
Expand Down
25 changes: 13 additions & 12 deletions e2e-tests/playwright/e2e/authProviders/rhsso-76-provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_USERS["user_1"].username,
constants.RHSSO76_DEFAULT_PASSWORD,
);
await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading(
await rhssoHelper.getRHSSOUserDisplayName(
constants.RHSSO76_USERS["user_1"],
Expand Down Expand Up @@ -184,7 +184,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_USERS["user_1"].username,
constants.RHSSO76_DEFAULT_PASSWORD,
);
await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading(
await rhssoHelper.getRHSSOUserDisplayName(
constants.RHSSO76_USERS["user_1"],
Expand Down Expand Up @@ -241,7 +241,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_USERS["user_1"].username,
constants.RHSSO76_DEFAULT_PASSWORD,
);
await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading(
rhssoHelper.getRHSSOUserDisplayName(constants.RHSSO76_USERS["user_1"]),
);
Expand All @@ -252,7 +252,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_USERS["jenny_doe"].username,
constants.RHSSO76_DEFAULT_PASSWORD,
);
await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading(
rhssoHelper.getRHSSOUserDisplayName(
constants.RHSSO76_USERS["jenny_doe"],
Expand All @@ -265,7 +265,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_USERS["user_2"].username,
constants.RHSSO76_DEFAULT_PASSWORD,
);
await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await uiHelper.verifyHeading(
rhssoHelper.getRHSSOUserDisplayName(constants.RHSSO76_USERS["user_2"]),
);
Expand Down Expand Up @@ -445,7 +445,8 @@ for (const version of ["RHBK"]) {
expect(statusBefore).toBe(403);

// logout
await uiHelper.openSidebar("Settings");
await uiHelper.clickByDataTestId("KeyboardArrowDownOutlinedIcon");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if there are multiple Icon on sidebar? instead can we click based on the nav item like setting?

await uiHelper.clickLinkByHref("/settings");
await common.signOut();
}).toPass({
intervals: [1_000, 2_000, 5_000],
Expand Down Expand Up @@ -499,7 +500,7 @@ for (const version of ["RHBK"]) {
timeout: 60 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
});

Expand All @@ -518,7 +519,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_DEFAULT_PASSWORD,
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();

// group_4 should exist in rhdh
Expand Down Expand Up @@ -572,7 +573,7 @@ for (const version of ["RHBK"]) {
timeout: 30 * 1000,
});

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
});

Expand Down Expand Up @@ -626,7 +627,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_DEFAULT_PASSWORD,
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
});

Expand Down Expand Up @@ -722,7 +723,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_GROUPS["group_2"].name + "_renamed",
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
// user should see the entities again
await expect(async () => {
await page.reload();
Expand All @@ -742,7 +743,7 @@ for (const version of ["RHBK"]) {
constants.RHSSO76_GROUPS["group_2"].name + "_renamed",
);

await uiHelper.openSidebar("Settings");
await uiHelper.goToSettingsPage();
await common.signOut();
});

Expand Down
Loading
Loading