From 354888ce904389e5f81c7b956b6f1591a405ab54 Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Mon, 2 Mar 2026 20:00:37 +0200 Subject: [PATCH 01/11] Update locators according to new UI Dashboard --- .../pageobjects/dashboard/CreateWorkspace.ts | 2 +- .../pageobjects/dashboard/TrustAuthorPopup.ts | 2 +- .../pageobjects/dashboard/UserPreferences.ts | 8 +++--- tests/e2e/pageobjects/dashboard/Workspaces.ts | 25 ++++++++++--------- .../tests-library/WorkspaceHandlingTests.ts | 6 ++--- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index 95cee2e4eb5..3ced816bf67 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -187,6 +187,6 @@ export class CreateWorkspace { private getSampleLocator(sampleName: string): By { Logger.trace(`sampleName: ${sampleName}, used default editor`); - return By.xpath(`//article[contains(@class, 'sample-card')]//div[text()='${sampleName}']`); + return By.xpath(`//div[contains(@id, 'sample-card') and text()='${sampleName}']`); } } diff --git a/tests/e2e/pageobjects/dashboard/TrustAuthorPopup.ts b/tests/e2e/pageobjects/dashboard/TrustAuthorPopup.ts index 4d00c703cd8..33b82d8f455 100644 --- a/tests/e2e/pageobjects/dashboard/TrustAuthorPopup.ts +++ b/tests/e2e/pageobjects/dashboard/TrustAuthorPopup.ts @@ -17,7 +17,7 @@ import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS'; @injectable() export class TrustAuthorPopup { - private static readonly CONTINUE_BUTTON: By = By.xpath('//button[text()="Continue"]'); + private static readonly CONTINUE_BUTTON: By = By.xpath('//span[text()="Continue"]'); private static readonly TRUST_AUTHOR_POPUP_PAGE: By = By.xpath( '//span[contains(text(), "Do you trust the authors of this repository?")]' ); diff --git a/tests/e2e/pageobjects/dashboard/UserPreferences.ts b/tests/e2e/pageobjects/dashboard/UserPreferences.ts index 5a483a30038..b1f48238c4e 100644 --- a/tests/e2e/pageobjects/dashboard/UserPreferences.ts +++ b/tests/e2e/pageobjects/dashboard/UserPreferences.ts @@ -21,7 +21,7 @@ import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS'; @injectable() export class UserPreferences { private static readonly USER_SETTINGS_DROPDOWN: By = By.xpath('//header//button/span[text()!=""]//parent::button'); - private static readonly USER_PREFERENCES_BUTTON: By = By.xpath('//button[text()="User Preferences"]'); + private static readonly USER_PREFERENCES_BUTTON: By = By.xpath('//span[text()="User Preferences"]'); private static readonly USER_PREFERENCES_PAGE: By = By.xpath('//h1[text()="User Preferences"]'); private static readonly CONTAINER_REGISTRIES_TAB: By = By.xpath('//button[text()="Container Registries"]'); @@ -43,10 +43,10 @@ export class UserPreferences { private static readonly PASTE_PRIVATE_SSH_KEY_FIELD: By = By.css('textarea[name="ssh-private-key"]'); private static readonly PASTE_PUBLIC_SSH_KEY_FIELD: By = By.css('textarea[name="ssh-public-key"]'); private static readonly PASTE_SSH_KEY_PASSPHRASE_FIELD: By = By.xpath('//input[@placeholder="Enter passphrase (optional)"]'); - private static readonly ADD_SSH_KEYS_BUTTON: By = By.css('.pf-c-button.pf-m-primary'); + private static readonly ADD_SSH_KEYS_BUTTON: By = By.css('button[aria-label="Add SSH Key"]'); private static readonly GIT_SSH_KEY_NAME: By = By.css('[data-testid="title"]'); private static readonly GIT_SSH_KEY_ACTIONS_BUTTON: By = By.css('section[id*="SshKeys-user-preferences"] button[aria-label="Actions"]'); - private static readonly DELETE_BUTTON: By = By.xpath('//button[text()="Delete"]'); + private static readonly DELETE_BUTTON: By = By.xpath('//span[text()="Delete"]'); private static readonly CONFIRM_DELETE_SSH_KEYS_POPUP: By = By.css('div[id^="pf-modal-part"][role="dialog"]'); private static readonly CONFIRM_DELETE_SSH_KEYS_CHECKBOX: By = By.id('delete-ssh-keys-warning-checkbox'); @@ -146,7 +146,7 @@ export class UserPreferences { await this.driverHelper.waitAttributeValue( UserPreferences.GIT_CONFIG_SAVE_BUTTON, - 'aria-disabled', + 'disabled', 'true', TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT ); diff --git a/tests/e2e/pageobjects/dashboard/Workspaces.ts b/tests/e2e/pageobjects/dashboard/Workspaces.ts index c097a73d0a3..df691e4a551 100644 --- a/tests/e2e/pageobjects/dashboard/Workspaces.ts +++ b/tests/e2e/pageobjects/dashboard/Workspaces.ts @@ -22,11 +22,12 @@ export enum WorkspaceStatusUI { @injectable() export class Workspaces { - private static readonly ADD_WORKSPACE_BUTTON: By = By.xpath('//button[text()="Add Workspace"]'); + private static readonly ADD_WORKSPACE_BUTTON: By = By.css('button[aria-label="Add a new workspace"]'); private static readonly WORKSPACE_ITEM_TABLE_NAME_SECTION: By = By.xpath('//td[@data-label="Name"]/span/a'); private static readonly DELETE_WORKSPACE_BUTTON_ENABLED: By = By.xpath( '//button[@data-testid="delete-workspace-button" and not(@disabled)]' ); + private static readonly WORKSPACE_ACTION_POPUP: By = By.css('div[class*="workspaceActionSelector"]'); private static readonly DELETE_CONFIRMATION_CHECKBOX: By = By.xpath('//input[@data-testid="confirmation-checkbox"]'); private static readonly CONFIRMATION_WINDOW: By = By.xpath('//div[@aria-label="Delete workspaces confirmation window"]'); private static readonly LEARN_MORE_DOC_LINK: By = By.xpath('//div/p/a'); @@ -99,7 +100,7 @@ export class Workspaces { async waitActionsPopup(workspaceName: string, timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT): Promise { Logger.debug(`of the '${workspaceName}' list item`); - await this.driverHelper.waitVisibility(this.getExpandedActionsLocator(workspaceName), timeout); + await this.driverHelper.waitVisibility(Workspaces.WORKSPACE_ACTION_POPUP, timeout); } async openActionsPopup(workspaceName: string, timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT): Promise { @@ -112,19 +113,19 @@ export class Workspaces { async clickActionsDeleteButton(workspaceName: string): Promise { Logger.debug(`for the '${workspaceName}' list item`); - await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Delete Workspace')); + await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator('Delete Workspace')); } async clickActionsStopWorkspaceButton(workspaceName: string): Promise { Logger.debug(`for the '${workspaceName}' list item`); // todo: workaround because of issue CRW-3649 try { - await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace')); + await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator('Stop Workspace')); } catch (e) { Logger.warn(`for the '${workspaceName}' list item - popup was missed, try to click one more time (issue CRW-3649).`); await this.driverHelper.waitAndClick(this.getActionsLocator(workspaceName)); - await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace')); + await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator('Stop Workspace')); } } @@ -214,7 +215,7 @@ export class Workspaces { } private getWorkspaceListItemLocator(workspaceName: string): By { - return By.xpath(`//tr[td//a[text()='${workspaceName}']]`); + return By.xpath(`//tr[td//span[text()='${workspaceName}']]`); } private getWorkspaceStatusLocator(workspaceName: string, workspaceStatus: WorkspaceStatusUI): By { @@ -226,21 +227,21 @@ export class Workspaces { } private getActionsLocator(workspaceName: string): By { - return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}/td/div/button[@aria-label='Actions']`); + return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}/td/button[@aria-label='Actions']`); } - private getExpandedActionsLocator(workspaceName: string): By { + /* private getExpandedActionsLocator(workspaceName: string): By { return By.xpath( `${this.getWorkspaceListItemLocator(workspaceName).value}//button[@aria-label='Actions' and @aria-expanded='true']` ); - } + }*/ - private getActionsPopupButtonLocator(workspaceName: string, buttonText: string): By { - return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}//button[text()='${buttonText}']`); + private getActionsPopupButtonLocator(buttonText: string): By { + return By.css(`button[aria-label="Action: ${buttonText}"]`); } private getOpenButtonLocator(workspaceName: string): By { - return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}//td[@data-key=5]//button[text()='Open']`); + return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}//td[contains(@class, 'openIde')]//span[text()='Open']`); } private getOpenWorkspaceDetailsLinkLocator(workspaceName: string): By { diff --git a/tests/e2e/tests-library/WorkspaceHandlingTests.ts b/tests/e2e/tests-library/WorkspaceHandlingTests.ts index 4e884d44709..d045ef1cf61 100644 --- a/tests/e2e/tests-library/WorkspaceHandlingTests.ts +++ b/tests/e2e/tests-library/WorkspaceHandlingTests.ts @@ -23,9 +23,9 @@ import { By, error } from 'selenium-webdriver'; @injectable() export class WorkspaceHandlingTests { private static WORKSPACE_NAME: By = By.xpath('//h1[contains(.,"Starting workspace ")]'); - private static WORKSPACE_STATUS: By = By.xpath('//*/span[@class="pf-c-label__content"]'); - private static WORKSPACE_ALERT_TITLE: By = By.xpath('//h4[@class="pf-c-alert__title"]'); - private static WORKSPACE_ALERT_DESCRIPTION: By = By.xpath('//*/div[@class="pf-c-alert__description"]'); + private static WORKSPACE_STATUS: By = By.css('span[class*="label__content"]'); + private static WORKSPACE_ALERT_TITLE: By = By.css('h4[class*="alert__title"]'); + private static WORKSPACE_ALERT_DESCRIPTION: By = By.css('div[class*="alert__description"]'); private static workspaceName: string = 'undefined'; private static parentGUID: string; From e70951e86051639b48c14842713f4c02b990ca63 Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Thu, 5 Mar 2026 19:35:54 +0200 Subject: [PATCH 02/11] Fix 'SshUrlNoOauthPatFactory' 'RefusedOAuthFactory' E2E tests --- tests/e2e/constants/TIMEOUT_CONSTANTS.ts | 4 ++-- tests/e2e/pageobjects/dashboard/UserPreferences.ts | 10 +++++----- tests/e2e/pageobjects/dashboard/Workspaces.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/e2e/constants/TIMEOUT_CONSTANTS.ts b/tests/e2e/constants/TIMEOUT_CONSTANTS.ts index 3fe433b498c..126ce6f198a 100644 --- a/tests/e2e/constants/TIMEOUT_CONSTANTS.ts +++ b/tests/e2e/constants/TIMEOUT_CONSTANTS.ts @@ -95,9 +95,9 @@ export const TIMEOUT_CONSTANTS: { // -------------------------------------------- PROJECT TREE -------------------------------------------- /** - * expand item in project tree, "8 000" by default. + * expand item in project tree, "10 000" by default. */ - TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT: Number(process.env.TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT) || 8_000, + TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT: Number(process.env.TS_EXPAND_PROJECT_TREE_ITEM_TIMEOUT) || 10_000, // -------------------------------------------- EDITOR -------------------------------------------- diff --git a/tests/e2e/pageobjects/dashboard/UserPreferences.ts b/tests/e2e/pageobjects/dashboard/UserPreferences.ts index b1f48238c4e..8239e7269ae 100644 --- a/tests/e2e/pageobjects/dashboard/UserPreferences.ts +++ b/tests/e2e/pageobjects/dashboard/UserPreferences.ts @@ -38,12 +38,12 @@ export class UserPreferences { private static readonly GIT_CONFIG_SAVE_BUTTON: By = By.css('[data-testid="button-save"]'); private static readonly SSH_KEY_TAB: By = By.xpath('//button[text()="SSH Keys"]'); - private static readonly ADD_NEW_SSH_KEY_BUTTON: By = By.xpath('//button[text()="Add SSH Key"]'); + private static readonly ADD_NEW_SSH_KEY_BUTTON: By = By.css('button[aria-label="Add SSH Key"]'); private static readonly ADD_SSH_KEYS_POPUP: By = By.xpath('//span[text()="Add SSH Keys"]'); - private static readonly PASTE_PRIVATE_SSH_KEY_FIELD: By = By.css('textarea[name="ssh-private-key"]'); - private static readonly PASTE_PUBLIC_SSH_KEY_FIELD: By = By.css('textarea[name="ssh-public-key"]'); - private static readonly PASTE_SSH_KEY_PASSPHRASE_FIELD: By = By.xpath('//input[@placeholder="Enter passphrase (optional)"]'); - private static readonly ADD_SSH_KEYS_BUTTON: By = By.css('button[aria-label="Add SSH Key"]'); + private static readonly PASTE_PRIVATE_SSH_KEY_FIELD: By = By.id("ssh-private-key"); + private static readonly PASTE_PUBLIC_SSH_KEY_FIELD: By = By.id("ssh-public-key"); + private static readonly PASTE_SSH_KEY_PASSPHRASE_FIELD: By = By.css('input[placeholder="Enter passphrase (optional)"]'); + private static readonly ADD_SSH_KEYS_BUTTON: By = By.xpath('//span[text()="Add"]'); private static readonly GIT_SSH_KEY_NAME: By = By.css('[data-testid="title"]'); private static readonly GIT_SSH_KEY_ACTIONS_BUTTON: By = By.css('section[id*="SshKeys-user-preferences"] button[aria-label="Actions"]'); private static readonly DELETE_BUTTON: By = By.xpath('//span[text()="Delete"]'); diff --git a/tests/e2e/pageobjects/dashboard/Workspaces.ts b/tests/e2e/pageobjects/dashboard/Workspaces.ts index df691e4a551..f422bf0fb0f 100644 --- a/tests/e2e/pageobjects/dashboard/Workspaces.ts +++ b/tests/e2e/pageobjects/dashboard/Workspaces.ts @@ -22,7 +22,7 @@ export enum WorkspaceStatusUI { @injectable() export class Workspaces { - private static readonly ADD_WORKSPACE_BUTTON: By = By.css('button[aria-label="Add a new workspace"]'); + private static readonly ADD_WORKSPACE_BUTTON: By = By.css('button[aria-label="Add Workspace"]'); private static readonly WORKSPACE_ITEM_TABLE_NAME_SECTION: By = By.xpath('//td[@data-label="Name"]/span/a'); private static readonly DELETE_WORKSPACE_BUTTON_ENABLED: By = By.xpath( '//button[@data-testid="delete-workspace-button" and not(@disabled)]' From 0dbe81f8b725b6a7ed1f9eb59c3bb6f5087d419c Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Fri, 20 Mar 2026 00:23:47 +0200 Subject: [PATCH 03/11] Update locators --- .../pageobjects/dashboard/CreateWorkspace.ts | 19 +++++++------------ tests/e2e/pageobjects/dashboard/Dashboard.ts | 4 ++-- .../pageobjects/dashboard/UserPreferences.ts | 6 +++--- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index 3d59727cf87..12ce84a67cb 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -21,11 +21,9 @@ import { TrustAuthorPopup } from './TrustAuthorPopup'; export class CreateWorkspace { private static readonly FACTORY_URL: By = By.xpath('//input[@id="git-repo-url"]'); private static readonly GIT_REPO_OPTIONS: By = By.xpath('//span[text()="Git Repo Options"]'); - private static readonly GIT_BRANCH_NAME: By = By.xpath( - '//div[text()="Select the branch of the Git Repository"]/preceding-sibling::div' - ); - private static readonly GIT_BRANCH_SEARCH_FIELD: By = By.css('input[type="search"]'); - private static readonly PATH_TO_DEVFILE: By = By.xpath('//input[@aria-label="Path to Devfile"]'); + + private static readonly GIT_BRANCH_SELECT_FIELD: By = By.xpath('//span[text()="Select the branch of the Git Repository"]'); + private static readonly GIT_FILTER_BRANCHES: By = By.css('input[placeholder="Filter branches"]'); private static readonly CREATE_AND_OPEN_BUTTON: By = By.xpath('//button[@id="create-and-open-button"]'); private static readonly CREATE_NEW_WORKPACE_CHECKBOX: By = By.xpath('//label[@for="create-new-if-exist-switch"]'); private static readonly CREATE_NEW_WORKPACE_CHECKBOX_VALUE: By = By.xpath('//input[@id="create-new-if-exist-switch"]'); @@ -87,16 +85,13 @@ export class CreateWorkspace { if (branchName) { await this.driverHelper.waitAndClick(CreateWorkspace.GIT_REPO_OPTIONS, timeout); - - await this.driverHelper.waitAndClick(CreateWorkspace.GIT_BRANCH_NAME, timeout); - - await this.driverHelper.waitVisibility(CreateWorkspace.GIT_BRANCH_SEARCH_FIELD, timeout); - await this.driverHelper.type(CreateWorkspace.GIT_BRANCH_SEARCH_FIELD, Key.chord(branchName), timeout); + await this.driverHelper.waitAndClick(CreateWorkspace.GIT_BRANCH_SELECT_FIELD, timeout); + await this.driverHelper.waitAndClick(CreateWorkspace.GIT_FILTER_BRANCHES, timeout); + await this.driverHelper.type(CreateWorkspace.GIT_FILTER_BRANCHES, Key.chord(branchName), timeout); await this.driverHelper.waitAndClick(this.getGitBranchListItemLocator(branchName), timeout); } await this.driverHelper.waitAndClick(CreateWorkspace.CREATE_AND_OPEN_BUTTON, timeout); - await this.performTrustAuthorPopup(); } @@ -217,6 +212,6 @@ export class CreateWorkspace { } private getGitBranchListItemLocator(branchName: string): By { - return By.css(`li[id="${branchName}"] button.pf-c-select__menu-item`); + return By.xpath(`//ul[@role="listbox"]//span[text()="${branchName}"]`); } } diff --git a/tests/e2e/pageobjects/dashboard/Dashboard.ts b/tests/e2e/pageobjects/dashboard/Dashboard.ts index 5df49f25add..8e79a1602a4 100644 --- a/tests/e2e/pageobjects/dashboard/Dashboard.ts +++ b/tests/e2e/pageobjects/dashboard/Dashboard.ts @@ -1,5 +1,5 @@ /** ******************************************************************* - * copyright (c) 2019-2024 Red Hat, Inc. + * copyright (c) 2019-2026 Red Hat, Inc. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -239,7 +239,7 @@ export class Dashboard { } private getAboutMenuItemButtonLocator(text: string): By { - return By.xpath(`//li/button[text()="${text}"]`); + return By.xpath(`//li//span[text()="${text}"]`); } private getAboutDialogWindowItemLocator(itemDataTestId: string): By { diff --git a/tests/e2e/pageobjects/dashboard/UserPreferences.ts b/tests/e2e/pageobjects/dashboard/UserPreferences.ts index 8239e7269ae..2ed40cad4cd 100644 --- a/tests/e2e/pageobjects/dashboard/UserPreferences.ts +++ b/tests/e2e/pageobjects/dashboard/UserPreferences.ts @@ -1,5 +1,5 @@ /** ******************************************************************* - * copyright (c) 2019-2025 Red Hat, Inc. + * copyright (c) 2019-2026 Red Hat, Inc. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -40,8 +40,8 @@ export class UserPreferences { private static readonly SSH_KEY_TAB: By = By.xpath('//button[text()="SSH Keys"]'); private static readonly ADD_NEW_SSH_KEY_BUTTON: By = By.css('button[aria-label="Add SSH Key"]'); private static readonly ADD_SSH_KEYS_POPUP: By = By.xpath('//span[text()="Add SSH Keys"]'); - private static readonly PASTE_PRIVATE_SSH_KEY_FIELD: By = By.id("ssh-private-key"); - private static readonly PASTE_PUBLIC_SSH_KEY_FIELD: By = By.id("ssh-public-key"); + private static readonly PASTE_PRIVATE_SSH_KEY_FIELD: By = By.id('ssh-private-key'); + private static readonly PASTE_PUBLIC_SSH_KEY_FIELD: By = By.id('ssh-public-key'); private static readonly PASTE_SSH_KEY_PASSPHRASE_FIELD: By = By.css('input[placeholder="Enter passphrase (optional)"]'); private static readonly ADD_SSH_KEYS_BUTTON: By = By.xpath('//span[text()="Add"]'); private static readonly GIT_SSH_KEY_NAME: By = By.css('[data-testid="title"]'); From 8d54bcb1fcc1c7e79750444248c6ef3bc23299b0 Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Tue, 24 Mar 2026 22:29:46 +0200 Subject: [PATCH 04/11] Do formatting --- tests/e2e/pageobjects/dashboard/Workspaces.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/pageobjects/dashboard/Workspaces.ts b/tests/e2e/pageobjects/dashboard/Workspaces.ts index df60d43c023..0ac98c3e7bd 100644 --- a/tests/e2e/pageobjects/dashboard/Workspaces.ts +++ b/tests/e2e/pageobjects/dashboard/Workspaces.ts @@ -242,7 +242,6 @@ export class Workspaces { private getOpenButtonLocator(workspaceName: string): By { return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName).value}//button/span[text()='Open']`); - } private getOpenWorkspaceDetailsLinkLocator(workspaceName: string): By { From 319fa3f07785197c36d7476c411f1c6bcbac1cda Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Thu, 26 Mar 2026 12:42:14 +0200 Subject: [PATCH 05/11] Fix locators relaed to 'RevokeOauth' test --- tests/e2e/pageobjects/dashboard/UserPreferences.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/UserPreferences.ts b/tests/e2e/pageobjects/dashboard/UserPreferences.ts index 2ed40cad4cd..b64083cdc6d 100644 --- a/tests/e2e/pageobjects/dashboard/UserPreferences.ts +++ b/tests/e2e/pageobjects/dashboard/UserPreferences.ts @@ -26,8 +26,8 @@ export class UserPreferences { private static readonly CONTAINER_REGISTRIES_TAB: By = By.xpath('//button[text()="Container Registries"]'); - private static readonly GIT_SERVICES_TAB: By = By.xpath('//button[text()="Git Services"]'); - private static readonly GIT_SERVICES_REVOKE_BUTTON: By = By.xpath('//button[text()="Revoke"]'); + private static readonly GIT_SERVICES_TAB: By = By.css('button[id*="GitServices"]'); + private static readonly GIT_SERVICES_REVOKE_BUTTON: By = By.css('button[data-testid*="revoke-button"]'); private static readonly PAT_TAB: By = By.xpath('//button[text()="Personal Access Tokens"]'); private static readonly ADD_NEW_PAT_BUTTON: By = By.xpath('//button[text()="Add Personal Access Token"]'); @@ -51,8 +51,8 @@ export class UserPreferences { private static readonly CONFIRM_DELETE_SSH_KEYS_CHECKBOX: By = By.id('delete-ssh-keys-warning-checkbox'); private static readonly CONFIRMATION_WINDOW: By = By.xpath('//span[text()="Revoke Git Service"]'); - private static readonly DELETE_CONFIRMATION_CHECKBOX: By = By.xpath('//input[@data-testid="warning-info-checkbox"]'); - private static readonly DELETE_ITEM_BUTTON_ENABLED: By = By.xpath('//button[@data-testid="revoke-button" and not(@disabled)]'); + private static readonly DELETE_CONFIRMATION_CHECKBOX: By = By.id('revoke-warning-info-check'); + private static readonly DELETE_ITEM_BUTTON_ENABLED: By = By.css('button[data-testid="revoke-button"]:not([disabled])'); constructor( @inject(CLASSES.DriverHelper) From 22ac017694ce9b327664021abd39af69072a08fe Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Fri, 27 Mar 2026 01:17:08 +0200 Subject: [PATCH 06/11] Fix up 'CreateWorkspaceWithExistingNameFromGitUrl' test --- tests/e2e/pageobjects/dashboard/CreateWorkspace.ts | 12 ++++++++---- tests/e2e/pageobjects/dashboard/Dashboard.ts | 3 +-- ...CreateWorkspaceWithExistingNameFromGitUrl.spec.ts | 1 + 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index 12ce84a67cb..b0ca0dabc6a 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -19,14 +19,14 @@ import { TrustAuthorPopup } from './TrustAuthorPopup'; @injectable() export class CreateWorkspace { - private static readonly FACTORY_URL: By = By.xpath('//input[@id="git-repo-url"]'); + private static readonly FACTORY_URL: By = By.id('git-repo-url'); private static readonly GIT_REPO_OPTIONS: By = By.xpath('//span[text()="Git Repo Options"]'); private static readonly GIT_BRANCH_SELECT_FIELD: By = By.xpath('//span[text()="Select the branch of the Git Repository"]'); private static readonly GIT_FILTER_BRANCHES: By = By.css('input[placeholder="Filter branches"]'); - private static readonly CREATE_AND_OPEN_BUTTON: By = By.xpath('//button[@id="create-and-open-button"]'); - private static readonly CREATE_NEW_WORKPACE_CHECKBOX: By = By.xpath('//label[@for="create-new-if-exist-switch"]'); - private static readonly CREATE_NEW_WORKPACE_CHECKBOX_VALUE: By = By.xpath('//input[@id="create-new-if-exist-switch"]'); + private static readonly CREATE_AND_OPEN_BUTTON: By = By.id('create-and-open-button'); + private static readonly CREATE_NEW_WORKPACE_CHECKBOX: By = By.css('label[for="create-new-if-exist-switch"]'); + private static readonly CREATE_NEW_WORKPACE_CHECKBOX_VALUE: By = By.id('create-new-if-exist-switch'); constructor( @inject(CLASSES.DriverHelper) @@ -99,6 +99,9 @@ export class CreateWorkspace { Logger.debug(`factoryUrl: "${factoryUrl}"`); await this.driverHelper.waitVisibility(CreateWorkspace.FACTORY_URL, timeout); await this.driverHelper.type(CreateWorkspace.FACTORY_URL, Key.chord(factoryUrl), timeout); + + const actualFactoryUrl: string = await this.getGitRepositoryUrl(timeout); + Logger.info(`[INFO] Git repository URL set to "${actualFactoryUrl}"`); } async getGitRepositoryUrl(timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise { @@ -179,6 +182,7 @@ export class CreateWorkspace { // click to change state Logger.debug(`Checkbox is ${isCurrentlyChecked ? 'set' : 'unset'}, ${checked ? 'setting' : 'unsetting'} it now`); + await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL); // wait for any potential UI updates before clicking await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); } diff --git a/tests/e2e/pageobjects/dashboard/Dashboard.ts b/tests/e2e/pageobjects/dashboard/Dashboard.ts index 8e79a1602a4..0d83309f3f4 100644 --- a/tests/e2e/pageobjects/dashboard/Dashboard.ts +++ b/tests/e2e/pageobjects/dashboard/Dashboard.ts @@ -32,7 +32,6 @@ export class Dashboard { '//div[text()="Several workspaces created from the same repository have been found. Should you want to open one of the existing workspaces or create a new one, please choose the corresponding action."]' ); private static readonly EXISTING_WORKSPACE_FOUND_LIST: By = By.xpath('//button//span[text()="Open the existing workspace"]'); - private static readonly EXISTING_WORKSPACE_NAME: By = By.xpath('//li//a[text()="python-hello-world"]"]'); private static readonly CREATE_NEW_WORKSPACE_LINK: By = By.xpath('//button[text()="Create a new workspace"]'); private static readonly ABOUT_DIALOG_ITEM_DATA_TEST_IDS: any = { serverVersion: 'server-version', @@ -191,7 +190,7 @@ export class Dashboard { await this.driverHelper.waitVisibility(Dashboard.EXISTING_WORKSPACE_FOUND_LIST); const element: WebElement = await this.driverHelper.waitPresence(Dashboard.EXISTING_WORKSPACE_FOUND_LIST); await this.driverHelper.getDriver().executeScript('arguments[0].click();', element); - await this.driverHelper.waitAndClick(By.xpath(`//li//a[text()="${workspaceName}"]`)); + await this.driverHelper.waitAndClick(By.xpath(`//li//span[text()="${workspaceName}"]`)); } async clickOnCreateNewWorkspaceButton(timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise { diff --git a/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts b/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts index fbebda4839d..d50bfb81135 100644 --- a/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts +++ b/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts @@ -21,6 +21,7 @@ import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS'; import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace'; import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS'; +import { trace } from 'console'; const projectName: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_PROJECT_NAME || 'python-hello-world'; From 2b17e4293561460fc7a29f7fe83dd8e7c5f80350 Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Fri, 27 Mar 2026 10:07:12 +0200 Subject: [PATCH 07/11] Fix up --- tests/e2e/pageobjects/dashboard/CreateWorkspace.ts | 2 +- .../CreateWorkspaceWithExistingNameFromGitUrl.spec.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index b0ca0dabc6a..c1dac00de25 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -182,7 +182,7 @@ export class CreateWorkspace { // click to change state Logger.debug(`Checkbox is ${isCurrentlyChecked ? 'set' : 'unset'}, ${checked ? 'setting' : 'unsetting'} it now`); - await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL); // wait for any potential UI updates before clicking + await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT); // wait for any potential UI updates before clicking await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); } diff --git a/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts b/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts index d50bfb81135..fbebda4839d 100644 --- a/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts +++ b/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts @@ -21,7 +21,6 @@ import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS'; import { CreateWorkspace } from '../../pageobjects/dashboard/CreateWorkspace'; import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS'; -import { trace } from 'console'; const projectName: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_PROJECT_NAME || 'python-hello-world'; From e7ffcb1421b0175f1c2533c58dd6e7ba5392a57f Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Fri, 27 Mar 2026 10:30:03 +0200 Subject: [PATCH 08/11] Fix up --- tests/e2e/pageobjects/dashboard/CreateWorkspace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index c1dac00de25..564d4a41328 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -182,7 +182,7 @@ export class CreateWorkspace { // click to change state Logger.debug(`Checkbox is ${isCurrentlyChecked ? 'set' : 'unset'}, ${checked ? 'setting' : 'unsetting'} it now`); - await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT); // wait for any potential UI updates before clicking + await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_IDE_LOAD_TIMEOUT); // wait for any potential UI updates before clicking await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); } From c2c6d096ebc428e66a0607cbdcd2b79ecba00f0a Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Fri, 27 Mar 2026 12:04:14 +0200 Subject: [PATCH 09/11] Fix up --- tests/e2e/pageobjects/dashboard/CreateWorkspace.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index 564d4a41328..d103c323aa0 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -98,7 +98,7 @@ export class CreateWorkspace { async setGitRepositoryUrl(factoryUrl: string, timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise { Logger.debug(`factoryUrl: "${factoryUrl}"`); await this.driverHelper.waitVisibility(CreateWorkspace.FACTORY_URL, timeout); - await this.driverHelper.type(CreateWorkspace.FACTORY_URL, Key.chord(factoryUrl), timeout); + await this.driverHelper.type(CreateWorkspace.FACTORY_URL, factoryUrl, timeout); const actualFactoryUrl: string = await this.getGitRepositoryUrl(timeout); Logger.info(`[INFO] Git repository URL set to "${actualFactoryUrl}"`); @@ -182,7 +182,7 @@ export class CreateWorkspace { // click to change state Logger.debug(`Checkbox is ${isCurrentlyChecked ? 'set' : 'unset'}, ${checked ? 'setting' : 'unsetting'} it now`); - await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_IDE_LOAD_TIMEOUT); // wait for any potential UI updates before clicking + await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL); // wait for any potential UI updates before clicking await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); } From d9d0a46e9d4ee9288f0aefe1655b3e7c4e0973bf Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Fri, 27 Mar 2026 12:31:30 +0200 Subject: [PATCH 10/11] Fix up --- tests/e2e/pageobjects/dashboard/CreateWorkspace.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index d103c323aa0..2d3aa805a60 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -182,7 +182,7 @@ export class CreateWorkspace { // click to change state Logger.debug(`Checkbox is ${isCurrentlyChecked ? 'set' : 'unset'}, ${checked ? 'setting' : 'unsetting'} it now`); - await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL); // wait for any potential UI updates before clicking + await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_COMMON_PLUGIN_TEST_TIMEOUT); // wait for any potential UI updates before clicking await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); } From 3b215628a35c19ecc7ebbe1e97bcd380ffe88036 Mon Sep 17 00:00:00 2001 From: Aleksandr Shmaraiev Date: Fri, 27 Mar 2026 20:05:50 +0200 Subject: [PATCH 11/11] Fix up --- tests/e2e/pageobjects/dashboard/CreateWorkspace.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index 2d3aa805a60..3a2dda96278 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -182,8 +182,10 @@ export class CreateWorkspace { // click to change state Logger.debug(`Checkbox is ${isCurrentlyChecked ? 'set' : 'unset'}, ${checked ? 'setting' : 'unsetting'} it now`); - await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_COMMON_PLUGIN_TEST_TIMEOUT); // wait for any potential UI updates before clicking - await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); + await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL); // wait for any potential UI updates before clicking + await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); // scroll to checkbox to ensure it's in view + await this.driverHelper.scrollTo(CreateWorkspace.CREATE_AND_OPEN_BUTTON, timeout); + await this.driverHelper.wait(TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL); // wait for state change to take effect } private getEditorsDropdownListLocator(sampleName: string): By {