From 141e78af19ea38c95e269ffc0c7e7109138b1f61 Mon Sep 17 00:00:00 2001 From: Serhii Date: Wed, 11 Mar 2026 14:06:19 +0200 Subject: [PATCH 1/4] select branch from branches list --- .../pageobjects/dashboard/CreateWorkspace.ts | 18 ++++++++++++++---- .../factory/FactoryWithGitRepoOptions.spec.ts | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index 95cee2e4eb5..2dc3ce2b3ec 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -21,7 +21,10 @@ 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('//input[@aria-label="Git Branch"]'); + 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_SEACH_FIELD: By = By.xpath('//input[@type="search"]'); private static readonly PATH_TO_DEVFILE: By = By.xpath('//input[@aria-label="Path to Devfile"]'); 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"]'); @@ -75,7 +78,7 @@ export class CreateWorkspace { async importFromGitUsingUI( factoryUrl: string, branchName?: string, - timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT + timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT ): Promise { Logger.debug(`factoryUrl: "${factoryUrl}"`); @@ -85,8 +88,11 @@ export class CreateWorkspace { if (branchName) { await this.driverHelper.waitAndClick(CreateWorkspace.GIT_REPO_OPTIONS, timeout); - await this.driverHelper.waitVisibility(CreateWorkspace.GIT_BRANCH_NAME, timeout); - await this.driverHelper.type(CreateWorkspace.GIT_BRANCH_NAME, Key.chord(branchName, Key.ENTER), timeout); + await this.driverHelper.waitAndClick(CreateWorkspace.GIT_BRANCH_NAME, timeout); + + await this.driverHelper.waitVisibility(CreateWorkspace.GIT_BRANCH_SEACH_FIELD, timeout); + await this.driverHelper.type(CreateWorkspace.GIT_BRANCH_SEACH_FIELD, Key.chord(branchName), timeout); + await this.driverHelper.waitAndClick(this.getGitBranchListItemLocator(branchName), timeout); } await this.driverHelper.waitAndClick(CreateWorkspace.CREATE_AND_OPEN_BUTTON, timeout); @@ -189,4 +195,8 @@ export class CreateWorkspace { return By.xpath(`//article[contains(@class, 'sample-card')]//div[text()='${sampleName}']`); } + + private getGitBranchListItemLocator(branchName: string): By { + return By.xpath(`//li[@id="${branchName}"]`); + } } diff --git a/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts b/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts index 0f30ac8ab4a..4a3aea2c474 100644 --- a/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts +++ b/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts @@ -30,7 +30,7 @@ suite(`The FactoryWithGitRepoOptions userstory ${BASE_TEST_CONSTANTS.TEST_ENVIRO const factoryUrl: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/testsfactory/quarkus-api-example.git'; - const expectedBranchName: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH || 'main'; + const expectedBranchName: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH || 'test'; let projectSection: ViewSection; suite(`Create workspace from factory:${factoryUrl}`, function (): void { suiteSetup('Login', async function (): Promise { From 5ead47b8bcc43df4fe83062b4173a00d2b7f326a Mon Sep 17 00:00:00 2001 From: Serhii Date: Wed, 11 Mar 2026 14:57:02 +0200 Subject: [PATCH 2/4] restore default branch name --- tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts b/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts index 4a3aea2c474..0f30ac8ab4a 100644 --- a/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts +++ b/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts @@ -30,7 +30,7 @@ suite(`The FactoryWithGitRepoOptions userstory ${BASE_TEST_CONSTANTS.TEST_ENVIRO const factoryUrl: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/testsfactory/quarkus-api-example.git'; - const expectedBranchName: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH || 'test'; + const expectedBranchName: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH || 'main'; let projectSection: ViewSection; suite(`Create workspace from factory:${factoryUrl}`, function (): void { suiteSetup('Login', async function (): Promise { From 5bbfac37c2a9974e0fe9972bd2411f2ee386ca82 Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 12 Mar 2026 15:20:48 +0200 Subject: [PATCH 3/4] update locators --- 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 2dc3ce2b3ec..bd5ad04f07b 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -24,7 +24,7 @@ export class CreateWorkspace { 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_SEACH_FIELD: By = By.xpath('//input[@type="search"]'); + private static readonly GIT_BRANCH_SEACH_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 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"]'); @@ -197,6 +197,6 @@ export class CreateWorkspace { } private getGitBranchListItemLocator(branchName: string): By { - return By.xpath(`//li[@id="${branchName}"]`); + return By.css(`li[id="${branchName}"]`); } } From 4ba5191ef018834de539a4dda426f862da97f760 Mon Sep 17 00:00:00 2001 From: Serhii Date: Fri, 13 Mar 2026 11:08:43 +0200 Subject: [PATCH 4/4] update locator name --- tests/e2e/pageobjects/dashboard/CreateWorkspace.ts | 10 +++++----- .../specs/factory/FactoryWithGitRepoOptions.spec.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index bd5ad04f07b..86dae0627bc 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -1,5 +1,5 @@ /** ******************************************************************* - * copyright (c) 2019-2023 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 @@ -24,7 +24,7 @@ export class CreateWorkspace { 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_SEACH_FIELD: By = By.css('input[type="search"]'); + 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 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"]'); @@ -90,8 +90,8 @@ export class CreateWorkspace { await this.driverHelper.waitAndClick(CreateWorkspace.GIT_BRANCH_NAME, timeout); - await this.driverHelper.waitVisibility(CreateWorkspace.GIT_BRANCH_SEACH_FIELD, timeout); - await this.driverHelper.type(CreateWorkspace.GIT_BRANCH_SEACH_FIELD, Key.chord(branchName), 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(this.getGitBranchListItemLocator(branchName), timeout); } @@ -197,6 +197,6 @@ export class CreateWorkspace { } private getGitBranchListItemLocator(branchName: string): By { - return By.css(`li[id="${branchName}"]`); + return By.css(`li[id="${branchName}"] button.pf-c-select__menu-item`); } } diff --git a/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts b/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts index 0f30ac8ab4a..05012e7e7d0 100644 --- a/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts +++ b/tests/e2e/specs/factory/FactoryWithGitRepoOptions.spec.ts @@ -1,5 +1,5 @@ /** ******************************************************************* - * copyright (c) 2024 Red Hat, Inc. + * copyright (c) 2026 Red Hat, Inc. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0