Add the RBAC and Auth API helpers#50
Conversation
Signed-off-by: Patrick Knight <pknight@redhat.com>
Signed-off-by: Patrick Knight <pknight@redhat.com>
Signed-off-by: Patrick Knight <pknight@redhat.com>
|
Reminder for myself for when this gets merged to take care of some clean up When this gets merged we should be able to remove the references to the We can also remove the |
|
Please bump the package version and update the changelog in docs. |
| export { LoginHelper, setupBrowser } from "./common.js"; | ||
| export { UIhelper } from "./ui-helper.js"; | ||
| export { RbacApiHelper } from "./rbac-api-helper.js"; | ||
| export { AuthApiHelper } from "./auth-api-helper.js"; |
There was a problem hiding this comment.
we might have to add these to exports in package.json
https://github.com/redhat-developer/rhdh-e2e-test-utils/pull/50/changes#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R14
In order to test package changes locally this is what I do :
cd /Users/..../rhdh-e2e-test-utils && yarn build && cd /Users/...../rhdh-plugin-export-overlays/workspaces/tech-radar/e2e-tests && yarn install && NODE_PRESERVE_SYMLINKS=1 yarn test:headed
There was a problem hiding this comment.
and in overlay package.json replace the uitls package version to "file:/..localltion..to...rhdh-e2e-test-utils"
There was a problem hiding this comment.
my bad, helper is already exported
There was a problem hiding this comment.
Actually worth the call out because I wasn't exporting the Policy and Response here. Has been updated but I haven't properly tested this yet since I don't have a cluster up at the moment.
The Api Helpers only slightly deviate from the versions within my PR and should be fine. But I can properly test them if you want me to.
There was a problem hiding this comment.
it would be nice to test incase. otherwise for a small issue it would again require a fix with version bump.
There was a problem hiding this comment.
I was able to successfully test it locally thanks to your instructions.
Signed-off-by: Patrick Knight <pknight@redhat.com>
package.json
Outdated
| "@playwright/test": "^1.57.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@backstage-community/plugin-rbac-common": "1.23.0", |
There was a problem hiding this comment.
if this Dependencies is something that consumer requires. than we might have to move from devDependencies to Dependencies section.
There was a problem hiding this comment.
Moved @backstage-community/plugin-rbac-common from devDependencies to dependencies.
Signed-off-by: Patrick Knight <pknight@redhat.com>
…endencies Signed-off-by: Patrick Knight <pknight@redhat.com>
This PR adds two additional API helpers, RbacApiHelper and AuthApiHelper, meant to assist test authors with cleaning up permissions and roles during tests and accessing the auth token for a given logged in user.
My thought process was to expose the get and delete endpoints for the RBAC plugin so that a developer could clean up any permissions policies and roles that were created as part of their tests. This will help to ensure that prior permissions and roles do not interfere with future tests.
The
AuthApiHelperis needed to ensure that we are able to access these endpoints as they require user credentials. Also, there might be other tests that rely on this and extracting it can help to prevent duplicate code within the overlays repo.