From 3429f72b9a0b4daa8d411712d037e9180e890088 Mon Sep 17 00:00:00 2001 From: Serhii Date: Thu, 12 Mar 2026 17:43:56 +0200 Subject: [PATCH 1/4] Improve Create New checkbox handling in CreateWorkspace page object --- .../pageobjects/dashboard/CreateWorkspace.ts | 27 ++++++++++++++++--- ...orkspaceWithExistingNameFromGitUrl.spec.ts | 4 ++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index 95cee2e4eb5..0ca965e0cc9 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -134,10 +134,32 @@ export class CreateWorkspace { return await element.isSelected(); } + async waitForCheckboxState( + expectedState: boolean, + timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT + ): Promise { + Logger.debug(`waiting for checkbox to be ${expectedState ? 'checked' : 'unchecked'}`); + + const polling: number = 500; + const attempts: number = Math.ceil(timeout / polling); + + for (let i: number = 0; i < attempts; i++) { + const currentState: boolean = await this.isCreateNewWorkspaceCheckboxChecked(); + if (currentState === expectedState) { + Logger.debug(`Checkbox reached expected state: ${expectedState}`); + await this.driverHelper.wait(polling); + return; + } + await this.driverHelper.wait(timeout); + } + + throw new Error(`Checkbox did not reach expected state ${expectedState} within ${timeout}ms`); + } + async clickOnCreateNewWorkspaceCheckbox(timeout: number = TIMEOUT_CONSTANTS.TS_SELENIUM_WAIT_FOR_URL): Promise { Logger.debug(); - await this.driverHelper.waitAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); + await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); } async setCreateNewWorkspaceCheckbox( @@ -157,8 +179,7 @@ export class CreateWorkspace { // click to change state Logger.debug(`Checkbox is ${isCurrentlyChecked ? 'set' : 'unset'}, ${checked ? 'setting' : 'unsetting'} it now`); - await this.driverHelper.waitAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); - await this.driverHelper.wait(1000); + await this.driverHelper.scrollToAndClick(CreateWorkspace.CREATE_NEW_WORKPACE_CHECKBOX, timeout); } private getEditorsDropdownListLocator(sampleName: string): By { diff --git a/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts b/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts index f9417d59d4a..e997013dce2 100644 --- a/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts +++ b/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts @@ -75,7 +75,7 @@ suite(`"Start workspace with existed workspace name" test ${BASE_TEST_CONSTANTS. await waitDashboardPage(); await createWorkspace.setGitRepositoryUrl(factoryUrl); - expect(await createWorkspace.isCreateNewWorkspaceCheckboxChecked()).to.be.false; + await createWorkspace.waitForCheckboxState(false); expect(await createWorkspace.getGitRepositoryUrl()).to.be.equal(factoryUrl); await createWorkspace.clickOnCreateAndOpenButton(); await createWorkspace.performTrustAuthorPopup(); @@ -102,7 +102,9 @@ suite(`"Start workspace with existed workspace name" test ${BASE_TEST_CONSTANTS. await waitDashboardPage(); await createWorkspace.setGitRepositoryUrl(factoryUrl); + await createWorkspace.waitForCheckboxState(false); await createWorkspace.setCreateNewWorkspaceCheckbox(true); + await createWorkspace.waitForCheckboxState(true); expect(await createWorkspace.getGitRepositoryUrl()).to.be.equal(factoryUrl + '?new'); From 6a48574a913908bd4386abb44de2edf49be48923 Mon Sep 17 00:00:00 2001 From: Sergey Skorik Date: Thu, 12 Mar 2026 18:20:38 +0200 Subject: [PATCH 2/4] Update copyright year to 2026 --- 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 0ca965e0cc9..a4641ffbf69 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 From 14bd41b1eb7c2919ac465d7e3202f7c2d04607c9 Mon Sep 17 00:00:00 2001 From: Sergey Skorik Date: Thu, 12 Mar 2026 18:20:54 +0200 Subject: [PATCH 3/4] Update copyright year to 2026 --- .../CreateWorkspaceWithExistingNameFromGitUrl.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts b/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts index e997013dce2..fbebda4839d 100644 --- a/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts +++ b/tests/e2e/specs/miscellaneous/CreateWorkspaceWithExistingNameFromGitUrl.spec.ts @@ -1,5 +1,5 @@ /** ******************************************************************* - * copyright (c) 2020-2025 Red Hat, Inc. + * copyright (c) 2020-2026 Red Hat, Inc. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 From d652b981fd641772ab1709432da963cba077c7a4 Mon Sep 17 00:00:00 2001 From: Serhii Date: Fri, 13 Mar 2026 11:34:15 +0200 Subject: [PATCH 4/4] fix waiting timeout --- tests/e2e/pageobjects/dashboard/CreateWorkspace.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index a4641ffbf69..83296a8bc2e 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -147,10 +147,9 @@ export class CreateWorkspace { const currentState: boolean = await this.isCreateNewWorkspaceCheckboxChecked(); if (currentState === expectedState) { Logger.debug(`Checkbox reached expected state: ${expectedState}`); - await this.driverHelper.wait(polling); return; } - await this.driverHelper.wait(timeout); + await this.driverHelper.wait(polling); } throw new Error(`Checkbox did not reach expected state ${expectedState} within ${timeout}ms`);