Skip to content

Commit

Permalink
[TS_SELENIUM] Implement workaround for issue #14660 (Unexpected list …
Browse files Browse the repository at this point in the history
…of suggestions when use Java languageserver) in the "HappyPath" test. (#14672)

Signed-off-by: Ihor Okhrimenko <[email protected]>
  • Loading branch information
Ohrimenko1988 authored Sep 26, 2019
1 parent 8761154 commit fd6f7ad
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion e2e/driver/ChromeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}
Expand Down
30 changes: 15 additions & 15 deletions e2e/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
14 changes: 12 additions & 2 deletions e2e/pageobjects/ide/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,26 @@ 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) {

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)) {
Expand Down
4 changes: 1 addition & 3 deletions e2e/tests/e2e_happy_path/HappyPath.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit fd6f7ad

Please sign in to comment.