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

Add tests for workspace deletion #1631

Merged
merged 5 commits into from
Nov 18, 2024

Conversation

Qxisylolo
Copy link
Contributor

@Qxisylolo Qxisylolo commented Nov 8, 2024

Description

This PR adds tests for workspace deletion, covering three methods:

  1. Deleting a workspace using the action button.
  2. Deleting one or more workspaces using the multi-delete button.
  3. Deleting a workspace from the workspace detail page.

截屏2024-11-08 15 13 42

Issues Resolved

[List any issues this PR will resolve]

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.

Signed-off-by: Qxisylolo <[email protected]>
@Qxisylolo Qxisylolo changed the title add tests for deletion Add tests for workspace deletion Nov 8, 2024
describe('delete a workspace successfully using action buttons', () => {
it('should successfully load delete button and show delete modal when clicking action button', () => {
cy.contains(workspace1Name).should('be.visible');
cy.getElementByTestId('euiCollapsedItemActionsButton').first().click();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any other way to find this button?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use cy.getElementByTestId(`checkboxSelectRow-${workspaceId}`)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for all the comments, updated.

cy.createWorkspace({
name: workspace1Name,
description: workspace1Description,
features: ['workspace_detail', 'use-case-observability'],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
features: ['workspace_detail', 'use-case-observability'],
features: ['use-case-observability'],

describe('delete a workspace successfully using action buttons', () => {
it('should successfully load delete button and show delete modal when clicking action button', () => {
cy.contains(workspace1Name).should('be.visible');
cy.getElementByTestId('euiCollapsedItemActionsButton').first().click();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use cy.getElementByTestId(`checkboxSelectRow-${workspaceId}`)

Signed-off-by: Qxisylolo <[email protected]>
if (Cypress.env('WORKSPACE_ENABLED')) {
describe('Delete Workspace(s) in 2 ways in workspace list page', () => {
before(() => {
Cypress.config('defaultCommandTimeout', 60000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not necessary, I will delete it. Thank you

@SuZhou-Joe
Copy link
Member

@Qxisylolo Test cases failed, could you please take a look?

Signed-off-by: Qxisylolo <[email protected]>
Signed-off-by: Qxisylolo <[email protected]>
@SuZhou-Joe SuZhou-Joe force-pushed the add_tests_for_deletion branch from 94fa4af to 2b321f9 Compare November 18, 2024 04:43
Signed-off-by: Qxisylolo <[email protected]>
@Qxisylolo Qxisylolo force-pushed the add_tests_for_deletion branch from 2b321f9 to 74ffac7 Compare November 18, 2024 05:08
@SuZhou-Joe SuZhou-Joe merged commit 976f2ba into opensearch-project:main Nov 18, 2024
58 of 66 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 18, 2024
* add tests for deletion

Signed-off-by: Qxisylolo <[email protected]>

* resolve comments

Signed-off-by: Qxisylolo <[email protected]>

* new update

Signed-off-by: Qxisylolo <[email protected]>

* new update

Signed-off-by: Qxisylolo <[email protected]>

* revert lines

Signed-off-by: Qxisylolo <[email protected]>

---------

Signed-off-by: Qxisylolo <[email protected]>
(cherry picked from commit 976f2ba)
SuZhou-Joe pushed a commit that referenced this pull request Nov 25, 2024
* add tests for deletion

Signed-off-by: Qxisylolo <[email protected]>

* resolve comments

Signed-off-by: Qxisylolo <[email protected]>

* new update

Signed-off-by: Qxisylolo <[email protected]>

* new update

Signed-off-by: Qxisylolo <[email protected]>

* revert lines

Signed-off-by: Qxisylolo <[email protected]>

---------

Signed-off-by: Qxisylolo <[email protected]>
(cherry picked from commit 976f2ba)

Co-authored-by: Qxisylolo <[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