Skip to content

Update Empty Workspace sample test per test-case scenario and add workaround#23788

Merged
dmytro-ndp merged 3 commits intoeclipse-che:mainfrom
SkorikSergey:addWorkaround
Apr 6, 2026
Merged

Update Empty Workspace sample test per test-case scenario and add workaround#23788
dmytro-ndp merged 3 commits intoeclipse-che:mainfrom
SkorikSergey:addWorkaround

Conversation

@SkorikSergey
Copy link
Copy Markdown
Contributor

What does this PR do?

Add a workaround for a known issue where the duplicate workspace warning incorrectly appears when creating an Empty Workspace with "Create New" checkbox OFF.

When creating an Empty Workspace sample with "Create New" checkbox turned OFF, the dashboard shows a duplicate workspace warning even though Empty Workspace should always generate unique names.

Workaround

When the duplicate workspace warning appears unexpectedly, the test now:

  • Logs an error message describing the known issue
  • Skips the test to avoid false failures

Changes

  • Added try-catch block to detect unexpected duplicate workspace warning
  • Added this.skip() with error logging when the warning appears
  • Added TODO comment referencing the issue to be fixed

Note

This workaround should be removed after fixing https://redhat.atlassian.net/browse/CRW-10546

Screenshot/screencast of this PR

What issues does this PR fix or reference?

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.

@SkorikSergey SkorikSergey changed the title Add workaround for duplicate workspace warning in CreateWorkspaceWithExistingNameFromEmptyWorkspaceSample e2e test Update Empty Workspace sample test per test-case scenario and add workaround Mar 31, 2026
@SkorikSergey SkorikSergey marked this pull request as ready for review March 31, 2026 13:39
dmytro-ndp

This comment was marked as off-topic.

// verify no duplicate workspace warning appeared (wait a few seconds to be sure)
let alertAppeared: boolean = false;
try {
await dashboard.waitExistingWorkspaceFoundAlert(TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT);
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp Apr 2, 2026

Choose a reason for hiding this comment

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

The try-catch block for detecting the duplicate workspace alert (lines 112-114) silently swallows all exceptions, not just timeouts.

At the same time DriverHelper already provides waitVisibilityBoolean() function which returns true/false without throwing.

If not add workaround, then a single-line assertion would be enough to ensure there is no "Existing Workspace Found" alert appeared:

expect(await dashboard.isExistingWorkspaceFoundAlertVisible(TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT),
    'Duplicate workspace warning should not appear for Empty Workspace sample').to.be.false;

It requires adding next helper method to the Dashboard class:

  async isExistingWorkspaceFoundAlertVisible(timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT): Promise<boolean> {
      Logger.debug();

      const attempts: number = Math.ceil(timeout / TIMEOUT_CONSTANTS.TS_SELENIUM_DEFAULT_POLLING);
      return await this.driverHelper.waitVisibilityBoolean(Dashboard.EXISTING_WORKSPACE_FOUND_ALERT, attempts);
  }

Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp left a comment

Choose a reason for hiding this comment

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

Looks good to merge.

@dmytro-ndp dmytro-ndp merged commit aa80fd5 into eclipse-che:main Apr 6, 2026
3 checks passed
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