From 432e34aad26b72115d7d0bb2f284a71d75df4129 Mon Sep 17 00:00:00 2001 From: Sanket Saikia Date: Wed, 6 May 2026 11:47:19 +0530 Subject: [PATCH 1/2] E2E cleanup OCI --- .ci/pipelines/auth/secrets-rhdh-secrets.yaml | 1 - .ci/pipelines/env_variables.sh | 4 - .../config_map/app-config-rhdh-rbac.yaml | 20 -- .../resources/config_map/app-config-rhdh.yaml | 18 +- ...-global-floating-action-button-config.yaml | 9 - .../config_map/dynamic-plugins-config.yaml | 17 -- .../resources/config_map/rbac-policy.csv | 1 - .../pipeline-run/pipelines-operator.yaml | 10 - .../diff-values_showcase-sanity-plugins.yaml | 2 - .../value_files/values_showcase-rbac.yaml | 76 ------- .../value_files/values_showcase.yaml | 46 ---- dynamic-plugins/_utils/src/wrappers.test.ts | 8 - e2e-tests/playwright.config.ts | 16 -- e2e-tests/playwright/data/rbac-constants.ts | 6 - e2e-tests/playwright/data/theme-constants.ts | 45 ---- e2e-tests/playwright/e2e/custom-theme.spec.ts | 95 -------- .../dynamic-home-page-customization.spec.ts | 84 ------- .../playwright/e2e/github-happy-path.spec.ts | 27 --- .../e2e/header-mount-points.spec.ts | 49 ---- .../plugins/gitlab/gitlab-discovery.spec.ts | 44 ---- .../e2e/plugins/quay/quay-actions.spec.ts | 57 ----- .../playwright/e2e/plugins/quay/quay.spec.ts | 53 ----- .../e2e/plugins/scorecard/scorecard.spec.ts | 186 --------------- .../page-objects/scorecard/scorecard-page.ts | 163 -------------- .../support/pages/catalog-import.ts | 21 +- .../support/pages/home-page-customization.ts | 211 ------------------ .../support/test-data/custom-theme.ts | 11 - e2e-tests/playwright/utils/api-endpoints.ts | 7 - .../utils/custom-theme/theme-verifier.ts | 81 ------- .../playwright/utils/quay/quay-client.ts | 29 --- e2e-tests/playwright/utils/quay/quay.ts | 65 ------ 31 files changed, 6 insertions(+), 1456 deletions(-) delete mode 100644 .ci/pipelines/resources/pipeline-run/pipelines-operator.yaml delete mode 100644 e2e-tests/playwright/data/theme-constants.ts delete mode 100644 e2e-tests/playwright/e2e/custom-theme.spec.ts delete mode 100644 e2e-tests/playwright/e2e/dynamic-home-page-customization.spec.ts delete mode 100644 e2e-tests/playwright/e2e/header-mount-points.spec.ts delete mode 100644 e2e-tests/playwright/e2e/plugins/gitlab/gitlab-discovery.spec.ts delete mode 100644 e2e-tests/playwright/e2e/plugins/quay/quay-actions.spec.ts delete mode 100644 e2e-tests/playwright/e2e/plugins/quay/quay.spec.ts delete mode 100644 e2e-tests/playwright/e2e/plugins/scorecard/scorecard.spec.ts delete mode 100644 e2e-tests/playwright/support/page-objects/scorecard/scorecard-page.ts delete mode 100644 e2e-tests/playwright/support/pages/home-page-customization.ts delete mode 100644 e2e-tests/playwright/support/test-data/custom-theme.ts delete mode 100644 e2e-tests/playwright/utils/custom-theme/theme-verifier.ts delete mode 100644 e2e-tests/playwright/utils/quay/quay-client.ts delete mode 100644 e2e-tests/playwright/utils/quay/quay.ts diff --git a/.ci/pipelines/auth/secrets-rhdh-secrets.yaml b/.ci/pipelines/auth/secrets-rhdh-secrets.yaml index f512c3b882..84b5e39d59 100644 --- a/.ci/pipelines/auth/secrets-rhdh-secrets.yaml +++ b/.ci/pipelines/auth/secrets-rhdh-secrets.yaml @@ -48,5 +48,4 @@ data: GITHUB_OAUTH_APP_ID: $GITHUB_OAUTH_APP_ID_ENCODED GITHUB_OAUTH_APP_SECRET: $GITHUB_OAUTH_APP_SECRET_ENCODED BACKEND_SECRET: $BACKEND_SECRET - JIRA_TOKEN: $JIRA_TOKEN type: Opaque diff --git a/.ci/pipelines/env_variables.sh b/.ci/pipelines/env_variables.sh index af78d48d5c..d2d9e69d07 100755 --- a/.ci/pipelines/env_variables.sh +++ b/.ci/pipelines/env_variables.sh @@ -50,8 +50,6 @@ K8S_CLUSTER_TOKEN_ENCODED=$(printf "%s" $K8S_CLUSTER_TOKEN | base64 | tr -d '\n' IMAGE_REGISTRY="${IMAGE_REGISTRY:-quay.io}" IMAGE_REPO="${IMAGE_REPO:-${QUAY_REPO:-rhdh-community/rhdh}}" QUAY_REPO="${IMAGE_REPO}" # Keep QUAY_REPO in sync for backward compatibility -QUAY_NAMESPACE=$(cat /tmp/secrets/QUAY_NAMESPACE) -QUAY_TOKEN=$(cat /tmp/secrets/QUAY_TOKEN) # ============================================================================= # Release and Namespace Configuration @@ -94,8 +92,6 @@ QE_USER8_ID=$(cat /tmp/secrets/QE_USER8_ID) QE_USER8_PASS=$(cat /tmp/secrets/QE_USER8_PASS) QE_USER9_ID=$(cat /tmp/secrets/QE_USER9_ID) QE_USER9_PASS=$(cat /tmp/secrets/QE_USER9_PASS) -JIRA_TOKEN=$(cat /tmp/secrets/jira_token) - K8S_CLUSTER_TOKEN_TEMPORARY=$(cat /tmp/secrets/K8S_CLUSTER_TOKEN_TEMPORARY) GITLAB_TOKEN=$(cat /tmp/secrets/GITLAB_TOKEN) diff --git a/.ci/pipelines/resources/config_map/app-config-rhdh-rbac.yaml b/.ci/pipelines/resources/config_map/app-config-rhdh-rbac.yaml index 61516db8bd..d759555f99 100644 --- a/.ci/pipelines/resources/config_map/app-config-rhdh-rbac.yaml +++ b/.ci/pipelines/resources/config_map/app-config-rhdh-rbac.yaml @@ -80,25 +80,6 @@ catalog: rules: - allow: [API, Component, Group, Location, Resource, System, Template] locations: - # Scorecard test entities - - type: url - target: https://github.com/janus-qe/RHDH-scorecard-plugin-test/blob/main/all-scorecards.yaml - - - type: url - target: https://github.com/janus-qe/RHDH-scorecard-plugin-test/blob/main/jira-scorecard-only.yaml - - - type: url - target: https://github.com/janus-qe/RHDH-scorecard-plugin-test/blob/main/github-scorecard-only.yaml - - - type: url - target: https://github.com/janus-qe/RHDH-scorecard-plugin-test/blob/main/no-scorecards.yaml - - - type: url - target: https://github.com/janus-qe/RHDH-scorecard-plugin-test/blob/main/metrics-unavailable.yaml - - - type: url - target: https://github.com/janus-qe/RHDH-scorecard-plugin-test/blob/main/invalid-threshold.yaml - - type: url target: https://github.com/redhat-developer/rhdh/blob/main/catalog-entities/all.yaml - type: url @@ -166,7 +147,6 @@ permission: - permission - scaffolder - kubernetes - - scorecard - orchestrator admin: users: diff --git a/.ci/pipelines/resources/config_map/app-config-rhdh.yaml b/.ci/pipelines/resources/config_map/app-config-rhdh.yaml index 45daf58787..e07f48f222 100644 --- a/.ci/pipelines/resources/config_map/app-config-rhdh.yaml +++ b/.ci/pipelines/resources/config_map/app-config-rhdh.yaml @@ -130,12 +130,6 @@ proxy: Authorization: "${ACR_SECRET}" # Change to "false" in case of using self hosted artifactory instance with a self-signed certificate secure: false - "/quay/api": - target: https://quay.io/ - headers: - X-Requested-With: "XMLHttpRequest" - changeOrigin: true - secure: true "/add-test-header": target: ${RHDH_BASE_URL_HTTP}/api/simple-chat credentials: forward @@ -156,8 +150,6 @@ catalog: target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml - type: url target: https://github.com/backstage/community-plugins/blob/main/workspaces/scaffolder-backend-module-kubernetes/plugins/kubernetes-actions/examples/templates/01-kubernetes-template.yaml - - type: url - target: https://github.com/backstage/community-plugins/blob/main/workspaces/quay/plugins/quay-actions/examples/templates/01-quay-template.yaml - type: url target: https://github.com/janus-qe/acr-catalog/blob/main/catalog-info.yaml - type: url @@ -204,11 +196,6 @@ catalog: # Let's perform a single execution frequency: { hours: 24 } timeout: { minutes: 30 } - # githubOrg: - # id: production - # githubUrl: "${GITHUB_URL}" - # orgs: ["${GITHUB_ORG}", "${GITHUB_ORG_2}"] - # Using Github GH_USER_ID account gitlab: default: group: rhdh-qe-test @@ -221,6 +208,11 @@ catalog: seconds: 15 timeout: minutes: 1 + # githubOrg: + # id: production + # githubUrl: "${GITHUB_URL}" + # orgs: ["${GITHUB_ORG}", "${GITHUB_ORG_2}"] + # Using Github GH_USER_ID account dynatrace: baseUrl: temp argocd: diff --git a/.ci/pipelines/resources/config_map/dynamic-global-floating-action-button-config.yaml b/.ci/pipelines/resources/config_map/dynamic-global-floating-action-button-config.yaml index cbac5b2b03..5205c4f717 100644 --- a/.ci/pipelines/resources/config_map/dynamic-global-floating-action-button-config.yaml +++ b/.ci/pipelines/resources/config_map/dynamic-global-floating-action-button-config.yaml @@ -13,15 +13,6 @@ dynamicPlugins: showLabel: true toolTip: "Github" to: https://github.com/redhat-developer/rhdh - - mountPoint: global.floatingactionbutton/config - importName: NullComponent - config: - icon: '' - label: "Quay" - showLabel: true - toolTip: "Quay" - to: "https://quay.io" - visibleOnPaths: ["/catalog"] red-hat-developer-hub.backstage-plugin-bulk-import: mountPoints: - mountPoint: global.floatingactionbutton/config diff --git a/.ci/pipelines/resources/config_map/dynamic-plugins-config.yaml b/.ci/pipelines/resources/config_map/dynamic-plugins-config.yaml index 81b44fdb1c..72e9cffc5e 100644 --- a/.ci/pipelines/resources/config_map/dynamic-plugins-config.yaml +++ b/.ci/pipelines/resources/config_map/dynamic-plugins-config.yaml @@ -206,20 +206,3 @@ dynamicPlugins: title: Test_i disabled priority: 20 enabled: false - pataknight.backstage-plugin-rhdh-qe-theme: - appIcons: - - importName: LightIcon - name: lightIcon - - importName: DarkIcon - name: darkIcon - themes: - - icon: lightIcon - id: light-dynamic - importName: lightThemeProvider - title: Light Dynamic - variant: light - - icon: darkIcon - id: dark-dynamic - importName: darkThemeProvider - title: Dark Dynamic - variant: dark diff --git a/.ci/pipelines/resources/config_map/rbac-policy.csv b/.ci/pipelines/resources/config_map/rbac-policy.csv index 07e9b24452..c4ff5f9cf0 100644 --- a/.ci/pipelines/resources/config_map/rbac-policy.csv +++ b/.ci/pipelines/resources/config_map/rbac-policy.csv @@ -9,7 +9,6 @@ p, role:xyz/team_a, catalog-entity, read, allow p, role:xyz/team_a, catalog.entity.create, create, allow p, role:xyz/team_a, catalog.location.create, create, allow p, role:xyz/team_a, catalog.location.read, read, allow -p, role:default/team_a, scorecard.metric.read, read, allow g, user:default/rhdh-qe, role:default/team_a g, user:default/rhdh-qe, role:default/qe_rbac_admin diff --git a/.ci/pipelines/resources/pipeline-run/pipelines-operator.yaml b/.ci/pipelines/resources/pipeline-run/pipelines-operator.yaml deleted file mode 100644 index c20a68122f..0000000000 --- a/.ci/pipelines/resources/pipeline-run/pipelines-operator.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: operators.coreos.com/v1alpha1 -kind: Subscription -metadata: - name: openshift-pipelines-operator - namespace: openshift-operators -spec: - channel: latest - name: openshift-pipelines-operator-rh - source: redhat-operators - sourceNamespace: openshift-marketplace diff --git a/.ci/pipelines/value_files/diff-values_showcase-sanity-plugins.yaml b/.ci/pipelines/value_files/diff-values_showcase-sanity-plugins.yaml index 20fc3285e2..e954cd22c9 100644 --- a/.ci/pipelines/value_files/diff-values_showcase-sanity-plugins.yaml +++ b/.ci/pipelines/value_files/diff-values_showcase-sanity-plugins.yaml @@ -112,8 +112,6 @@ global: disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-scaffolder-backend-module-kubernetes-dynamic disabled: false - - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-quay:{{ "{{" }}inherit{{ "}}" }}' - disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-scaffolder-backend-module-regex-dynamic disabled: false - package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-servicenow:bs_1.49.4__2.15.0" diff --git a/.ci/pipelines/value_files/values_showcase-rbac.yaml b/.ci/pipelines/value_files/values_showcase-rbac.yaml index fe20492765..fce8ead870 100644 --- a/.ci/pipelines/value_files/values_showcase-rbac.yaml +++ b/.ci/pipelines/value_files/values_showcase-rbac.yaml @@ -155,32 +155,8 @@ global: seconds: 15 timeout: minutes: 15 - - package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-github-issues:bs_1.49.4__0.21.0" - disabled: false - package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-github-pull-requests:bs_1.49.4__3.7.0" disabled: false - - package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-github-actions:bs_1.49.4__0.22.0" - disabled: false - - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-quay-backend:{{ "{{" }}inherit{{ "}}" }}' - disabled: false - pluginConfig: - quay: - apiUrl: https://quay.io - - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-quay:{{ "{{" }}inherit{{ "}}" }}' - disabled: false - pluginConfig: - dynamicPlugins: - frontend: - backstage-community.plugin-quay: - mountPoints: - - mountPoint: entity.page.image-registry/cards - importName: QuayPage - config: - layout: - gridColumn: 1 / -1 - if: - anyOf: - - isQuayAvailable - package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-keycloak-dynamic disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-topology @@ -254,58 +230,6 @@ global: icon: rbacIcon - package: ./dynamic-plugins/dist/backstage-community-plugin-analytics-provider-segment disabled: true - #Enable Scorecard plugin. - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-scorecard:bs_1.45.3__2.3.5 - disabled: false - pluginConfig: - dynamicPlugins: - frontend: - red-hat-developer-hub.backstage-plugin-scorecard: - entityTabs: - - path: "/scorecard" - title: Scorecard - mountPoint: entity.page.scorecard - mountPoints: - - mountPoint: entity.page.scorecard/cards - importName: EntityScorecardContent - config: - layout: - gridColumn: 1 / -1 - - mountPoint: home.page/cards - importName: ScorecardHomepageCard - config: - id: "scorecard-jira.open_issues" - title: "Jira open blocking tickets" - props: { metricId: "jira.open_issues" } - - mountPoint: home.page/cards - importName: ScorecardHomepageCard - config: - id: "scorecard-github.open_prs" - title: "GitHub open PRs" - props: { metricId: "github.open_prs" } - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-scorecard-backend:bs_1.45.3__2.3.5 - disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-scorecard-backend-module-github:bs_1.45.3__2.3.5 - disabled: false - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-scorecard-backend-module-jira:bs_1.45.3__2.3.5 - pluginConfig: - jira: - baseUrl: https://redhat-team-f703ynt3.atlassian.net - token: ${JIRA_TOKEN} - product: cloud - disabled: false - - disabled: false - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-dynamic-home-page:bs_1.45.3__1.10.3 - pluginConfig: - dynamicPlugins: - frontend: - red-hat-developer-hub.backstage-plugin-dynamic-home-page: - dynamicRoutes: - - path: / - importName: DynamicCustomizableHomePage - - disabled: true - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-dynamic-home-page - # Enable orchestrator plugins - Official release - package: 'oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{ "{{" }}inherit{{ "}}" }}' disabled: false diff --git a/.ci/pipelines/value_files/values_showcase.yaml b/.ci/pipelines/value_files/values_showcase.yaml index 72e3a7c044..41464a22a6 100644 --- a/.ci/pipelines/value_files/values_showcase.yaml +++ b/.ci/pipelines/value_files/values_showcase.yaml @@ -164,34 +164,8 @@ global: seconds: 15 timeout: minutes: 15 - - package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-github-issues:bs_1.49.4__0.21.0" - disabled: false - package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/roadiehq-backstage-plugin-github-pull-requests:bs_1.49.4__3.7.0" disabled: false - - package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-github-actions:bs_1.49.4__0.22.0" - disabled: false - - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-quay-backend:{{ "{{" }}inherit{{ "}}" }}' - disabled: false - pluginConfig: - quay: - apiUrl: https://quay.io - - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-quay:{{ "{{" }}inherit{{ "}}" }}' - disabled: false - pluginConfig: - dynamicPlugins: - frontend: - backstage-community.plugin-quay: - mountPoints: - - mountPoint: entity.page.image-registry/cards - importName: QuayPage - config: - layout: - gridColumn: 1 / -1 - if: - anyOf: - - isQuayAvailable - - package: 'oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-community-plugin-scaffolder-backend-module-quay:{{ "{{" }}inherit{{ "}}" }}' - disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-keycloak-dynamic disabled: false - package: ./dynamic-plugins/dist/backstage-plugin-kubernetes @@ -231,21 +205,6 @@ global: disabled: false - package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-header disabled: false - # Enable an extra header test plugin - - package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-global-header-test:bs_1.45.3__0.7.0 - pluginConfig: - dynamicPlugins: - frontend: - red-hat-developer-hub.backstage-plugin-global-header-test: - mountPoints: - - mountPoint: application/header - importName: TestHeader - config: - position: above-main-content - - mountPoint: global.header/component - importName: TestButton - config: - priority: 95 # Enable notifications plugins. - package: ./dynamic-plugins/dist/backstage-plugin-notifications disabled: false @@ -276,15 +235,10 @@ global: disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-catalog-backend-module-scaffolder-relation-processor-dynamic disabled: false - - package: "oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/immobiliarelabs-backstage-plugin-gitlab-backend:bs_1.49.4__7.0.1" - disabled: false - package: ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-gitlab-dynamic disabled: false - package: ./dynamic-plugins/dist/backstage-community-plugin-topology disabled: false - - package: "@pataknight/backstage-plugin-rhdh-qe-theme@0.5.5" - disabled: false - integrity: sha512-srTnFDYn3Ett6z33bX4nL2NQY8wqux8TkpgBQNsE8S73nMfsor/wAdmVgHL+xW7pxQ09DT4YTdaG3GkH+cyyNQ== - package: "@backstage-community/plugin-todo@0.2.42" disabled: false integrity: sha512-agmfwxHkZPy0zaXzjMKY9Us9l7J2og+z7p2lDWQBmlJ1KZRo6OBQdnlG1mTEryfEEl/bx5Ko+f1PhFj2/BmiIQ== diff --git a/dynamic-plugins/_utils/src/wrappers.test.ts b/dynamic-plugins/_utils/src/wrappers.test.ts index 3ef74da42f..b10a11841b 100644 --- a/dynamic-plugins/_utils/src/wrappers.test.ts +++ b/dynamic-plugins/_utils/src/wrappers.test.ts @@ -243,10 +243,6 @@ describe("Dynamic Plugin Wrappers", () => { ); const externalDynamicPluginsConfig: DynamicPluginConfig[] = [ - { - package: "@pataknight/backstage-plugin-rhdh-qe-theme@0.5.5", - disabled: false, - }, { package: "@backstage-community/plugin-todo@0.2.42", }, @@ -258,10 +254,6 @@ describe("Dynamic Plugin Wrappers", () => { package: "@red-hat-developer-hub/backstage-plugin-application-listener-test@0.6.0", }, - { - package: - "@red-hat-developer-hub/backstage-plugin-global-header-test@0.7.0", - }, { package: "oci://quay.io/gashcrumb/example-root-http-middleware:latest!internal-backstage-plugin-middleware-header-example-dynamic", diff --git a/e2e-tests/playwright.config.ts b/e2e-tests/playwright.config.ts index 8d9b2da88d..f22899692c 100644 --- a/e2e-tests/playwright.config.ts +++ b/e2e-tests/playwright.config.ts @@ -118,8 +118,6 @@ export default defineConfig({ "**/playwright/e2e/external-database/verify-tls-config-with-external-azure-db.spec.ts", "**/playwright/e2e/plugin-division-mode-schema/*.spec.ts", "**/playwright/e2e/configuration-test/config-map.spec.ts", - "**/playwright/e2e/dynamic-home-page-customization.spec.ts", - "**/playwright/e2e/plugins/scorecard/scorecard.spec.ts", ...(shouldSkipOrchestratorTests ? ["**/playwright/e2e/plugins/orchestrator/**/*.spec.ts"] : []), @@ -134,7 +132,6 @@ export default defineConfig({ "**/playwright/e2e/external-database/verify-tls-config-with-external-crunchy.spec.ts", "**/playwright/e2e/plugins/bulk-import.spec.ts", "**/playwright/e2e/plugins/quick-start.spec.ts", - "**/playwright/e2e/plugins/scorecard/scorecard.spec.ts", ], testIgnore: [ ...(shouldSkipOrchestratorTests @@ -149,7 +146,6 @@ export default defineConfig({ "**/playwright/e2e/auth-providers/github-happy-path.spec.ts", // temporarily disable "**/playwright/e2e/external-database/verify-tls-config-with-external-rds.spec.ts", "**/playwright/e2e/external-database/verify-tls-config-with-external-azure-db.spec.ts", - "**/playwright/e2e/dynamic-home-page-customization.spec.ts", ], retries: 1, }, @@ -173,8 +169,6 @@ export default defineConfig({ "**/playwright/e2e/external-database/verify-tls-config-with-external-azure-db.spec.ts", "**/playwright/e2e/configuration-test/config-map.spec.ts", "**/playwright/e2e/github-happy-path.spec.ts", - "**/playwright/e2e/dynamic-home-page-customization.spec.ts", - "**/playwright/e2e/plugins/scorecard/scorecard.spec.ts", "**/playwright/e2e/plugin-division-mode-schema/*.spec.ts", "**/playwright/e2e/plugins/orchestrator/**/*.spec.ts", ], @@ -187,7 +181,6 @@ export default defineConfig({ "**/playwright/e2e/plugins/rbac/**/*.spec.ts", "**/playwright/e2e/**/*-rbac.spec.ts", "**/playwright/e2e/plugins/bulk-import.spec.ts", - "**/playwright/e2e/plugins/scorecard/scorecard.spec.ts", ], testIgnore: ["**/playwright/e2e/plugins/orchestrator/**/*.spec.ts"], }, @@ -208,8 +201,6 @@ export default defineConfig({ "**/playwright/e2e/external-database/verify-tls-config-with-external-azure-db.spec.ts", "**/playwright/e2e/configuration-test/config-map.spec.ts", "**/playwright/e2e/github-happy-path.spec.ts", - "**/playwright/e2e/dynamic-home-page-customization.spec.ts", - "**/playwright/e2e/plugins/scorecard/scorecard.spec.ts", "**/playwright/e2e/plugin-division-mode-schema/*.spec.ts", "**/playwright/e2e/plugins/orchestrator/token-propagation-workflow.spec.ts", ], @@ -221,7 +212,6 @@ export default defineConfig({ "**/playwright/e2e/plugins/rbac/**/*.spec.ts", "**/playwright/e2e/**/*-rbac.spec.ts", "**/playwright/e2e/plugins/bulk-import.spec.ts", - "**/playwright/e2e/plugins/scorecard/scorecard.spec.ts", ], testIgnore: [ ...(shouldSkipOrchestratorTests @@ -276,7 +266,6 @@ export default defineConfig({ }, testMatch: [ "**/playwright/e2e/catalog-timestamp.spec.ts", - "**/playwright/e2e/custom-theme.spec.ts", "**/playwright/e2e/plugins/frontend/sidebar.spec.ts", "**/playwright/e2e/settings.spec.ts", ], @@ -288,7 +277,6 @@ export default defineConfig({ }, testMatch: [ "**/playwright/e2e/catalog-timestamp.spec.ts", - "**/playwright/e2e/custom-theme.spec.ts", "**/playwright/e2e/plugins/frontend/sidebar.spec.ts", "**/playwright/e2e/settings.spec.ts", ], @@ -300,7 +288,6 @@ export default defineConfig({ }, testMatch: [ "**/playwright/e2e/catalog-timestamp.spec.ts", - "**/playwright/e2e/custom-theme.spec.ts", "**/playwright/e2e/plugins/frontend/sidebar.spec.ts", "**/playwright/e2e/settings.spec.ts", ], @@ -312,8 +299,6 @@ export default defineConfig({ }, testMatch: [ "**/playwright/e2e/catalog-timestamp.spec.ts", - // TODO: RHDHBUGS-2592 - Custom theme spec is not working - // "**/playwright/e2e/custom-theme.spec.ts", "**/playwright/e2e/plugins/frontend/sidebar.spec.ts", "**/playwright/e2e/settings.spec.ts", ], @@ -325,7 +310,6 @@ export default defineConfig({ }, testMatch: [ "**/playwright/e2e/catalog-timestamp.spec.ts", - "**/playwright/e2e/custom-theme.spec.ts", "**/playwright/e2e/plugins/frontend/sidebar.spec.ts", "**/playwright/e2e/settings.spec.ts", ], diff --git a/e2e-tests/playwright/data/rbac-constants.ts b/e2e-tests/playwright/data/rbac-constants.ts index edc1cb7d1d..c886b222a1 100644 --- a/e2e-tests/playwright/data/rbac-constants.ts +++ b/e2e-tests/playwright/data/rbac-constants.ts @@ -119,12 +119,6 @@ export class RbacConstants { policy: "read", effect: "allow", }, - { - entityReference: "role:default/team_a", - permission: "scorecard.metric.read", - policy: "read", - effect: "allow", - }, { entityReference: "role:xyz/team_a", permission: "catalog-entity", diff --git a/e2e-tests/playwright/data/theme-constants.ts b/e2e-tests/playwright/data/theme-constants.ts deleted file mode 100644 index a413475a6a..0000000000 --- a/e2e-tests/playwright/data/theme-constants.ts +++ /dev/null @@ -1,45 +0,0 @@ -type ThemeInfo = { - name: "Light" | "Dark" | "Light Dynamic" | "Dark Dynamic"; - primaryColor: string; - headerColor1: string; - headerColor2: string; - navigationIndicatorColor: string; -}; - -export class ThemeConstants { - static getThemes() { - const light: ThemeInfo = { - name: "Light", - primaryColor: "#2A61A7", - headerColor1: "rgb(216, 98, 208)", - headerColor2: "rgb(216, 164, 98)", - navigationIndicatorColor: "rgb(98, 216, 105)", - }; - - const dark: ThemeInfo = { - name: "Dark", - primaryColor: "#DC6ED9", - headerColor1: "rgb(190, 122, 45)", - headerColor2: "rgb(45, 190, 50)", - navigationIndicatorColor: "rgb(45, 113, 190)", - }; - - const lightDynamic: ThemeInfo = { - name: "Light Dynamic", - primaryColor: "rgb(255, 95, 21)", - headerColor1: "rgb(248, 248, 248)", - headerColor2: "rgb(248, 248, 248)", - navigationIndicatorColor: "rgb(255, 95, 21)", - }; - - const darkDynamic: ThemeInfo = { - name: "Dark Dynamic", - primaryColor: "#ab75cf", - headerColor1: "rgb(0, 0, 208)", - headerColor2: "rgb(255, 246, 140)", - navigationIndicatorColor: "rgb(244, 238, 169)", - }; - - return [light, dark, darkDynamic, lightDynamic]; - } -} diff --git a/e2e-tests/playwright/e2e/custom-theme.spec.ts b/e2e-tests/playwright/e2e/custom-theme.spec.ts deleted file mode 100644 index f781657f2a..0000000000 --- a/e2e-tests/playwright/e2e/custom-theme.spec.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { test, Page, TestInfo, expect } from "@playwright/test"; -import { Common, setupBrowser } from "../utils/common"; -import { ThemeVerifier } from "../utils/custom-theme/theme-verifier"; -import { - CUSTOM_FAVICON, - CUSTOM_SIDEBAR_LOGO, -} from "../support/test-data/custom-theme"; -import { ThemeConstants } from "../data/theme-constants"; - -// TODO: RHDHBUGS-2552 - Strings not getting translated -// import { -// getTranslations, -// getCurrentLanguage, -// } from "../e2e/localization/locale"; - -// TODO: RHDHBUGS-2552 - Strings not getting translated -// const t = getTranslations(); -// const lang = getCurrentLanguage(); -let page: Page; - -test.describe("CustomTheme should be applied", () => { - let common: Common; - let themeVerifier: ThemeVerifier; - - test.beforeAll(async ({ browser }, testInfo) => { - test.info().annotations.push({ - type: "component", - description: "core", - }); - - page = (await setupBrowser(browser, testInfo)).page; - common = new Common(page); - themeVerifier = new ThemeVerifier(page); - - await common.loginAsGuest(); - }); - - test("Verify theme colors are applied and make screenshots", async ({}, testInfo: TestInfo) => { - const themes = ThemeConstants.getThemes(); - - for (const theme of themes) { - await themeVerifier.setTheme(theme.name); - await themeVerifier.verifyHeaderGradient( - `none, linear-gradient(90deg, ${theme.headerColor1}, ${theme.headerColor2})`, - ); - await themeVerifier.verifyBorderLeftColor(theme.navigationIndicatorColor); - await themeVerifier.takeScreenshotAndAttach( - `screenshots/custom-theme-${theme.name}-inspection.png`, - testInfo, - `custom-theme-${theme.name}-inspection`, - ); - await themeVerifier.verifyPrimaryColors(theme.primaryColor); - } - }); - - test("Verify that the RHDH favicon can be customized", async () => { - await expect(page.locator("#dynamic-favicon")).toHaveAttribute( - "href", - CUSTOM_FAVICON.LIGHT, - ); - }); - - test("Verify that RHDH CompanyLogo can be customized", async () => { - await themeVerifier.setTheme( - // TODO: RHDHBUGS-2552 - Strings not getting translated - "Light", // t["user-settings"][lang]["themeToggle.names.light"], - ); - - await expect(page.getByTestId("home-logo")).toHaveAttribute( - "src", - CUSTOM_SIDEBAR_LOGO.LIGHT, - ); - - await themeVerifier.setTheme( - // TODO: RHDHBUGS-2552 - Strings not getting translated - "Dark", // t["user-settings"][lang]["themeToggle.names.dark"], - ); - await expect(page.getByTestId("home-logo")).toHaveAttribute( - "src", - CUSTOM_SIDEBAR_LOGO.DARK, - ); - }); - - test("Verify logo link", async () => { - await expect( - page.getByTestId("global-header-company-logo").locator("a"), - ).toHaveAttribute("href", "/"); - await page.getByTestId("global-header-company-logo").click(); - await expect(page).toHaveURL("/"); - }); - - test("Verify that title for Backstage can be customized", async () => { - await expect(page).toHaveTitle(/Red Hat Developer Hub/); - }); -}); diff --git a/e2e-tests/playwright/e2e/dynamic-home-page-customization.spec.ts b/e2e-tests/playwright/e2e/dynamic-home-page-customization.spec.ts deleted file mode 100644 index de7144f129..0000000000 --- a/e2e-tests/playwright/e2e/dynamic-home-page-customization.spec.ts +++ /dev/null @@ -1,84 +0,0 @@ -import { test, expect } from "@playwright/test"; -import { Common } from "../utils/common"; -import { HomePageCustomization } from "../support/pages/home-page-customization"; -import { runAccessibilityTests } from "../utils/accessibility"; - -test.describe("Dynamic Home Page Customization", () => { - let common: Common; - let homePageCustomization: HomePageCustomization; - - test.beforeAll(async () => { - test.info().annotations.push({ - type: "component", - description: "core", - }); - }); - - test.beforeEach(async ({ page }) => { - common = new Common(page); - homePageCustomization = new HomePageCustomization(page); - await common.loginAsKeycloakUser(); - }); - - test("Verify Cards Display After Login", async ({ page }, testInfo) => { - await homePageCustomization.verifyHomePageLoaded(); - await homePageCustomization.verifyAllCardsDisplayed(); - await homePageCustomization.verifyEditButtonVisible(); - await runAccessibilityTests(page, testInfo); - }); - - test("Verify All Cards Can Be Resized in Edit Mode", async ({ - page, - }, testInfo) => { - await homePageCustomization.enterEditMode(); - await homePageCustomization.resizeAllCards(); - await homePageCustomization.exitEditMode(); - await runAccessibilityTests(page, testInfo); - }); - - test("Verify Cards Can Be Individually Deleted in Edit Mode", async ({ - page, - }, testInfo) => { - await homePageCustomization.enterEditMode(); - await homePageCustomization.deleteAllCards(); - await homePageCustomization.verifyCardsDeleted(); - await runAccessibilityTests(page, testInfo); - }); - - test("Verify Restore Default Cards", async ({ page }, testInfo) => { - await homePageCustomization.restoreDefaultCards(); - await homePageCustomization.verifyCardsRestored(); - await runAccessibilityTests(page, testInfo); - }); - - test("Verify All Cards can be Deleted with Clear all Button", async ({ - page, - }, testInfo) => { - await homePageCustomization.enterEditMode(); - await homePageCustomization.clearAllCardsWithButton(); - await homePageCustomization.verifyCardsDeleted(); - await runAccessibilityTests(page, testInfo); - }); - - test("Verify Add Widget Button Adds Cards", async ({ page }, testInfo) => { - await homePageCustomization.addWidget("OnboardingSection"); - await expect( - page.getByText(/Good (morning|afternoon|evening)/), - ).toBeVisible(); - await homePageCustomization.enterEditMode(); - - await homePageCustomization.addWidget("EntitySection"); - await expect(page.getByText("Explore Your Software Catalog")).toBeVisible(); - - await homePageCustomization.addWidget("JokeCard"); - await expect(page.getByText("Random Joke")).toBeVisible(); - - await homePageCustomization.addWidget("RecentlyVisitedCard"); - await expect(page.getByText("Recently Visited")).toBeVisible(); - - await homePageCustomization.addWidget("TopVisitedCard"); - await expect(page.getByText("Top Visited")).toBeVisible(); - - await runAccessibilityTests(page, testInfo); - }); -}); diff --git a/e2e-tests/playwright/e2e/github-happy-path.spec.ts b/e2e-tests/playwright/e2e/github-happy-path.spec.ts index f17aaf5625..8a17fbfe89 100644 --- a/e2e-tests/playwright/e2e/github-happy-path.spec.ts +++ b/e2e-tests/playwright/e2e/github-happy-path.spec.ts @@ -121,21 +121,6 @@ test.describe.fixme("GitHub Happy path", async () => { await backstageShowcase.verifyAboutCardIsDisplayed(); }); - test("Verify that the Issues tab renders all the open github issues in the repository", async () => { - await uiHelper.clickTab("Issues"); - await common.clickOnGHloginPopup(); - const openIssues = await backstageShowcase.getGithubOpenIssues(); - - const issuesCountText = new RegExp( - `All repositories \\(${openIssues.length} Issue.*\\)`, - ); - await expect(page.getByText(issuesCountText)).toBeVisible(); - - for (const issue of openIssues.slice(0, 5)) { - await uiHelper.verifyText(issue.title.replace(/\s+/g, " ")); - } - }); - test("Verify that the Pull/Merge Requests tab renders the 5 most recently updated Open Pull Requests", async () => { await uiHelper.clickTab("Pull/Merge Requests"); const openPRs = await BackstageShowcase.getShowcasePRs("open"); @@ -197,18 +182,6 @@ test.describe.fixme("GitHub Happy path", async () => { await backstageShowcase.verifyPRRowsPerPage(20, allPRs); }); - // 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(); - await common.checkAndClickOnGHloginPopup(); - - const workflowRuns = await backstageShowcase.getWorkflowRuns(); - - for (const workflowRun of workflowRuns.slice(0, 5)) { - await uiHelper.verifyText(workflowRun.id); - } - }); - // TODO: https://issues.redhat.com/browse/RHDHBUGS-2099 test.fixme("Click on the Dependencies tab and verify that all the relations have been listed and displayed", async () => { await uiHelper.clickTab("Dependencies"); diff --git a/e2e-tests/playwright/e2e/header-mount-points.spec.ts b/e2e-tests/playwright/e2e/header-mount-points.spec.ts deleted file mode 100644 index 5ca690a222..0000000000 --- a/e2e-tests/playwright/e2e/header-mount-points.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { expect, test } from "@playwright/test"; -import { UIhelper } from "../utils/ui-helper"; -import { Common } from "../utils/common"; - -test.describe("Header mount points", () => { - let common: Common; - let uiHelper: UIhelper; - - test.beforeAll(async () => { - test.info().annotations.push({ - type: "component", - description: "navigation", - }); - }); - - test.beforeEach(async ({ page }) => { - common = new Common(page); - uiHelper = new UIhelper(page); - await common.loginAsGuest(); - await expect(page.locator("nav[id='global-header']")).toBeVisible(); - }); - - test("Verify that additional logo component in global header is visible", async ({ - page, - }) => { - const header = page.locator("nav[id='global-header']"); - await expect(header).toBeVisible(); - await uiHelper.verifyLink({ label: "test-logo" }); - }); - - test("Verify that additional header button component from a custom header plugin in global header is visible", async ({ - page, - }) => { - const header = page.locator("nav[id='global-header']"); - await expect(header).toBeVisible(); - await expect( - header.locator("button", { hasText: "Test Button" }), - ).toHaveCount(1); - }); - - test("Verify that additional header from a custom header plugin besides the default one is visible", async ({ - page, - }) => { - const header = page.locator("header", { - hasText: "This is a test header!", - }); - await expect(header).toBeVisible(); - }); -}); diff --git a/e2e-tests/playwright/e2e/plugins/gitlab/gitlab-discovery.spec.ts b/e2e-tests/playwright/e2e/plugins/gitlab/gitlab-discovery.spec.ts deleted file mode 100644 index 06efab9e82..0000000000 --- a/e2e-tests/playwright/e2e/plugins/gitlab/gitlab-discovery.spec.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { test } from "@playwright/test"; -import { UIhelper } from "../../../utils/ui-helper"; -import { Common } from "../../../utils/common"; - -// Pre-req: backstage-plugin-catalog-backend-module-gitlab-dynamic -// Pre-req: immobiliarelabs-backstage-plugin-gitlab-backend-dynamic -// Using GH_USER_ID account -test.describe("gitlab discovery UI tests", () => { - let uiHelper: UIhelper; - let common: Common; - - test.beforeAll(async () => { - test.info().annotations.push({ - type: "component", - description: "plugins", - }); - }); - - test.beforeEach(async ({ page }) => { - uiHelper = new UIhelper(page); - common = new Common(page); - await common.loginAsGuest(); - await uiHelper.openSidebar("Catalog"); - }); - - test("GitLab integration for discovering catalog entities from GitLab", async ({ - page, - }) => { - // Dismiss quickstart overlay if visible — it can interfere with search input - await uiHelper.hideQuickstartIfVisible(); - // Wait for catalog table search input to be ready before searching - await page - .getByRole("textbox", { name: "Search" }) - .waitFor({ state: "visible" }); - await uiHelper.searchInputPlaceholder("scaffoldedForm"); - await uiHelper.verifyText("scaffoldedForm-test"); - await uiHelper.clickLink("scaffoldedForm-test"); - await uiHelper.verifyHeading("scaffoldedForm-test"); - await uiHelper.verifyText("My Description"); - await uiHelper.verifyText("experimental"); - await uiHelper.verifyText("website"); - await uiHelper.verifyLink("View Source"); - }); -}); diff --git a/e2e-tests/playwright/e2e/plugins/quay/quay-actions.spec.ts b/e2e-tests/playwright/e2e/plugins/quay/quay-actions.spec.ts deleted file mode 100644 index 8e8e5efb64..0000000000 --- a/e2e-tests/playwright/e2e/plugins/quay/quay-actions.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Page, test } from "@playwright/test"; -import { Common, setupBrowser } from "../../../utils/common"; -import { UIhelper } from "../../../utils/ui-helper"; -import { UI_HELPER_ELEMENTS } from "../../../support/page-objects/global-obj"; -import { QuayClient } from "../../../utils/quay/quay-client"; - -test.describe("Test Quay Actions plugin", () => { - let common: Common; - let uiHelper: UIhelper; - let page: Page; - let quayClient: QuayClient; - let repository: string; - - test.beforeAll(async ({ browser }, testInfo) => { - test.info().annotations.push({ - type: "component", - description: "plugins", - }); - - page = (await setupBrowser(browser, testInfo)).page; - common = new Common(page); - uiHelper = new UIhelper(page); - quayClient = new QuayClient(); - - await common.loginAsGuest(); - await uiHelper.goToSelfServicePage(); - }); - - test("Creates Quay repository", async () => { - repository = `quay-actions-create-${Date.now()}`; - const description = - "This is just a test repository to test the 'quay:create-repository' template action"; - await uiHelper.verifyHeading("Self-service"); - await uiHelper.clickBtnInCard("Create a Quay repository", "Choose"); - await uiHelper.waitForTitle("Create a Quay repository", 2); - - await uiHelper.fillTextInputByLabel("Repository name", repository); - await uiHelper.fillTextInputByLabel("Token", process.env.QUAY_TOKEN); - await uiHelper.fillTextInputByLabel( - "namespace", - process.env.QUAY_NAMESPACE, - ); - await page.getByRole("button", { name: "Visibility​" }).click(); - await page.click('li:has-text("public")'); - await uiHelper.fillTextInputByLabel("Description", description); - await uiHelper.clickButton("Review"); - await uiHelper.clickButton("Create"); - await page.waitForSelector( - `${UI_HELPER_ELEMENTS.MuiTypography}:has-text("second")`, - ); - await uiHelper.clickLink("Quay repository link"); - }); - - test.afterEach(async () => { - await quayClient.deleteRepository(process.env.QUAY_NAMESPACE, repository); - }); -}); diff --git a/e2e-tests/playwright/e2e/plugins/quay/quay.spec.ts b/e2e-tests/playwright/e2e/plugins/quay/quay.spec.ts deleted file mode 100644 index 11251c0ef3..0000000000 --- a/e2e-tests/playwright/e2e/plugins/quay/quay.spec.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { expect, test } from "@playwright/test"; -import { UIhelper } from "../../../utils/ui-helper"; -import { Common } from "../../../utils/common"; -import { ImageRegistry } from "../../../utils/quay/quay"; - -test.describe("Test Quay.io plugin", () => { - const quayRepository = "rhdh-community/rhdh"; - let uiHelper: UIhelper; - - test.beforeAll(async () => { - test.info().annotations.push({ - type: "component", - description: "plugins", - }); - }); - - test.beforeEach(async ({ page }) => { - const common = new Common(page); - await common.loginAsGuest(); - - uiHelper = new UIhelper(page); - await uiHelper.openCatalogSidebar("Component"); - await uiHelper.searchInputPlaceholder("Developer Hub"); - await uiHelper.clickLink("Red Hat Developer Hub"); - await uiHelper.clickTab("Image Registry"); - }); - - test("Check if Image Registry is present", async ({ page }) => { - await uiHelper.verifyHeading(quayRepository); - - const allGridColumnsText = ImageRegistry.getAllGridColumnsText(); - - // Verify Headers - for (const column of allGridColumnsText) { - const columnLocator = page - .getByRole("columnheader") - .filter({ hasText: column }); - await expect(columnLocator).toBeVisible(); - } - - await page.getByTestId("quay-repo-table").waitFor({ state: "visible" }); - // Only show images that have a size - await uiHelper.searchInputAriaLabel("GB"); - // Verify cells with the adjusted selector - const allCellsIdentifier = ImageRegistry.getAllCellsIdentifier(); - await uiHelper.verifyCellsInTable(allCellsIdentifier); - }); - - test("Check Security Scan details", async ({ page }) => { - const cell = await ImageRegistry.getScanCell(page); - await expect(cell).toBeVisible(); - }); -}); diff --git a/e2e-tests/playwright/e2e/plugins/scorecard/scorecard.spec.ts b/e2e-tests/playwright/e2e/plugins/scorecard/scorecard.spec.ts deleted file mode 100644 index c17f9646e7..0000000000 --- a/e2e-tests/playwright/e2e/plugins/scorecard/scorecard.spec.ts +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { test } from "@support/shared-page"; -import { Common } from "../../../utils/common"; -import { Catalog } from "../../../support/pages/catalog"; -// TODO: Re-enable/uncomment once https://issues.redhat.com/browse/RHIDP-12130 is fixed -// import { CatalogImport } from "../../../support/pages/catalog-import"; -import { ScorecardPage } from "../../../support/page-objects/scorecard/scorecard-page"; -import type { Page } from "@playwright/test"; - -test.describe.serial("Scorecard Plugin Tests", () => { - let page: Page; - let catalog: Catalog; - // TODO: Re-enable/uncomment once https://issues.redhat.com/browse/RHIDP-12130 is fixed - // let catalogImport: CatalogImport; - let scorecardPage: ScorecardPage; - - let initialGithubCount: number; - let initialJiraCount: number; - - test.beforeAll(async ({ sharedPage }, testInfo) => { - testInfo.annotations.push({ - type: "component", - description: "scorecard", - }); - - page = sharedPage; - catalog = new Catalog(page); - // TODO: Re-enable/uncomment once https://issues.redhat.com/browse/RHIDP-12130 is fixed - // catalogImport = new CatalogImport(page); - scorecardPage = new ScorecardPage(page); - await new Common(page).loginAsKeycloakUser(); - }); - - test("Setup aggregated scorecards on homepage", async () => { - await scorecardPage.navigateToHome(); - - await scorecardPage.enterEditModeIfNeeded(); - await scorecardPage.openAddWidgetDialog(); - await scorecardPage.selectWidget("GitHub open PRs"); - await scorecardPage.expectNoProgressBar(); - await scorecardPage.enterEditMode(); - await scorecardPage.expectNoProgressBar(); - await scorecardPage.openAddWidgetDialog(); - await scorecardPage.selectWidget("Jira open blocking tickets"); - await scorecardPage.expectWidgetCount(2); - - await scorecardPage.saveChanges(); - - const [githubMetric, jiraMetric] = scorecardPage.scorecardMetrics; - - await scorecardPage.expectAggregatedScorecardVisible(githubMetric.title); - await scorecardPage.expectAggregatedScorecardVisible(jiraMetric.title); - - initialGithubCount = await scorecardPage.getAggregatedScorecardEntityCount( - githubMetric.title, - ); - initialJiraCount = await scorecardPage.getAggregatedScorecardEntityCount( - jiraMetric.title, - ); - }); - - test.describe("Entity Scorecards", () => { - // TODO: Re-enable/uncomment once https://issues.redhat.com/browse/RHIDP-12130 is fixed - // test.beforeAll(async () => { - // const addonTestUrl = - // "https://github.com/janus-qe/RHDH-scorecard-plugin-test/blob/main/addon-test.yaml"; - - // await catalog.go(); - // await page.getByRole("button", { name: "Self-service" }).click(); - // await scorecardPage.uiHelper.clickButton( - // "Import an existing Git repository", - // ); - // await catalogImport.registerExistingComponent(addonTestUrl); - // }); - - test("Validate scorecard tabs for GitHub PRs and Jira tickets", async () => { - await catalog.go(); - await catalog.goToByName("all-scorecards"); - await scorecardPage.openTab(); - - for (const metric of scorecardPage.scorecardMetrics) { - await scorecardPage.validateScorecardAriaFor(metric); - } - }); - - test("Validate empty scorecard state", async () => { - await catalog.go(); - await catalog.goToByName("no-scorecards"); - await scorecardPage.openTab(); - await scorecardPage.expectEmptyState(); - }); - - test("Displays error state for unavailable data while rendering metrics", async () => { - await catalog.go(); - await catalog.goToByName("unavailable-metric-service"); - await scorecardPage.openTab(); - - const [githubMetric, jiraMetric] = scorecardPage.scorecardMetrics; - - await scorecardPage.expectScorecardVisible(githubMetric.title); - await scorecardPage.expectScorecardVisible(jiraMetric.title); - await scorecardPage.expectErrorHeading("Metric data unavailable"); - await scorecardPage.validateScorecardAriaFor(jiraMetric); - }); - - test("Validate only GitHub scorecard is displayed", async () => { - await catalog.go(); - await catalog.goToByName("github-scorecard-only"); - await scorecardPage.openTab(); - - const [githubMetric, jiraMetric] = scorecardPage.scorecardMetrics; - - await scorecardPage.expectScorecardVisible(githubMetric.title); - await scorecardPage.expectScorecardHidden(jiraMetric.title); - await scorecardPage.validateScorecardAriaFor(githubMetric); - }); - - test("Validate only Jira scorecard is displayed", async () => { - await catalog.go(); - await catalog.goToByName("jira-scorecard-only"); - await scorecardPage.openTab(); - - const [githubMetric, jiraMetric] = scorecardPage.scorecardMetrics; - - await scorecardPage.expectScorecardHidden(githubMetric.title); - await scorecardPage.expectScorecardVisible(jiraMetric.title); - await scorecardPage.validateScorecardAriaFor(jiraMetric); - }); - - test("Display error state for invalid threshold config while rendering metrics", async () => { - await catalog.go(); - await catalog.goToByName("invalid-threshold"); - await scorecardPage.openTab(); - - const [githubMetric, jiraMetric] = scorecardPage.scorecardMetrics; - - await scorecardPage.expectScorecardVisible(githubMetric.title); - await scorecardPage.expectScorecardVisible(jiraMetric.title); - await scorecardPage.expectErrorHeading("Invalid thresholds"); - await scorecardPage.validateScorecardAriaFor(jiraMetric); - }); - - // TODO: Re-enable/uncomment once https://issues.redhat.com/browse/RHIDP-12130 is fixed - test.skip("Validate scorecards on imported addon-test entity", async () => { - await catalog.go(); - await catalog.goToByName("addon-test"); - await scorecardPage.openTab(); - - const [githubMetric, jiraMetric] = scorecardPage.scorecardMetrics; - - await scorecardPage.expectScorecardVisible(githubMetric.title); - await scorecardPage.expectScorecardVisible(jiraMetric.title); - }); - }); - - // TODO: Re-enable/uncomment once https://issues.redhat.com/browse/RHIDP-12130 is fixed - test.skip("Verify aggregated scorecard counts increased after import", async () => { - await scorecardPage.navigateToHome(); - - const [githubMetric, jiraMetric] = scorecardPage.scorecardMetrics; - - await scorecardPage.expectAggregatedScorecardEntityCountToBe( - githubMetric.title, - initialGithubCount + 1, - ); - await scorecardPage.expectAggregatedScorecardEntityCountToBe( - jiraMetric.title, - initialJiraCount + 1, - ); - }); -}); diff --git a/e2e-tests/playwright/support/page-objects/scorecard/scorecard-page.ts b/e2e-tests/playwright/support/page-objects/scorecard/scorecard-page.ts deleted file mode 100644 index 40018ed018..0000000000 --- a/e2e-tests/playwright/support/page-objects/scorecard/scorecard-page.ts +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright Red Hat, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Page, expect, Locator } from "@playwright/test"; -import { UIhelper } from "../../../utils/ui-helper"; - -export class ScorecardPage { - readonly page: Page; - readonly uiHelper: UIhelper; - - constructor(page: Page) { - this.page = page; - this.uiHelper = new UIhelper(page); - } - - get scorecardMetrics() { - return [ - { - title: "GitHub open PRs", - description: - "Current count of open Pull Requests for a given GitHub repository.", - }, - { - title: "Jira open blocking tickets", - description: - "Highlights the number of critical, blocking issues that are currently open in Jira.", - }, - ]; - } - - getScorecardLocator(scorecardTitle: string): Locator { - return this.page.getByText(scorecardTitle, { exact: true }); - } - - getErrorHeading(errorText: string): Locator { - return this.page.getByText(errorText, { exact: true }); - } - - async openTab() { - const scorecardTab = this.page.getByRole("tab", { name: "Scorecard" }); - await expect(scorecardTab).toBeVisible(); - await scorecardTab.click(); - } - - async expectEmptyState() { - await expect(this.page.getByText("No scorecards added yet")).toBeVisible(); - await expect(this.page.getByRole("article")).toContainText( - "Scorecards help you monitor component health at a glance. To begin, explore our documentation for setup guidelines.", - ); - await expect( - this.page.getByRole("link", { name: "View documentation" }), - ).toBeVisible(); - } - - async validateScorecardAriaFor(scorecard: { - title: string; - description: string; - }) { - const { title, description } = scorecard; - - const scorecardSection = this.page - .locator("article") - .filter({ hasText: title }); - - await expect(scorecardSection).toMatchAriaSnapshot(` - - article: - - text: ${title} - - paragraph: ${description} - - paragraph: /Success/ - - paragraph: /Warning/ - - paragraph: /Error/ - `); - } - - async expectScorecardVisible(scorecardTitle: string) { - await expect(this.getScorecardLocator(scorecardTitle)).toBeVisible(); - } - - async expectScorecardHidden(scorecardTitle: string) { - await expect(this.getScorecardLocator(scorecardTitle)).toBeHidden(); - } - - async expectErrorHeading(errorText: string) { - await expect(this.getErrorHeading(errorText)).toBeVisible(); - } - - async navigateToHome() { - await this.uiHelper.openSidebar("Home"); - } - - async enterEditMode() { - await this.page.getByRole("button", { name: "Edit" }).click(); - } - - async enterEditModeIfNeeded() { - const editButton = this.page.getByRole("button", { name: "Edit" }); - if (await editButton.isVisible()) { - await editButton.click(); - } - } - - async openAddWidgetDialog() { - await this.page.getByRole("button", { name: "Add widget" }).click(); - } - - async selectWidget(cardName: string) { - await this.page.getByRole("button", { name: cardName }).click(); - } - - async expectNoProgressBar() { - await expect( - this.page.getByRole("article").getByRole("progressbar").first(), - ).toBeHidden({ - timeout: 5000, - }); - } - - async expectWidgetCount(count: number) { - await expect(this.page.locator(".react-grid-item")).toHaveCount(count); - } - - async saveChanges() { - await this.page.getByRole("button", { name: "Save" }).click(); - } - - getAggregatedScorecardCard(metricTitle: string): Locator { - return this.page.locator("article").filter({ hasText: metricTitle }); - } - - async expectAggregatedScorecardVisible(metricTitle: string) { - await expect(this.getAggregatedScorecardCard(metricTitle)).toBeVisible(); - } - - async getAggregatedScorecardEntityCount( - metricTitle: string, - ): Promise { - const card = this.getAggregatedScorecardCard(metricTitle); - const text = await card.textContent(); - const match = text?.match(/(\d+)\s*entities/); - return match ? parseInt(match[1], 10) : 0; - } - - async expectAggregatedScorecardEntityCountToBe( - metricTitle: string, - expectedCount: number, - ) { - const card = this.getAggregatedScorecardCard(metricTitle); - await expect(card).toContainText(`${expectedCount} entities`); - } -} diff --git a/e2e-tests/playwright/support/pages/catalog-import.ts b/e2e-tests/playwright/support/pages/catalog-import.ts index ba228b19ce..3fef08ac87 100644 --- a/e2e-tests/playwright/support/pages/catalog-import.ts +++ b/e2e-tests/playwright/support/pages/catalog-import.ts @@ -1,11 +1,10 @@ import { Page, expect } from "@playwright/test"; import { UIhelper } from "../../utils/ui-helper"; +import { APIHelper } from "../../utils/api-helper"; import { BACKSTAGE_SHOWCASE_COMPONENTS, CATALOG_IMPORT_COMPONENTS, } from "../page-objects/page-obj"; -import { APIHelper } from "../../utils/api-helper"; -import { GITHUB_API_ENDPOINTS } from "../../utils/api-endpoints"; import { getTranslations, getCurrentLanguage, @@ -115,15 +114,6 @@ export class BackstageShowcase { this.uiHelper = new UIhelper(page); } - async getGithubOpenIssues() { - const rep = await APIHelper.getGithubPaginatedRequest( - GITHUB_API_ENDPOINTS.issues("open"), - ); - return rep.filter( - (issue: { pull_request: boolean }) => !issue.pull_request, - ); - } - static async getShowcasePRs( state: "open" | "closed" | "all", paginated = false, @@ -167,15 +157,6 @@ export class BackstageShowcase { await this.page.click(`ul[role="listbox"] li[data-value="${rows}"]`); } - async getWorkflowRuns() { - const response = await APIHelper.githubRequest( - "GET", - GITHUB_API_ENDPOINTS.workflowRuns, - ); - const responseBody = await response.json(); - return responseBody.workflow_runs; - } - async verifyPRStatisticsRendered() { const regex = /Average Size Of PR\d+ lines/; await this.uiHelper.verifyText(regex); diff --git a/e2e-tests/playwright/support/pages/home-page-customization.ts b/e2e-tests/playwright/support/pages/home-page-customization.ts deleted file mode 100644 index 75d8ed41d5..0000000000 --- a/e2e-tests/playwright/support/pages/home-page-customization.ts +++ /dev/null @@ -1,211 +0,0 @@ -import { Page, expect, Locator } from "@playwright/test"; -import { UIhelper } from "../../utils/ui-helper"; - -export class HomePageCustomization { - private page: Page; - private uiHelper: UIhelper; - - private readonly expectedCards = [ - "Good (morning|afternoon|evening)", - "Explore Your Software Catalog", - "Recently Visited", - "Top Visited", - ]; - - // Locators - private readonly editButton = () => this.page.getByText("Edit"); - private readonly saveButton = () => this.page.getByText("Save"); - private readonly clearAllButton = () => this.page.getByText("Clear all"); - private readonly restoreDefaultsButton = () => - this.page.getByText("Restore defaults"); - private readonly addWidgetButton = () => - this.page.getByRole("button", { name: "Add widget" }); - private readonly resizeHandles = () => - this.page.locator(".react-resizable-handle"); - private readonly deleteButtons = () => - this.page.locator('[class*="MuiGrid-root"][class*="overlayGridItem"]'); - private readonly greetingText = () => - this.page.getByText(/Good (morning|afternoon|evening)/); - - constructor(page: Page) { - this.page = page; - this.uiHelper = new UIhelper(page); - } - - async verifyHomePageLoaded(): Promise { - await this.uiHelper.verifyHeading("Welcome back"); - await expect(this.greetingText()).toBeVisible(); - await this.uiHelper.hideQuickstartIfVisible(); - } - - async verifyAllCardsDisplayed(): Promise { - for (const card of this.expectedCards) { - if (card.includes("Good")) { - await expect(this.greetingText()).toBeVisible(); - } else { - await this.uiHelper.verifyText(card); - } - } - } - - async verifyEditButtonVisible(): Promise { - await this.uiHelper.verifyText("Edit"); - } - - async enterEditMode(): Promise { - await this.uiHelper.clickButton("Edit"); - await expect(this.saveButton()).toBeVisible(); - } - - async exitEditMode(): Promise { - await this.uiHelper.clickButton("Save"); - await expect(this.editButton()).toBeVisible(); - } - - async resizeAllCards(): Promise { - const allHandles = this.resizeHandles(); - const handleCount = await allHandles.count(); - expect(handleCount).toBeGreaterThan(0); - - // Store initial dimensions - const initialDimensions = await this.getPanelDimensions( - allHandles, - handleCount, - ); - - // Resize all panels - await this.performResizeOnAllPanels(allHandles, handleCount); - - // Verify all panels were resized - await this.verifyPanelsResized(allHandles, handleCount, initialDimensions); - } - - private async getPanelDimensions( - allHandles: Locator, - handleCount: number, - ): Promise> { - const initialDimensions = []; - for (let i = 0; i < handleCount; i++) { - const panel = allHandles.nth(i).locator("..").locator(".."); - const box = await panel.boundingBox(); - expect(box).not.toBeNull(); - initialDimensions.push({ width: box!.width, height: box!.height }); - } - return initialDimensions; - } - - private async performResizeOnAllPanels( - allHandles: Locator, - handleCount: number, - ): Promise { - for (let i = 0; i < handleCount; i++) { - const handle = allHandles.nth(i); - await this.page.evaluate( - (handleElement) => { - const rect = handleElement.getBoundingClientRect(); - const startX = rect.left + rect.width / 2; - const startY = rect.top + rect.height / 2; - const endX = startX + 300; - const endY = startY + 300; - - const mouseDown = new MouseEvent("mousedown", { - clientX: startX, - clientY: startY, - bubbles: true, - }); - handleElement.dispatchEvent(mouseDown); - - setTimeout(() => { - const mouseMove = new MouseEvent("mousemove", { - clientX: endX, - clientY: endY, - bubbles: true, - }); - handleElement.dispatchEvent(mouseMove); - - setTimeout(() => { - const mouseUp = new MouseEvent("mouseup", { - clientX: endX, - clientY: endY, - bubbles: true, - }); - handleElement.dispatchEvent(mouseUp); - }, 200); - }, 200); - }, - await handle.elementHandle(), - ); - - await this.page.waitForTimeout(500); - } - } - - private async verifyPanelsResized( - allHandles: Locator, - handleCount: number, - initialDimensions: Array<{ width: number; height: number }>, - ): Promise { - for (let i = 0; i < handleCount; i++) { - const panel = allHandles.nth(i).locator("..").locator(".."); - const finalBox = await panel.boundingBox(); - expect(finalBox).not.toBeNull(); - - const widthChanged = finalBox!.width !== initialDimensions[i].width; - const heightChanged = finalBox!.height !== initialDimensions[i].height; - expect(widthChanged || heightChanged).toBe(true); - } - } - - async deleteAllCards(): Promise { - while (true) { - const currentButtons = this.deleteButtons(); - const currentCount = await currentButtons.count(); - if (currentCount > 0) { - await currentButtons.first().click(); - await this.page.waitForTimeout(1000); - } else { - break; - } - } - } - - async clearAllCardsWithButton(): Promise { - await this.uiHelper.clickButton("Clear all"); - } - - async verifyCardsDeleted(): Promise { - // Verify UI state after deletion - await expect(this.clearAllButton()).toBeHidden(); - await expect(this.saveButton()).toBeHidden(); - await expect(this.restoreDefaultsButton()).toBeVisible(); - await expect(this.addWidgetButton()).toBeVisible(); - - // Verify that all cards are not present on the page - for (const card of this.expectedCards) { - if (card.includes("Good")) { - await expect(this.greetingText()).toBeHidden(); - } else { - await expect(this.page.getByText(card)).toBeHidden(); - } - } - } - - async restoreDefaultCards(): Promise { - await this.uiHelper.clickButton("Restore defaults"); - await this.page.waitForTimeout(2000); - } - - async verifyCardsRestored(): Promise { - await this.verifyAllCardsDisplayed(); - await expect(this.editButton()).toBeVisible(); - } - - async addWidget(widgetType: string = "OnboardingSection"): Promise { - await this.uiHelper.clickButton("Add widget"); - await this.page.waitForTimeout(1000); // Wait for dialog to open - - // Select the specific widget type from the dialog - await this.page.getByRole("button", { name: widgetType }).click(); - await this.page.waitForTimeout(1000); - } -} diff --git a/e2e-tests/playwright/support/test-data/custom-theme.ts b/e2e-tests/playwright/support/test-data/custom-theme.ts deleted file mode 100644 index 132e93a245..0000000000 --- a/e2e-tests/playwright/support/test-data/custom-theme.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const CUSTOM_FAVICON = { - LIGHT: - "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2280pt%22%20height%3D%2280pt%22%20viewBox%3D%220%200%2080%2080%22%3E%3Ctext%20fill%3D%22%23000%22%20font-family%3D%22Red%20Hat%20Mono%22%20font-size%3D%2264%22%20font-weight%3D%22700%22%20letter-spacing%3D%220%22%20style%3D%22text-align%3Astart%3Btext-align-last%3Aauto%22%20transform%3D%22translate(1.6%2062.813)%22%20word-spacing%3D%220%22%3E%3Ctspan%20x%3D%220%22%3EQE%3C%2Ftspan%3E%3C%2Ftext%3E%3C%2Fsvg%3E", - DARK: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2280pt%22%20height%3D%2280pt%22%20viewBox%3D%220%200%2080%2080%22%3E%3Ctext%20fill%3D%22%23fff%22%20font-family%3D%22Red%20Hat%20Mono%22%20font-size%3D%2264%22%20font-weight%3D%22700%22%20letter-spacing%3D%220%22%20style%3D%22text-align%3Astart%3Btext-align-last%3Aauto%22%20transform%3D%22translate(1.6%2062.813)%22%20word-spacing%3D%220%22%3E%3Ctspan%20x%3D%220%22%3EQE%3C%2Ftspan%3E%3C%2Ftext%3E%3C%2Fsvg%3E", -}; - -export const CUSTOM_SIDEBAR_LOGO = { - LIGHT: - "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22160pt%22%20height%3D%2280pt%22%20viewBox%3D%220%200%20160%2080%22%3E%3Cg%20fill%3D%22%23000%22%20style%3D%22text-align%3Astart%3Btext-align-last%3Aauto%22%20letter-spacing%3D%220%22%3E%3Ctext%20font-family%3D%22Red%20Hat%20Display%22%20font-size%3D%2240%22%20font-weight%3D%22700%22%20transform%3D%22translate(-.177%2054.263)%22%20word-spacing%3D%220%22%3E%3Ctspan%20x%3D%220%22%3EQE%3C%2Ftspan%3E%3C%2Ftext%3E%3Ctext%20font-family%3D%22Red%20Hat%20Text%22%20font-size%3D%2214%22%20font-weight%3D%22700%22%20transform%3D%22translate(57.565%2035.73)%22%20word-spacing%3D%220%22%3E%3Ctspan%20x%3D%220%22%3ERed%20Hat%3C%2Ftspan%3E%3Ctspan%20x%3D%220%22%20dy%3D%2218.516%22%3EDeveloper%20Hub%3C%2Ftspan%3E%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fsvg%3E", - DARK: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22160pt%22%20height%3D%2280pt%22%20viewBox%3D%220%200%20160%2080%22%3E%3Cg%20fill%3D%22%23fff%22%20style%3D%22text-align%3Astart%3Btext-align-last%3Aauto%22%20letter-spacing%3D%220%22%3E%3Ctext%20font-family%3D%22Red%20Hat%20Display%22%20font-size%3D%2240%22%20font-weight%3D%22700%22%20transform%3D%22translate(-.177%2054.263)%22%20word-spacing%3D%220%22%3E%3Ctspan%20x%3D%220%22%3EQE%3C%2Ftspan%3E%3C%2Ftext%3E%3Ctext%20font-family%3D%22Red%20Hat%20Text%22%20font-size%3D%2214%22%20font-weight%3D%22700%22%20transform%3D%22translate(57.565%2035.73)%22%20word-spacing%3D%220%22%3E%3Ctspan%20x%3D%220%22%3ERed%20Hat%3C%2Ftspan%3E%3Ctspan%20x%3D%220%22%20dy%3D%2218.516%22%3EDeveloper%20Hub%3C%2Ftspan%3E%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fsvg%3E", -}; diff --git a/e2e-tests/playwright/utils/api-endpoints.ts b/e2e-tests/playwright/utils/api-endpoints.ts index 2e39911c97..9555508b74 100644 --- a/e2e-tests/playwright/utils/api-endpoints.ts +++ b/e2e-tests/playwright/utils/api-endpoints.ts @@ -5,19 +5,12 @@ const getRepoUrl = (owner: string, repo: string) => `${baseApiUrl}/repos/${owner}/${repo}`; const getOrgUrl = (owner: string) => `${baseApiUrl}/orgs/${owner}`; -const backstageShowcaseAPI = getRepoUrl("janus-idp", "backstage-showcase"); - export const GITHUB_API_ENDPOINTS = { pull: (owner: string, repo: string, state: "open" | "closed" | "all") => `${getRepoUrl(owner, repo)}/pulls?per_page=${perPage}&state=${state}`, orgRepos: (owner: string) => `${getOrgUrl(owner)}/repos?per_page=${perPage}`, - issues: (state: string) => - `${backstageShowcaseAPI}/issues?per_page=${perPage}&sort=updated&state=${state}`, - - workflowRuns: `${backstageShowcaseAPI}/actions/runs?per_page=${perPage}`, - deleteRepo: getRepoUrl, mergePR: (owner: string, repoName: string, pullNumber: number) => diff --git a/e2e-tests/playwright/utils/custom-theme/theme-verifier.ts b/e2e-tests/playwright/utils/custom-theme/theme-verifier.ts deleted file mode 100644 index 8d2b31bd1a..0000000000 --- a/e2e-tests/playwright/utils/custom-theme/theme-verifier.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { Page, expect, TestInfo } from "@playwright/test"; -import { UIhelper } from "../ui-helper"; -import { UI_HELPER_ELEMENTS } from "../../support/page-objects/global-obj"; -import { - getTranslations, - getCurrentLanguage, -} from "../../e2e/localization/locale"; - -const t = getTranslations(); -const lang = getCurrentLanguage(); -export class ThemeVerifier { - private readonly page: Page; - private uiHelper: UIhelper; - - constructor(page: Page) { - this.page = page; - this.uiHelper = new UIhelper(page); - } - - async setTheme(theme: "Light" | "Dark" | "Light Dynamic" | "Dark Dynamic") { - await this.uiHelper.goToSettingsPage(); - await this.uiHelper.hideQuickstartIfVisible(); - await this.uiHelper.clickBtnByTitleIfNotPressed( - `${t["user-settings"][lang]["themeToggle.select"].replace("{{theme}}", theme)}`, - ); - const themeButton = this.page.getByRole("button", { - name: theme, - exact: true, - }); - - // TODO: https://issues.redhat.com/browse/RHDHBUGS-2076 navigating back to settings page is needed until the issue is resolved - await this.uiHelper.goToSettingsPage(); - - await expect(themeButton).toHaveAttribute("aria-pressed", "true"); - } - - async verifyHeaderGradient(expectedGradient: string) { - const header = this.page.locator("main header").first(); - await expect(header).toBeVisible(); - await expect(header).toHaveCSS("background-image", expectedGradient); - } - - async verifyBorderLeftColor(expectedColor: string) { - await this.uiHelper.openSidebar(t["rhdh"][lang]["menuItem.home"]); - const homeLinkLocator = this.page - .locator("a") - .filter({ hasText: `${t["rhdh"][lang]["menuItem.home"]}` }); - await expect(homeLinkLocator).toHaveCSS( - "border-left", - `3px solid ${expectedColor}`, - ); - } - - async verifyPrimaryColors(colorPrimary: string) { - await this.uiHelper.checkCssColor( - this.page, - UI_HELPER_ELEMENTS.MuiTypographyColorPrimary, - colorPrimary, - ); - await this.uiHelper.checkCssColor( - this.page, - UI_HELPER_ELEMENTS.MuiSwitchColorPrimary, - colorPrimary, - ); - await this.uiHelper.openSidebar(t["rhdh"][lang]["menuItem.catalog"]); - await this.uiHelper.checkCssColor( - this.page, - UI_HELPER_ELEMENTS.MuiButtonTextPrimary, - colorPrimary, - ); - } - - async takeScreenshotAndAttach( - screenshotPath: string, - testInfo: TestInfo, - description: string, - ) { - await this.page.screenshot({ path: screenshotPath, fullPage: true }); - await testInfo.attach(description, { path: screenshotPath }); - } -} diff --git a/e2e-tests/playwright/utils/quay/quay-client.ts b/e2e-tests/playwright/utils/quay/quay-client.ts deleted file mode 100644 index 70d2e70a17..0000000000 --- a/e2e-tests/playwright/utils/quay/quay-client.ts +++ /dev/null @@ -1,29 +0,0 @@ -export class QuayClient { - apiUrl: string; - token: string; - headers: { "Content-Type": string; Accept: string; Authorization: string }; - - constructor() { - this.apiUrl = "https://quay.io/api/v1"; - this.token = process.env.QUAY_TOKEN; - this.headers = { - "Content-Type": "application/json", - Accept: "application/json", - Authorization: `Bearer ${this.token}`, - }; - } - - async deleteRepository(namespace: string, repoName: string) { - const url = `${this.apiUrl}/repository/${namespace}/${repoName}`; - const response = await fetch(url, { - headers: this.headers, - method: "DELETE", - }); - - if (!response.ok) { - throw new Error( - `Failed to delete repository ${namespace}/${repoName}, error ${response.status}: ${await response.text()}`, - ); - } - } -} diff --git a/e2e-tests/playwright/utils/quay/quay.ts b/e2e-tests/playwright/utils/quay/quay.ts deleted file mode 100644 index eda1340686..0000000000 --- a/e2e-tests/playwright/utils/quay/quay.ts +++ /dev/null @@ -1,65 +0,0 @@ -import { Page } from "@playwright/test"; -import { UI_HELPER_ELEMENTS } from "../../support/page-objects/global-obj"; - -export class ImageRegistry { - static getAllCellsIdentifier() { - const tagText = /^((pr|next)-.*|\d+\.\d+.*)$/i; - const lastModifiedDate = - /^[A-Za-z]{3} \d{1,2}, \d{4}, \d{1,2}:\d{2} (AM|PM)$/; // Example: Jan 21, 2025, 7:54 PM - const size = /^\d+(\.\d+)?\s?(GB|MB)$/; // Example: 1.16 GB or 512 MB - const expires = - /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2}, \d{4}, \d{1,2}:\d{2} [APM]{2}$/; // Example: Feb 2, 2026 4:01 PM - - const manifest = /^sha256/; - const securityScan = - /^(?:Critical:\s\d+)?(?:,\s)?(?:High:\s\d+)?(?:,\s)?(?:Medium:\s\d+)?(?:,\s)?(?:Low:\s\d+)?(?:,\s)?(?:Unknown:\s\d+)?$|^Queued$/i; - return [tagText, lastModifiedDate, securityScan, size, expires, manifest]; - } - - static getAllGridColumnsText() { - return [ - "Tag", - "Last Modified", - "Security Scan", - "Size", - "Expires", - "Manifest", - ]; - } - - static securityScanRegex() { - const securityScan = ["Critical", "High", "Medium", "Low", "Unknown"].map( - (i) => `(${i}:\\s\\d+[^\\w]*)`, - ); - return new RegExp( - `^(Passed|unsupported|Queued|Medium|Low|(?:${securityScan.join("|")})+)$`, - "i", // Case-insensitive flag to match "Unsupported" or "unsupported" - ); - } - - static getAllScanColumnsText() { - return [ - "Advisory", - "Severity", - "Package Name", - "Current Version", - "Fixed By", - ]; - } - - static getScanCellsIdentifier() { - const advisory = /^(CVE|RHSA)-.+/; - const severity = /Critical|High|Medium|Low|Unknown/; - const version = /^(\d+:)?\d+\.\d+/; - - return [advisory, severity, version]; - } - - static async getScanCell(page: Page) { - const locator = page - .locator(UI_HELPER_ELEMENTS.MuiTableCell) - .filter({ hasText: this.securityScanRegex() }); - await locator.first().waitFor(); - return locator.first(); - } -} From 4dff924eb2fd7696fc5bdb7b89235f718c3dc435 Mon Sep 17 00:00:00 2001 From: Ihor Mykhno Date: Wed, 6 May 2026 13:53:31 +0200 Subject: [PATCH 2/2] fix(ci): update extension test to verify Konflux instead of Cost Management (#4765) Signed-off-by: Ihor Mykhno --- e2e-tests/playwright/e2e/extensions.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/playwright/e2e/extensions.spec.ts b/e2e-tests/playwright/e2e/extensions.spec.ts index 5fa0b2b34f..6defea6000 100644 --- a/e2e-tests/playwright/e2e/extensions.spec.ts +++ b/e2e-tests/playwright/e2e/extensions.spec.ts @@ -245,10 +245,10 @@ test.describe("Admin > Extensions", () => { test("Verify dev preview badge in extensions", async () => { await extensions.selectSupportTypeFilter("Dev preview (DP)"); - await uiHelper.verifyHeading("Cost Management"); + await uiHelper.verifyHeading("Konflux"); await extensions.verifyPluginDetails({ - pluginName: "Cost Management For Red Hat Developer Hub", + pluginName: "Konflux", badgeLabel: "An early-stage, experimental plugin", badgeText: "Dev preview (DP)", headings: commonHeadings,