From e84b2f5dd51c26faa332c6525407c359503ddee3 Mon Sep 17 00:00:00 2001 From: Tibor Dancs Date: Mon, 18 Sep 2023 09:07:08 +0000 Subject: [PATCH] Fixed project import logic and dashboard locator (#22516) Signed-off-by: Tibor Dancs --- tests/e2e/pageobjects/dashboard/Workspaces.ts | 2 +- tests/e2e/specs/SmokeTest.spec.ts | 8 +++++--- tests/e2e/utils/StringUtil.ts | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/e2e/pageobjects/dashboard/Workspaces.ts b/tests/e2e/pageobjects/dashboard/Workspaces.ts index e06c2b2e123..95e0c5804bd 100644 --- a/tests/e2e/pageobjects/dashboard/Workspaces.ts +++ b/tests/e2e/pageobjects/dashboard/Workspaces.ts @@ -206,7 +206,7 @@ export class Workspaces { } private getActionsPopupButtonLocator(workspaceName: string, buttonText: string): By { - return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName)}//li[@role='menuitem']//button[text()='${buttonText}']`); + return By.xpath(`${this.getWorkspaceListItemLocator(workspaceName)}//button[text()='${buttonText}']`); } private getOpenButtonLocator(workspaceName: string): By { diff --git a/tests/e2e/specs/SmokeTest.spec.ts b/tests/e2e/specs/SmokeTest.spec.ts index f5b9a7d165d..0e2d9df7117 100644 --- a/tests/e2e/specs/SmokeTest.spec.ts +++ b/tests/e2e/specs/SmokeTest.spec.ts @@ -41,12 +41,14 @@ suite(`The SmokeTest userstory`, async function (): Promise { }); test('Check a project folder has been created', async function (): Promise { const projectName: string = StringUtil.getProjectNameFromGitUrl(factoryUrl); - projectSection = await new SideBarView().getContent().getSection(projectName); - Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`); + projectSection = (await new SideBarView().getContent().getSections())[0]; // get the (WORKSPACE) section from the sidebar - contains project content + expect(await projectSection.findItem(projectName)).not.eqls(undefined); }); test('Check the project files was imported', async function (): Promise { Logger.debug(`projectSection.findItem: find ${BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME}`); - const isFileImported: ViewItem | undefined = await projectSection.findItem(BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME); + const isFileImported: ViewItem | undefined = await projectSection.findItem( + BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME + ); expect(isFileImported).not.eqls(undefined); }); test('Stop the workspace', async function (): Promise { diff --git a/tests/e2e/utils/StringUtil.ts b/tests/e2e/utils/StringUtil.ts index ead9daef7ce..4d1251b553c 100644 --- a/tests/e2e/utils/StringUtil.ts +++ b/tests/e2e/utils/StringUtil.ts @@ -10,7 +10,6 @@ import { injectable } from 'inversify'; import { Logger } from './Logger'; -import { KubernetesCommandLineToolsExecutor } from './KubernetesCommandLineToolsExecutor'; @injectable() export class StringUtil {