Skip to content

Fixed StartWorkspaceUsingVSCodeDesktopSshEditor test case due to new landing page #23836

Merged
dmytro-ndp merged 6 commits into
eclipse-che:mainfrom
olkornii:CRW-10830
May 12, 2026
Merged

Fixed StartWorkspaceUsingVSCodeDesktopSshEditor test case due to new landing page #23836
dmytro-ndp merged 6 commits into
eclipse-che:mainfrom
olkornii:CRW-10830

Conversation

@olkornii
Copy link
Copy Markdown
Contributor

@olkornii olkornii commented May 5, 2026

olkornii added 2 commits May 5, 2026 13:54
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
@olkornii olkornii changed the title Crw 10830 Fixed StartWorkspaceUsingVSCodeDesktopSshEditor test case due to new landing page May 5, 2026
olkornii added 2 commits May 5, 2026 14:35
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
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.

Review Summary

The intent of this PR is good — it adapts the test to a new landing page layout by updating XPath locators, removing dead code, and adding logic to toggle the "UseExtension" switcher. However, there are several issues with the implementation that should be addressed before merging.

1. checkElementExistsByXpath should use waitVisibilityBoolean instead of waitVisibility

DriverHelper already provides waitVisibilityBoolean() — a purpose-built method that returns true/false with configurable attempts and polling. The new checkElementExistsByXpath reimplements this with a try/catch around waitVisibility, which:

  • Uses the default timeout (TS_SELENIUM_CLICK_ON_VISIBLE_ITEM) which may be too long for a conditional check — you want a quick probe, not a full wait.
  • Swallows all exceptions (not just TimeoutError), so network failures, session errors, etc. silently return false.

Suggested fix:

async checkElementExistsByXpath(xpath: string): Promise<boolean> {
    Logger.debug();
    return await this.driverHelper.waitVisibilityBoolean(By.xpath(xpath), 3, 3000);
}

2. Logger.debug() usage doesn't follow code style

Per CODE_STYLE.md, public methods should use Logger.debug() with no arguments — it auto-logs the class and method name. The PR passes string arguments instead:

Logger.debug('Click on xPath: ' + xpath);  // ❌
Logger.debug('Check if element exists');    // ❌
Logger.debug();                             // ✅

3. Consider whether generic XPath helpers belong in WorkspaceHandlingTests

clickOnElementByXpath(xpath) is a thin wrapper around this.driverHelper.waitAndClick(By.xpath(xpath)). And checkElementExistsByXpath wraps waitVisibilityBoolean. Adding generic element-interaction methods to a test-library class that's shared across all specs moves it toward becoming a second DriverHelper.

Consider either:

  • Keeping the toggle logic inline in the spec file (since it's specific to this test's landing page), or
  • If these helpers are genuinely reusable, placing the toggle handling in a dedicated page object for the SSH landing page.

4. Minor: XPath locator //div[@class="toggle-input"] is fragile

//div[@class="toggle-input"] matches any toggle on the page by class alone. If the page ever gets a second toggle, this will break silently. A more specific selector (e.g., using a parent container or label text) would be more resilient.


The dead code removal (unused imports, KubernetesCommandLineToolsExecutor, etc.) and the updated titlexPath locator are both good changes.

Comment thread tests/e2e/tests-library/WorkspaceHandlingTests.ts Outdated
Comment thread tests/e2e/tests-library/WorkspaceHandlingTests.ts Outdated
olkornii added 2 commits May 12, 2026 13:31
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
@olkornii olkornii requested a review from dmytro-ndp May 12, 2026 12:00
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.

PR looks good to merge.

Thank you for the test update, @olkornii !

@dmytro-ndp dmytro-ndp marked this pull request as ready for review May 12, 2026 17:05
@dmytro-ndp dmytro-ndp merged commit 0c4c925 into eclipse-che:main May 12, 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.

2 participants