-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Runtime detection product tests stability improvements.
- Loading branch information
Showing
13 changed files
with
134 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 21 additions & 9 deletions
30
...ools.runtime.reddeer/src/org/jboss/tools/runtime/reddeer/wizard/TaskWizardSecondPage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,36 @@ | ||
package org.jboss.tools.runtime.reddeer.wizard; | ||
|
||
import org.jboss.reddeer.common.exception.WaitTimeoutExpiredException; | ||
import org.jboss.reddeer.core.exception.CoreLayerException; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.eclipse.swt.SWT; | ||
import org.eclipse.swt.widgets.Button; | ||
import org.hamcrest.Matcher; | ||
import org.jboss.reddeer.common.wait.WaitUntil; | ||
import org.jboss.reddeer.core.condition.WidgetIsFound; | ||
import org.jboss.reddeer.core.matcher.ClassMatcher; | ||
import org.jboss.reddeer.core.matcher.WithMnemonicTextMatcher; | ||
import org.jboss.reddeer.core.matcher.WithStyleMatcher; | ||
import org.jboss.reddeer.jface.wizard.WizardPage; | ||
import org.jboss.reddeer.swt.impl.button.RadioButton; | ||
|
||
public class TaskWizardSecondPage extends WizardPage{ | ||
|
||
public void acceptLicense(boolean accept){ | ||
if(accept){ | ||
|
||
try { | ||
new RadioButton("I accept the terms of the license agreement").click(); | ||
} catch (CoreLayerException e) { | ||
// This can sometimes fail. Try again | ||
new RadioButton("I accept the terms of the license agreement").click(); | ||
} | ||
new WaitUntil(new WidgetIsFound<Button>(getRadioButtonMatchers("I accept the terms of the license agreement"))); | ||
new RadioButton("I accept the terms of the license agreement").click(); | ||
}else { | ||
new RadioButton("I do not accept the terms of the license agreement").click(); | ||
} | ||
} | ||
|
||
private Matcher<?>[] getRadioButtonMatchers(String text){ | ||
List<Matcher<?>> list= new ArrayList<Matcher<?>>(); | ||
list.add(new WithStyleMatcher(SWT.RADIO)); | ||
list.add(new WithMnemonicTextMatcher(text)); | ||
list.add(new ClassMatcher(Button.class)); | ||
return list.toArray(new Matcher[list.size()]); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.