diff --git a/tests/e2e/pageobjects/webterminal/WebTerminalPage.ts b/tests/e2e/pageobjects/webterminal/WebTerminalPage.ts index 54d4ccf9c16..48c99951b50 100644 --- a/tests/e2e/pageobjects/webterminal/WebTerminalPage.ts +++ b/tests/e2e/pageobjects/webterminal/WebTerminalPage.ts @@ -173,7 +173,7 @@ export class WebTerminalPage { } async clickOnTimeUnitDropDown(): Promise { - await this.driverHelper.waitAndClick(WebTerminalPage.TIME_UNIT_DROP_DAWN); + await this.driverHelper.scrollToAndClick(WebTerminalPage.TIME_UNIT_DROP_DAWN); } async selectTimeUnit(timeUnits: TimeUnits): Promise { await this.driverHelper.waitAndClick(By.xpath(`//button[@data-test-id='dropdown-menu' and text()='${timeUnits}']`)); diff --git a/tests/e2e/specs/web-terminal/WebTerminalUnderAdmin.spec.ts b/tests/e2e/specs/web-terminal/WebTerminalUnderAdmin.spec.ts index 6c295d89de6..c4bacbf0cfc 100644 --- a/tests/e2e/specs/web-terminal/WebTerminalUnderAdmin.spec.ts +++ b/tests/e2e/specs/web-terminal/WebTerminalUnderAdmin.spec.ts @@ -66,18 +66,17 @@ suite(`Login to Openshift console and start WebTerminal ${BASE_TEST_CONSTANTS.TE expect(commandResult).contains('admin'); }); test('Verify help command under admin user', async function (): Promise { - const helpCommandExpectedResult: string = - 'oc.*\\d+\\.\\d+\\.\\d+.*OpenShift CLI\n' + - 'kubectl.*\\d+\\.\\d+\\.\\d+.*Kubernetes CLI\n' + - 'kustomize.*\\d+\\.\\d+\\.\\d+.*Kustomize CLI\n' + - 'helm.*\\d+\\.\\d+\\.\\d+.*Helm CLI\n' + - 'kn.*\\d+\\.\\d+\\.\\d+.*KNative CLI\n' + - 'tkn.*\\d+\\.\\d+\\.\\d+.*Tekton CLI\n' + - 'subctl.*\\d+\\.\\d+\\.\\d+.*Submariner CLI\n' + - 'odo.*\\d+\\.\\d+\\.\\d+.*Red Hat OpenShift Developer CLI\n' + - 'virtctl.*\\d+\\.\\d+\\.\\d+.*KubeVirt CLI\n' + - 'rhoas.*\\d+\\.\\d+\\.\\d+.*Red Hat OpenShift Application Services CLI\n' + - 'jq.*\\d+\\.\\d+.*jq'; + const expectedStrings: string[] = [ + 'OpenShift CLI', + 'Kubernetes CLI', + 'Kustomize CLI (built-in to kubectl)', + 'Helm CLI', + 'KNative CLI', + 'Tekton CLI', + 'Submariner CLI', + 'KubeVirt CLI', + 'jq' + ]; await webTerminal.typeAndEnterIntoWebTerminal(`help > ${fileForVerificationTerminalCommands}`); @@ -87,7 +86,10 @@ suite(`Login to Openshift console and start WebTerminal ${BASE_TEST_CONSTANTS.TE `cat /home/user/${fileForVerificationTerminalCommands}`, webTerminalToolContainerName ); - expect(commandResult).to.match(new RegExp(helpCommandExpectedResult)); + + expectedStrings.forEach((expectedString): void => { + expect(commandResult).to.contain(expectedString); + }); }); test('Verify help command under admin user', async function (): Promise { diff --git a/tests/e2e/specs/web-terminal/WebTerminalUnderRegularUser.spec.ts b/tests/e2e/specs/web-terminal/WebTerminalUnderRegularUser.spec.ts index a6b8dcea30f..0932d9d6025 100644 --- a/tests/e2e/specs/web-terminal/WebTerminalUnderRegularUser.spec.ts +++ b/tests/e2e/specs/web-terminal/WebTerminalUnderRegularUser.spec.ts @@ -37,6 +37,7 @@ suite(`Login to Openshift console and check WebTerminal ${BASE_TEST_CONSTANTS.TE suiteSetup(function (): void { kubernetesCommandLineToolsExecutor.loginToOcp(); + kubernetesCommandLineToolsExecutor.deleteProject(testProjectName); }); suiteTeardown(function (): void {