Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-2127

[E2E] RBAC role deletion test fails due to insufficient user privileges

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 1.8.0
    • Test framework
    • False
    • Hide

      None

      Show
      None
    • False

      Summary

      The RBAC test "Create a role with a permission policy per resource type and verify that the only authorized users can access specific resources" is failing because the delete role button is disabled due to insufficient user privileges.

      The test was previously disabled due to a wrongly populated `IS_OPENSHIFT` environment variable and a conditional skip.

      Test Details

      _ _Test File*: e2e-tests/playwright/e2e/plugins/rbac/rbac.spec.ts
      _ _Test Name*: "Create a role with a permission policy per resource type and verify that the only authorized users can access specific resources"
      _ _Test ID*: 93e820fe67e1d96786e4f1d5
      _ _Test Result Link*: https://gcsweb-ci.apps.ci.l2s4.p1s.com/gcs/test-platform-results/pr-logs/pull/redhat-developer_rhdh/3509ci-redhat-developer-rhdh-main-e2e-ocp-helm/1976614412865245184rtifacts/e2e-ocp-helm/redhat-developer-rhdh-ocp-helm/artifacts/showcase-rbac/index.html#?testId=93e820fe67e1d967a4f6-886

      Expected Behavior

      The test should be able to:
      1. Create a conditional role named "test-role1"
      2. Search for the role
      3. Successfully delete the role using the delete button

      Actual Behavior

      The delete button for the role is disabled, preventing the test from completing the deletion step. This is likely due to insufficient user privileges for role deletion.

      Test Code Location

      The failing test is located at lines 436ests/playwright/e2e/plugins/rbac/rbac.spec.ts{{:

      Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yamltest(
        "Create a role with a permission policy per resource type and verify that the only authorized users can access specific resources.",
        async ({ page }) => {
          // TODO: 
          test.fixme();
          const uiHelper = new UIhelper(page);
          const rbacPo = new RbacPo(page);
          await rbacPo.createConditionalRole(
            "test-role1",
            ["Guest User", "rhdh-qe rhdh-qe"],
            ["Backstage"],
            "anyOf",
            "catalog",
            "user:default/rhdh-qe",
          );
      
          await page
            .locator(SEARCH_OBJECTS_COMPONENTS.ariaLabelSearch)
            .waitFor({ state: "visible" });
          await page
            .locator(SEARCH_OBJECTS_COMPONENTS.ariaLabelSearch)
            .fill(test-role1    await uiHelper.verifyHeading("All roles (1)");
          await rbacPo.deleteRole("role:default/test-role1"); // This step fails
        },
      );
      

      Technical Details

      _ _Delete Button Selector*: }}button[data-testid="delete-role-role:default/test-role1"]{{
      _ _Delete Method*: }}RbacPo.deleteRole(){{ method in }}e2e-tests/playwright/support/page-objects/rbac-po.ts`
      _ _Component*: Test framework (E2E tests)
      _ _Root Cause*: User lacks necessary RBAC permissions to delete roles

      Impact

      This test failure prevents validation of RBAC role deletion functionality, which is critical for testing role-based access control features. The issue suggests that the test user's permissions are not properly configured for role management operations.

      Environment

      _ _CI Environment*: OpenShift CI
      _ _Test Project*: showcase-rbac
      _ _PR*: #3509

      Suggested Investigation

      1. Verify the user permissions required for role deletion
      2. Check if the test user has the necessary RBAC policies assigned
      3. Review the role creation process to ensure proper ownership/permissions are set
      4. Consider updating the test to use a user with appropriate privileges

      The Jira issue creation was assisted-by Cursor

              Unassigned Unassigned
              zdrapela@redhat.com Zbynek Drapela
              RHIDP - Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: