SWTBot DI: QAI-12113, solve pb for could not close wizard 'Export Job'

git-svn-id: http://talendforge.org/svn/tis_shared/trunk@86986 f6f1c999-d317-4740-80b0-e6d1abc6f99e
This commit is contained in:
fzhong
2012-07-08 14:06:38 +00:00
parent 76871074a3
commit 67e33a5b9b
2 changed files with 28 additions and 2 deletions

View File

@@ -15,8 +15,13 @@ package tosstudio.importexport;
import java.io.IOException;
import java.net.URISyntaxException;
import junit.framework.Assert;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -48,11 +53,19 @@ public class ExportJobAsWebserviceInWarFileTest extends TalendSwtBotForTos {
@Test
public void exportJob() throws IOException, URISyntaxException {
jobItem.getItem().contextMenu("Export Job").click();
gefBot.shell("Export Job").activate();
SWTBotShell shell = gefBot.shell("Export Job").activate();
gefBot.comboBoxWithLabel("Select the export type").setSelection("Axis WebService (WAR)");
gefBot.comboBoxWithLabel("To &archive file:").setText(
Utilities.getFileFromCurrentPluginSampleFolder("") + FILE_SEPARATOR + "output_job.war");
gefBot.button("Finish").click();
try {
gefBot.waitUntil(Conditions.shellCloses(shell), 60000);
} catch (TimeoutException e) {
gefBot.toolbarButtonWithTooltip("Cancel Operation").click();
gefBot.waitUntil(Conditions.widgetIsEnabled(gefBot.button("Cancel")), 60000);
gefBot.button("Cancel").click();
Assert.fail(e.getMessage());
}
gefBot.waitUntil(new DefaultCondition() {

View File

@@ -15,8 +15,13 @@ package tosstudio.importexport;
import java.io.IOException;
import java.net.URISyntaxException;
import junit.framework.Assert;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.eclipse.swtbot.swt.finder.waits.Conditions;
import org.eclipse.swtbot.swt.finder.waits.DefaultCondition;
import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -48,10 +53,18 @@ public class ExportJobTest extends TalendSwtBotForTos {
@Test
public void exportJob() throws IOException, URISyntaxException {
jobItem.getItem().contextMenu("Export Job").click();
gefBot.shell("Export Job").activate();
SWTBotShell shell = gefBot.shell("Export Job").activate();
gefBot.comboBoxWithLabel("To &archive file:").setText(
Utilities.getFileFromCurrentPluginSampleFolder("") + FILE_SEPARATOR + "output_job.zip");
gefBot.button("Finish").click();
try {
gefBot.waitUntil(Conditions.shellCloses(shell), 60000);
} catch (TimeoutException e) {
gefBot.toolbarButtonWithTooltip("Cancel Operation").click();
gefBot.waitUntil(Conditions.widgetIsEnabled(gefBot.button("Cancel")), 60000);
gefBot.button("Cancel").click();
Assert.fail(e.getMessage());
}
gefBot.waitUntil(new DefaultCondition() {