Skip to content

Commit

Permalink
Content assist computing proposals check, fixes #2094
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Dockal <odockal@redhat.com>
  • Loading branch information
odockal committed Nov 3, 2020
1 parent 1669a3b commit d4269bd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

import org.eclipse.reddeer.common.logging.Logger;
import org.eclipse.reddeer.common.wait.WaitWhile;
import org.eclipse.reddeer.core.handler.TableItemHandler;
import org.eclipse.reddeer.core.lookup.ShellLookup;
import org.eclipse.reddeer.swt.api.Table;
import org.eclipse.reddeer.swt.api.TableItem;
import org.eclipse.reddeer.swt.condition.ShellIsAvailable;
import org.eclipse.reddeer.swt.impl.shell.AbstractShell;
import org.eclipse.reddeer.core.handler.TableItemHandler;
import org.eclipse.reddeer.core.lookup.ShellLookup;

/**
* This class represents content assistant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
import java.util.Arrays;
import java.util.List;

import org.eclipse.swt.widgets.Shell;
import org.eclipse.reddeer.common.condition.AbstractWaitCondition;
import org.eclipse.reddeer.core.exception.CoreLayerException;
import org.eclipse.reddeer.core.handler.ShellHandler;
import org.eclipse.reddeer.core.lookup.ShellLookup;
import org.eclipse.reddeer.swt.api.Table;
import org.eclipse.reddeer.swt.impl.table.DefaultTable;
import org.eclipse.swt.widgets.Shell;

/**
* Checks if content assistant shell is open.
* @author rawagner
* Checks if content assistant shell is open and computing of proposals is done.
* @author rawagner, odockal
*
*/
public class ContentAssistantShellIsOpened extends AbstractWaitCondition {
Expand Down Expand Up @@ -57,6 +57,11 @@ public final boolean test() {
ShellHandler.getInstance().setFocus(s);
try {
table = new DefaultTable();
// Eclipse 2020-09(12) added informative string when loading proposals
// https://github.com/eclipse/reddeer/issues/2094
if (table.getItem(0).getText().contains("Computing proposals")) {
return false;
}
this.resultShell = s;
return true;
} catch (CoreLayerException ex) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*******************************************************************************/
package org.eclipse.reddeer.workbench.test.view.impl;

import static org.junit.Assert.*;

import org.eclipse.reddeer.junit.runner.RedDeerSuite;
import org.eclipse.reddeer.workbench.api.View;
import org.eclipse.reddeer.workbench.exception.WorkbenchLayerException;
Expand Down

0 comments on commit d4269bd

Please sign in to comment.