-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add different access level test cases in workspace update flow #1630
Add different access level test cases in workspace update flow #1630
Conversation
Signed-off-by: Lin Wang <[email protected]>
...re-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_detail.spec.js
Outdated
Show resolved
Hide resolved
...re-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_detail.spec.js
Outdated
Show resolved
Hide resolved
let originalUser = ADMIN_AUTH.username; | ||
let originalPassword = ADMIN_AUTH.password; | ||
beforeEach(() => { | ||
originalUser = ADMIN_AUTH.username; | ||
originalPassword = ADMIN_AUTH.password; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need to update originalUser
and originalPassword
in before each? Shall we simply do a const
let originalUser = ADMIN_AUTH.username; | |
let originalPassword = ADMIN_AUTH.password; | |
beforeEach(() => { | |
originalUser = ADMIN_AUTH.username; | |
originalPassword = ADMIN_AUTH.password; | |
}); | |
const originalUser = ADMIN_AUTH.username; | |
const originalPassword = ADMIN_AUTH.password; |
@@ -4,3 +4,8 @@ | |||
*/ | |||
|
|||
export const WORKSPACE_API_PREFIX = '/api/workspaces'; | |||
|
|||
export const NONE_DASHBOARDS_ADMIN_USER = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about create internal user with command createInternalUser
so the workspace tests don't rely on specific user and pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried this way before. But not only do we need to call createInternalUser, we also need to create a role and map the internal user to it too. It will be more complicated.
…boards/workspace-plugin/mds_workspace_detail.spec.js Co-authored-by: Yulong Ruan <[email protected]> Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
after(() => { | ||
cy.deleteWorkspaceById(workspaceId); | ||
if (Cypress.env('SECURITY_ENABLED')) { | ||
cy.deleteInternalUser(NONE_DASHBOARDS_ADMIN_USERNAME); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we delete role and role mapping as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't fail when creating a role or mapping with the same name. Deleting a user is to protect the system. Will add the remove role logic.
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: Lin Wang <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
* Add test case work different access level in workspace update Signed-off-by: Lin Wang <[email protected]> * Update cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_detail.spec.js Co-authored-by: Yulong Ruan <[email protected]> Signed-off-by: Lin Wang <[email protected]> * Address PR comments Signed-off-by: Lin Wang <[email protected]> * Replace kibanaserver with self created workspace test user Signed-off-by: Lin Wang <[email protected]> * Delete role after test finish Signed-off-by: Lin Wang <[email protected]> * Delete role mapping Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: Yulong Ruan <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]> (cherry picked from commit 7e05a4f)
#1657) * Add test case work different access level in workspace update Signed-off-by: Lin Wang <[email protected]> * Update cypress/integration/core-opensearch-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_detail.spec.js Co-authored-by: Yulong Ruan <[email protected]> Signed-off-by: Lin Wang <[email protected]> * Address PR comments Signed-off-by: Lin Wang <[email protected]> * Replace kibanaserver with self created workspace test user Signed-off-by: Lin Wang <[email protected]> * Delete role after test finish Signed-off-by: Lin Wang <[email protected]> * Delete role mapping Signed-off-by: Lin Wang <[email protected]> --------- Signed-off-by: Lin Wang <[email protected]> Signed-off-by: SuZhou-Joe <[email protected]> Co-authored-by: Yulong Ruan <[email protected]> Co-authored-by: SuZhou-Joe <[email protected]> (cherry picked from commit 7e05a4f) Co-authored-by: Lin Wang <[email protected]>
Description
This PR is for adding different access level test cases in workspace update flow
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.