-
Notifications
You must be signed in to change notification settings - Fork 113
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
[Workspace] add tests for workspace collaborators page #1632
Conversation
Signed-off-by: tygao <[email protected]>
...search-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_collaborators.spec.js
Outdated
Show resolved
Hide resolved
...search-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_collaborators.spec.js
Outdated
Show resolved
Hide resolved
...search-dashboards/opensearch-dashboards/workspace-plugin/mds_workspace_collaborators.spec.js
Outdated
Show resolved
Hide resolved
.contains('span', 'Add collaborators') | ||
.click(); | ||
|
||
cy.wait(2000); // Intentional Wait |
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 we doing assertion here instead of waiting for 2s, it seems unreliable.
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.
This is mainly used for waiting page load after navigation or wait stored data update after operation.
Signed-off-by: tygao <[email protected]>
Signed-off-by: tygao <[email protected]>
|
||
cy.getElementByTestId('confirm-delete-button').click(); | ||
cy.getElementByTestId('confirmModalConfirmButton').click(); | ||
cy.wait(2000); // Intentional Wait |
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.
Nit: Shall we need to wait confirmModalConfirmButton
disappear or check collaborator not exist in the table? It would be more safe to ensure collaborators been deleted.
Signed-off-by: tygao <[email protected]>
}); | ||
|
||
cy.getElementByTestId('confirm-delete-button').click(); | ||
cy.getElementByTestId('confirmModalConfirmButton').click(); |
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.
Shall we add assertion to ensure the selected collaborators have been removed from UI?
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.
nit: same here verify toast of delete collaborators exists
Signed-off-by: tygao <[email protected]>
.contains('Read and write') | ||
.click(); | ||
cy.getElementByTestId('confirmModalConfirmButton').click(); | ||
|
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.
nit: we can add a verification here to verify change access level toast exists
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 think we have verified the actual content in the table has been updated, this is more trustable than the toast, right?
}); | ||
|
||
cy.getElementByTestId('confirm-delete-button').click(); | ||
cy.getElementByTestId('confirmModalConfirmButton').click(); |
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.
nit: same here verify toast of delete collaborators exists
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.
add one more test for search and filter?
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.
Our initial plan is to cover basic tests, let us cover these in the next stage.
* add tests for collaborators page Signed-off-by: tygao <[email protected]> * update Signed-off-by: tygao <[email protected]> * use add instead of update Signed-off-by: tygao <[email protected]> * remove wait Signed-off-by: tygao <[email protected]> * add assert for collaborators not exist Signed-off-by: tygao <[email protected]> --------- Signed-off-by: tygao <[email protected]> (cherry picked from commit 5a6faae)
* add tests for collaborators page Signed-off-by: tygao <[email protected]> * update Signed-off-by: tygao <[email protected]> * use add instead of update Signed-off-by: tygao <[email protected]> * remove wait Signed-off-by: tygao <[email protected]> * add assert for collaborators not exist Signed-off-by: tygao <[email protected]> --------- Signed-off-by: tygao <[email protected]> (cherry picked from commit 5a6faae) Co-authored-by: Tianyu Gao <[email protected]>
Description
add tests for workspace collaborators page
Screenshot
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.