Skip to content

[Test] Automate rename workspace test#23838

Draft
SkorikSergey wants to merge 1 commit into
eclipse-che:mainfrom
SkorikSergey:renameWorkspace
Draft

[Test] Automate rename workspace test#23838
SkorikSergey wants to merge 1 commit into
eclipse-che:mainfrom
SkorikSergey:renameWorkspace

Conversation

@SkorikSergey
Copy link
Copy Markdown
Contributor

What does this PR do?

Automate “Rename Workspace” test

Test scenario:

  1. Create workspace from sample.
  2. Wait on workspace being started and running.
  3. Go to workspace details page and ensure rename is not possible.
  4. Stop workspace.
  5. Go to workspace details page and rename it to the “new-ws”.
  6. Ensure workspace name has been changed to the “new-ws” all over User Dashboard
  7. Start workspace and ensure running workspace can be opened from the User Dashboard.
  8. Stop workspace.
  9. Go to workspace details page and ensure workspace name can’t be changed to the “new-ws”.
  10. Create new workspace.
  11. Go to workspace new workspace details page and rename it to the “new-ws” name.
  12. Observe error status and that it is not possible to rename workspace to “new-ws”.

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://redhat.atlassian.net/browse/CRW-10665

How to test this PR?

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@artaleks9
Copy link
Copy Markdown
Contributor

@SkorikSergey, did you have a run RenameWorkspace E2E test locally to verify changes ?

/**
* devSpaces Dashboard does not allow editing the workspace display name while the workspace is running.
*/
async waitRenameWorkspaceNotPossibleWhileWorkspaceRunning(): Promise<void> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would suggest making the method name more specific, like checkRenameButtonIsAbsent()

/**
* rename a stopped workspace from the Overview tab (fill name + save).
*/
async renameStoppedWorkspaceTo(newDisplayName: string): Promise<void> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fact that workspace is stopped doesn't matter in context of Workspace Details page.

We are just trying to rename workspace, nothing else.

Let's name the method correspondingly, like renameWorkspace().

await this.waitWorkspaceTitle(newDisplayName);
}

async attemptRenameWorkspaceName(desiredName: string): Promise<void> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

attemptRenameWorkspaceName() is really test-level assertion logic - it's verifying a negative scenario (save button disabled, then cancel). That kind of logic belongs in the spec file (RenameWorkspace test), not in the page object.

await this.closeRenameWorkspaceForm();
}

async closeRenameWorkspaceForm(): Promise<void> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

closeRenameWorkspaceForm() has the same problem - it's only ever called from attemptRenameWorkspaceName, which itself is test-specific logic.

If attemptRenameWorkspaceName moves to the RenameWorkspace test, closeRenameWorkspaceForm() has no reason to stay in the page object either.

@SkorikSergey
Copy link
Copy Markdown
Contributor Author

@SkorikSergey, did you have a run RenameWorkspace E2E test locally to verify changes ?

Yes, I will update PR description with logs

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.

3 participants