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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Qxisylolo
Copy link

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]>
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
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?

@SuZhou-Joe
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants