use of org.eclipse.swtbot.swt.finder.waits.DefaultCondition 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();
}
Aggregations