Search in sources :

Example 1 with PreTranslateResultDialog

use of net.heartsome.cat.ts.test.ui.dialogs.PreTranslateResultDialog 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();
}
Also used : WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException) DefaultCondition(org.eclipse.swtbot.swt.finder.waits.DefaultCondition) PreTranslateResultDialog(net.heartsome.cat.ts.test.ui.dialogs.PreTranslateResultDialog) WidgetNotFoundException(org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)

Aggregations

PreTranslateResultDialog (net.heartsome.cat.ts.test.ui.dialogs.PreTranslateResultDialog)1 WidgetNotFoundException (org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException)1 DefaultCondition (org.eclipse.swtbot.swt.finder.waits.DefaultCondition)1