本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotButton.click方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotButton.click方法的具体用法?Java SWTBotButton.click怎么用?Java SWTBotButton.click使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swtbot.swt.finder.widgets.SWTBotButton
的用法示例。
在下文中一共展示了SWTBotButton.click方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateRun
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
public void validateRun (String configurationName,String projectName,String filepath,boolean printUnvisited,boolean verbose,String startElement,String generator) {
SWTBotShell shell = openExistingRun (configurationName);
SWTBotText projectText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_PROJECT);
assertEquals("Wrong project name",projectName,projectText.getText());
SWTBotText modelText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_MODEL);
assertEquals("Wrong model name",filepath,modelText.getText());
SWTBotCheckBox verboseButton = shell.bot().checkBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_BUTTON_ID_VERBOSE);
assertEquals("Wrong verbose value",verbose,verboseButton.isChecked());
SWTBotCheckBox unvisitedButton = shell.bot().checkBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_BUTTON_ID_PRINT_UNVISITED);
assertEquals("Wrong verbose value",verbose,unvisitedButton.isChecked());
SWTBotText startElementText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_START_ELEMENT);
assertEquals("Wrong start element",startElement,startElementText.getText());
SWTBotCombo generatorCombo = shell.bot().comboBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_COMBO_PATH_GENERATOR_ID_MODEL);
assertEquals("Wrong generator value",generator,generatorCombo.getText());
SWTBotButton closeButton = bot.button("Close");
closeButton.click();
bot.waitUntil(Conditions.shellCloses(shell));
}
示例2: createTag
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
private ESPathQuery createTag() throws ESException {
ESPrimaryVersionSpec baseVersion = localProject.getBaseVersion();
createPlayerAndCommit();
ESPathQuery pathQuery = ESHistoryQuery.FACTORY
.pathQuery(baseVersion, localProject.getBaseVersion(), true, true);
List<ESHistoryInfo> historyInfos = localProject.getHistoryInfos(pathQuery, new NullProgressMonitor());
assertEquals(2, historyInfos.size());
final ESHistoryInfo historyInfo = historyInfos.get(1);
assertEquals(2, historyInfo.getTagSpecs().size());
UIThreadRunnable.asyncExec(
new VoidResult() {
public void run() {
UIAddTagController addTagController = new UIAddTagController(bot.getDisplay().getActiveShell(),
localProject, historyInfo);
addTagController.execute();
}
});
bot.table(0).select(0);
SWTBotButton button = bot.button("OK");
button.click();
return pathQuery;
}
示例3: prepareconvertTo
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
public boolean prepareconvertTo(String project, String packageRootFragment, String pkg, String targetFilename,
String targetFormat, String checkTestBox,String annotationStartElement,
String targetvertex,String startElement,String [] contexts, String... nodes) {
ConvertDialog cd = prepareConvertTo(project, packageRootFragment, pkg, targetFilename, targetFormat, nodes);
boolean ret = cd.create(project, packageRootFragment, pkg, targetFilename, targetFormat, checkTestBox, false);
if (!ret) {
SWTBotShell shell = bot.shell("GW4E Conversion File");
shell.bot().button("Cancel").click();
bot.waitUntil(Conditions.shellCloses(shell));
return false;
}
SWTBotButton fbutton = bot.button("Next >");
fbutton.click();
GraphWalkerTestUIPageTest gwid = new GraphWalkerTestUIPageTest(cd.getShell());
gwid.completeFullPage("random(edge_coverage(100))", "GROUP1;GROUP2", annotationStartElement);
gwid.nextPage();
JUnitGraphWalkerTestUIPageTest jugw = new JUnitGraphWalkerTestUIPageTest(cd.getShell());
jugw.completeFullPage(targetvertex, startElement, contexts);
jugw.nextPage();
GraphWalkerTestHookPageTest gwth = new GraphWalkerTestHookPageTest(cd.getShell());
gwth.completeFullPage();
gwth.finish();
bot.waitUntil(Conditions.shellCloses(cd.getShell()), 6 * SWTBotPreferences.TIMEOUT);
return true;
}
示例4: assertNextStepPage
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
public void assertNextStepPage(SWTBotShell page, String description, String result) {
SWTBotButton nextButton = bot.button("&Next >");
nextButton.click();
String defaultResult = MessageUtil.getString("enter_a_result_if_verification_failed");
if (result != null && result.trim().length() > 0 && !result.equals(defaultResult)) {
new StepPage().setResult(page, result).setFailed(page);
}
new StepPage().assertActionAndResult(page, description, result);
}
示例5: feed
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
public void feed(boolean exportAsTest, String workbookfile, String workbooktitle, String caseid, boolean updatemode,
String componentname, String priority, String dateformat) {
SWTBotButton nextButton = bot.button("&Next >");
nextButton.click();
SavePage page = new SavePage();
page.feed(exportAsTest, workbookfile, workbooktitle, caseid, updatemode, componentname, priority, dateformat);
}
示例6: create
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
public boolean create (String project,String packageRootFragment, String pkg,String targetFilename,String targetFormat,String checkTestBox,boolean finish) {
try {
prepare (project,packageRootFragment,pkg,targetFilename,targetFormat, checkTestBox);
if (!finish) return true;
SWTBotButton fbutton = bot.button("Finish");
fbutton.click();
bot.waitUntil(Conditions.shellCloses(this.shell), 10 * SWTBotPreferences.TIMEOUT);
return true;
} catch (TimeoutException e) {
return false;
}
}
示例7: ok
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
public void ok ( ) {
String name="OK";
if (GW4EPlatform.isEclipse47()) {
name = "Apply and Close";
}
SWTBotButton button = shell.bot().button(name);
button.click();
parentBot.waitUntil(Conditions.shellCloses(shell));
}
示例8: importProjectFromZip
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
public static void importProjectFromZip(SWTWorkbenchBot bot, String path) {
int timeout = 10000;
bot.menu("File").menu("Import...").click();
bot.waitUntil(Conditions.shellIsActive("Import"));
SWTBotShell shell = bot.shell("Import").activate();
shell.bot().tree().expandNode("General").select("Existing Projects into Workspace");
shell.bot().button("Next >").click();
shell.bot().radio("Select archive file:").click();
shell.bot().comboBox(1).setText(path);
shell.bot().comboBox(1).pressShortcut(SWT.CR, SWT.LF);
SWTBotButton finishButton = shell.bot().button("Finish");
ICondition buttonEnabled = new DefaultCondition() {
@Override
public boolean test() throws Exception {
return finishButton.isEnabled();
}
@Override
public String getFailureMessage() {
return "Finish button not enabled";
}
};
shell.bot().waitUntil(buttonEnabled, timeout);
finishButton.click();
bot.waitUntil(Conditions.shellCloses(shell), timeout);
}
示例9: addRowValue
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
void addRowValue(final String stringtoadd) {
SWTBotTable table = getTable();
bot.waitUntil(waitForTable());
int currentCount = table.rowCount();
SWTBotButton addButton = getAddButton();
addButton.click();
waitForRowAdded(table, currentCount + 1);
int row = 0;
editRowWithValue (table,MessageUtil.getString("enteranewvalue"), stringtoadd);
leaveEditingCellClickingOnAnotherCell(table, row + 1);
waitForExpectedValueAtRowCol(table,stringtoadd);
}
示例10: removeRow
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
void removeRow( String stringtoremove) {
SWTBotTable table = getTable();
bot.waitUntil(waitForTable());
selectRowWithValue(table,stringtoremove);
waitForExpectedValueAtRowCol(table,stringtoremove);
int currentCount = table.rowCount();
SWTBotButton removeButton = getRemoveButton();
removeButton.click();
waitForRowAdded(table, currentCount - 1);
waitForNotExpectedValueAtRowCol(table,stringtoremove);
}
示例11: shareProject
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
private void shareProject() {
final ESShareObserver observer = createShareObserver();
ESWorkspaceProviderImpl.getInstance();
ESWorkspaceProviderImpl.getObserverBus().register(observer);
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
final UIShareProjectController shareProjectController = new UIShareProjectController(
bot.getDisplay().getActiveShell(),
localProject);
shareProjectController.execute();
}
});
bot.waitUntil(new DefaultCondition() {
// BEGIN SUPRESS CATCH EXCEPTION
public boolean test() throws Exception {
return didShare;
}
// END SUPRESS CATCH EXCEPTION
public String getFailureMessage() {
return "Share did not succeed.";
}
}, timeout());
final SWTBotButton confirmButton = bot.button("OK");
confirmButton.click();
ESWorkspaceProviderImpl.getInstance();
ESWorkspaceProviderImpl.getObserverBus().unregister(observer);
}
示例12: createLocalProject
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
private void createLocalProject() {
final int localProjectsSize = ESWorkspaceProvider.INSTANCE.getWorkspace().getLocalProjects().size();
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
final UICreateLocalProjectController localProjectController = new UICreateLocalProjectController(
bot.getDisplay().getActiveShell());
localProject = localProjectController.execute();
}
});
final SWTBotText text = bot.text(0);
text.setText("quux");
final SWTBotButton button = bot.button("OK");
button.click();
bot.waitUntil(new DefaultCondition() {
// BEGIN SUPRESS CATCH EXCEPTION
public boolean test() throws Exception {
return localProjectsSize + 1 == ESWorkspaceProvider.INSTANCE.getWorkspace().getLocalProjects().size();
}
// END SURPRESS CATCH EXCEPTION
public String getFailureMessage() {
return "Create local project did not succeed.";
}
});
}
示例13: testController
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
@Override
@Test
public void testController() throws ESException {
final int remoteProjectsSize = server.getRemoteProjects(usersession).size();
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
createRemoteProjectController = new UICreateRemoteProjectController(
bot.getDisplay().getActiveShell(),
usersession);
createRemoteProjectController.execute();
}
});
final SWTBotText text = bot.text(0);
text.setText("foo");
final SWTBotButton okButton = bot.button("OK");
okButton.click();
bot.waitUntil(new DefaultCondition() {
// BEGIN SUPRESS CATCH EXCEPTION
public boolean test() throws Exception {
return server.getRemoteProjects(usersession).size() == remoteProjectsSize + 1;
}
// END SUPRESS CATCH EXCEPTION
public String getFailureMessage() {
return "Create remote project did not succeed.";
}
}, timeout());
assertEquals(remoteProjectsSize + 1, server.getRemoteProjects(usersession).size());
}
示例14: commit
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
protected void commit(final ESLocalProject localProject) {
final ESPrimaryVersionSpec baseVersion = localProject.getBaseVersion();
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
ESUIControllerFactory.INSTANCE.commitProject(
bot.getDisplay().getActiveShell(),
localProject);
}
});
final SWTBotButton buttonWithLabel = bot.button("OK");
buttonWithLabel.click();
bot.waitUntil(new DefaultCondition() {
// BEGIN SUPRESS CATCH EXCEPTION
public boolean test() throws Exception {
return baseVersion.getIdentifier() + 1 == localProject.getBaseVersion()
.getIdentifier();
}
// END SUPRESS CATCH EXCEPTION
public String getFailureMessage() {
return "Commit did not succeed.";
}
}, AllUITests.TIMEOUT);
assertEquals(baseVersion.getIdentifier() + 1,
localProject.getBaseVersion().getIdentifier());
}
示例15: login
import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入方法依赖的package包/类
private void login() {
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
loginSessionController = new UILoginSessionController(
bot.getDisplay().getActiveShell(),
server);
loginSessionController.execute();
}
});
final SWTBotButton okButton = bot.button("OK");
okButton.click();
assertNotNull(server.getLastUsersession());
usersession = server.getLastUsersession();
}