Update Empty Workspace sample test per test-case scenario and add workaround#23788
Merged
dmytro-ndp merged 3 commits intoeclipse-che:mainfrom Apr 6, 2026
Merged
Update Empty Workspace sample test per test-case scenario and add workaround#23788dmytro-ndp merged 3 commits intoeclipse-che:mainfrom
dmytro-ndp merged 3 commits intoeclipse-che:mainfrom
Conversation
artaleks9
approved these changes
Mar 31, 2026
25 tasks
dmytro-ndp
reviewed
Apr 2, 2026
tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromEmptyWorkspaceSample.spec.ts
Outdated
Show resolved
Hide resolved
dmytro-ndp
reviewed
Apr 2, 2026
| // 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); |
Contributor
There was a problem hiding this comment.
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);
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Changes
this.skip()with error logging when the warning appearsNote
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:
What issues does this PR fix or referenceandHow to test this PRcompletedReviewers
Reviewers, please comment how you tested the PR when approving it.