Skip to content
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

Merged
merged 5 commits into from
Nov 15, 2024

Conversation

raintygao
Copy link
Collaborator

@raintygao raintygao commented Nov 8, 2024

Description

add tests for workspace collaborators page

Screenshot

image

Check List

  • Commits are signed per the DCO using --signoff

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.

.contains('span', 'Add collaborators')
.click();

cy.wait(2000); // Intentional Wait
Copy link
Member

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.

Copy link
Collaborator Author

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.


cy.getElementByTestId('confirm-delete-button').click();
cy.getElementByTestId('confirmModalConfirmButton').click();
cy.wait(2000); // Intentional Wait
Copy link
Collaborator

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();
Copy link
Member

@SuZhou-Joe SuZhou-Joe Nov 13, 2024

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?

Copy link
Collaborator

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

.contains('Read and write')
.click();
cy.getElementByTestId('confirmModalConfirmButton').click();

Copy link
Collaborator

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

Copy link
Collaborator Author

@raintygao raintygao Nov 15, 2024

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();
Copy link
Collaborator

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

Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

@raintygao raintygao merged commit 5a6faae into opensearch-project:main Nov 15, 2024
57 of 65 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 15, 2024
* 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)
SuZhou-Joe pushed a commit that referenced this pull request Nov 15, 2024
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants