diff --git a/e2e/driver/ChromeDriver.ts b/e2e/driver/ChromeDriver.ts index bb26a46a32e..393fc283c47 100644 --- a/e2e/driver/ChromeDriver.ts +++ b/e2e/driver/ChromeDriver.ts @@ -55,7 +55,7 @@ export class ChromeDriver implements IDriver { if (TestConstants.TS_SELENIUM_REMOTE_DRIVER_URL) { builder = builder.usingServer(TestConstants.TS_SELENIUM_REMOTE_DRIVER_URL); } - + return builder; } diff --git a/e2e/index.ts b/e2e/index.ts index 5fdd32c0160..ef88f329b78 100644 --- a/e2e/index.ts +++ b/e2e/index.ts @@ -3,37 +3,37 @@ export { inversifyConfig }; export * from './inversify.types'; export * from './TestConstants'; -export * from './driver/ContainerInitializer'; -export * from './driver/IDriver'; export * from './driver/ChromeDriver'; +export * from './driver/IDriver'; +export * from './driver/ContainerInitializer'; export * from './utils/ScreenCatcher'; export * from './utils/DriverHelper'; export * from './utils/NameGenerator'; export * from './utils/workspace/ITestWorkspaceUtil'; export * from './utils/workspace/WorkspaceStatus'; export * from './utils/workspace/TestWorkspaceUtil'; -export * from './pageobjects/openshift/OcpLoginPage'; -export * from './pageobjects/openshift/OcpWebConsolePage'; export * from './pageobjects/login/OcpLoginByTempAdmin'; -export * from './pageobjects/login/ICheLoginPage'; export * from './pageobjects/login/MultiUserLoginPage'; export * from './pageobjects/login/IOcpLoginPage'; +export * from './pageobjects/login/ICheLoginPage'; export * from './pageobjects/login/SingleUserLoginPage'; +export * from './pageobjects/dashboard/NewWorkspace'; +export * from './pageobjects/dashboard/Workspaces'; export * from './pageobjects/dashboard/workspace-details/WorkspaceDetails'; export * from './pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins'; -export * from './pageobjects/dashboard/Workspaces'; export * from './pageobjects/dashboard/Dashboard'; -export * from './pageobjects/dashboard/NewWorkspace'; export * from './pageobjects/ide/Terminal'; -export * from './pageobjects/ide/Editor'; -export * from './pageobjects/ide/OpenWorkspaceWidget'; -export * from './pageobjects/ide/ProjectTree'; -export * from './pageobjects/ide/QuickOpenContainer'; +export * from './pageobjects/ide/TopMenu'; export * from './pageobjects/ide/RightToolbar'; -export * from './pageobjects/ide/ContextMenu'; +export * from './pageobjects/ide/OpenWorkspaceWidget'; export * from './pageobjects/ide/Ide'; -export * from './pageobjects/ide/DebugView'; +export * from './pageobjects/ide/Editor'; +export * from './pageobjects/ide/ProjectTree'; +export * from './pageobjects/ide/PreviewWidget'; export * from './pageobjects/ide/GitHubPlugin'; -export * from './pageobjects/ide/TopMenu'; +export * from './pageobjects/ide/DebugView'; +export * from './pageobjects/ide/ContextMenu'; export * from './pageobjects/ide/WarningDialog'; -export * from './pageobjects/ide/PreviewWidget'; +export * from './pageobjects/ide/QuickOpenContainer'; +export * from './pageobjects/openshift/OcpWebConsolePage'; +export * from './pageobjects/openshift/OcpLoginPage'; diff --git a/e2e/pageobjects/ide/Editor.ts b/e2e/pageobjects/ide/Editor.ts index 7316d267b84..3bac3ff1fe5 100644 --- a/e2e/pageobjects/ide/Editor.ts +++ b/e2e/pageobjects/ide/Editor.ts @@ -35,6 +35,17 @@ export class Editor { await this.driverHelper.waitDisappearanceWithTimeout(By.css(Editor.SUGGESTION_WIDGET_BODY_CSS)); } + public async scrollAndSearchSuggestion(editorTabTitle: string, suggestionLocator: By, timeout: number = 10000) { + await this.driverHelper.getDriver().wait(async () => { + await this.waitSuggestionContainer(); + if (await this.driverHelper.isVisible(suggestionLocator)) { + return true; + } + + await this.performKeyCombination(editorTabTitle, Key.ARROW_DOWN); + }, timeout); + } + public async waitSuggestion(editorTabTitle: string, suggestionText: string, timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT) { @@ -42,9 +53,8 @@ export class Editor { const suggestionLocator: By = this.getSuggestionLineXpathLocator(suggestionText); await this.driverHelper.getDriver().wait(async () => { - await this.waitSuggestionContainer(); try { - await this.driverHelper.waitVisibility(suggestionLocator, 5000); + await this.scrollAndSearchSuggestion(editorTabTitle, suggestionLocator); return true; } catch (err) { if (!(err instanceof error.TimeoutError)) { diff --git a/e2e/tests/e2e_happy_path/HappyPath.spec.ts b/e2e/tests/e2e_happy_path/HappyPath.spec.ts index 534d654b523..84bbde15321 100644 --- a/e2e/tests/e2e_happy_path/HappyPath.spec.ts +++ b/e2e/tests/e2e_happy_path/HappyPath.spec.ts @@ -125,9 +125,7 @@ suite('Language server validation', async () => { try { await editor.performKeyCombination(javaFileName, Key.chord(Key.CONTROL, Key.F12)); await editor.waitEditorAvailable(codeNavigationClassName); - } - // workaround for issue: https://github.com/eclipse/che/issues/14520 - catch (err) { + } catch (err) { if (err instanceof error.TimeoutError) { checkCodeNavigationWithContextMenu(); }