use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project translationstudio8 by heartsome.
the class ProjectSetting method setTMDB.
/**
* 设置记忆库
* @param from
* 功能入口,请使用 TSUIConstants 类提供的常量;
* @param nextAction
* 下一步操作,请使用本类提供的常量;
*/
public void setTMDB(Entry from, NextAction nextAction) {
if (dlgPrjSetting == null) {
openPrjSettingDlg(from);
}
dlgPrjSetting.treiTmSetting().select();
if (!dlgPrjSetting.table().containsTextInColumn(tMDBName, dlgPrjSetting.tblColName())) {
if (isTMDBExist) {
dlgPrjSetting.btnAdd().click();
DBManagement dbMgmt = new DBManagement(row);
dbMgmt.selectDB(tMDBName);
} else {
dlgPrjSetting.btnCreate().click();
// TODO 目前弹出的是数据库创建向导,而该向导有较大的改进余地,暂不实现
}
try {
InformationDialog dlgInfo = new InformationDialog(InformationDialog.dlgTitleTips, InformationDialog.msgNoMatchInDB);
dlgInfo.btnOK().click();
Waits.shellClosed(dlgInfo);
} catch (WidgetNotFoundException e) {
// e.printStackTrace();
}
assertTrue("未正确选择记忆库:" + tMDBName, dlgPrjSetting.table().containsTextInColumn(tMDBName, dlgPrjSetting.tblColName()));
}
nextAction(nextAction);
}
use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project translationstudio8 by heartsome.
the class PreTranslate method preTranslate.
/**
* 预翻译
* @param from
* 入口,请使用 TSUIConstants 类提供的常量;
*/
public void preTranslate(Entry from) {
getDataPreTrans();
select();
openPreTransDlg(from);
assertTrue("未正确添加选中的文件:" + fileFullPath, dlgPreTrans.table().containsTextInColumn(fileFullPath, dlgPreTrans.tblColFile()));
dlgPreTrans.btnOK().click();
HSBot.bot().waitUntil(new DefaultCondition() {
public boolean test() throws Exception {
try {
dlgPreTransResult = new PreTranslateResultDialog();
return dlgPreTransResult.isOpen();
} catch (WidgetNotFoundException e) {
return false;
}
}
public String getFailureMessage() {
return "未正确显示预翻译结果对话框。";
}
}, 3600000);
assertTrue("未正确该文件的预翻译结果:" + fileFullPath, dlgPreTransResult.table().containsTextInColumn(fileFullPath, dlgPreTransResult.tblColFile()));
dlgPreTransResult.btnOK().click();
}
use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project xtext-xtend by eclipse.
the class SwtBotProjectHelper method fileNew.
protected static void fileNew(final SWTWorkbenchBot it, final String newWhat) {
int retries = 3;
ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, retries, true);
for (final Integer i : _doubleDotLessThan) {
try {
it.menu("File").menu("New").menu(newWhat).click();
return;
} catch (final Throwable _t) {
if (_t instanceof WidgetNotFoundException) {
final WidgetNotFoundException e = (WidgetNotFoundException) _t;
if (((i).intValue() == (retries - 1))) {
throw e;
}
String _message = e.getMessage();
String _plus = ("failed: " + _message);
InputOutput.<String>println(_plus);
InputOutput.<String>println("retrying...");
it.sleep(1000);
} else {
throw Exceptions.sneakyThrow(_t);
}
}
}
}
use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project linuxtools by eclipse.
the class AbstractSWTBotTest method exitProjectFolder.
/**
* Exit from the project tree.
*/
private static void exitProjectFolder(SWTWorkbenchBot bot) {
try {
SWTBotToolbarButton forwardButton = projectExplorer.toolbarPushButton("Forward");
projectExplorer.toolbarPushButton("Back to Workspace").click();
bot.waitUntil(widgetIsEnabled(forwardButton));
} catch (WidgetNotFoundException e) {
// Already exited from project folder
}
}
use of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException in project linuxtools by eclipse.
the class MetadataPageTest method setUpBeforeClass.
/**
* Initialize the test project.
*
* @throws CoreException
*/
@BeforeClass
public static void setUpBeforeClass() throws CoreException {
testProject = new TestCreaterepoProject();
assertTrue(testProject.getProject().exists());
bot = new SWTWorkbenchBot();
try {
bot.shell(ICreaterepoTestConstants.MAIN_SHELL).activate();
} catch (WidgetNotFoundException e) {
// cannot activate main shell, continue anyways
}
TestUtils.openResourcePerspective(bot);
navigator = TestUtils.enterProjectFolder(bot);
}
Aggregations