use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotMultiPageEditor in project linuxtools by eclipse.
the class ImportRPMsPageTest method initializeImportPage.
/**
* Helper method to help setup the test by opening the .repo file.
*/
private void initializeImportPage() {
SWTBotMultiPageEditor editor = TestUtils.openRepoFile(bot, navigator);
// activate repository page
editor.activatePage(Messages.ImportRPMsPage_title);
// make sure correct page is active
assertEquals(Messages.ImportRPMsPage_title, editor.getActivePageTitle());
importPageBot = editor.bot();
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotMultiPageEditor in project linuxtools by eclipse.
the class MetadataPageTest method initializeMetadataPage.
/**
* Helper method to help setup the test by opening the .repo file.
*/
private void initializeMetadataPage() {
SWTBotMultiPageEditor editor = TestUtils.openRepoFile(bot, navigator);
// activate the metadata page
editor.activatePage(Messages.MetadataPage_title);
// make sure correct page is active
assertEquals(Messages.MetadataPage_title, editor.getActivePageTitle());
metadataPageBot = editor.bot();
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotMultiPageEditor in project linuxtools by eclipse.
the class RepoFormEditorTest method testFormEditorCreation.
/**
* Test if the multi page editor is properly created. Make sure there are 3
* pages (Repository, Metadata, repo file), and that all of them can be switched
* to.
*/
@Test
public void testFormEditorCreation() {
SWTBotMultiPageEditor editor = TestUtils.openRepoFile(bot, navigator);
// activate the pages to make sure they exist and work
editor.activatePage(Messages.MetadataPage_title);
editor.activatePage(ICreaterepoTestConstants.REPO_NAME);
editor.activatePage(Messages.ImportRPMsPage_title);
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotMultiPageEditor in project linuxtools by eclipse.
the class TestUtils method openRepoFile.
public static SWTBotMultiPageEditor openRepoFile(SWTWorkbenchBot bot, SWTBotView navigator) {
// open the package explorer view
SWTBotTree botTree = navigator.bot().tree();
botTree.select(ICreaterepoTestConstants.REPO_NAME).contextMenu(ICreaterepoTestConstants.OPEN).click();
// get a handle on the multipage editor that was opened
SWTBotMultiPageEditor editor = bot.multipageEditorByTitle(ICreaterepoTestConstants.REPO_NAME);
editor.show();
// 3 = repository form page, metadata form page, repo file
assertEquals(3, editor.getPageCount());
return editor;
}
use of org.eclipse.swtbot.eclipse.finder.widgets.SWTBotMultiPageEditor in project egit by eclipse.
the class CommitEditorTest method openAllEditorPagesOnValidCommit.
@Test
public void openAllEditorPagesOnValidCommit() throws Exception {
final AtomicReference<IEditorPart> editorRef = new AtomicReference<>();
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
RepositoryCommit repoCommit = new RepositoryCommit(repository, commit);
editorRef.set(CommitEditor.openQuiet(repoCommit));
}
});
assertNotNull(editorRef.get());
IEditorPart editor = editorRef.get();
assertTrue(editor instanceof CommitEditor);
RepositoryCommit adaptedCommit = Utils.getAdapter(editor, RepositoryCommit.class);
assertNotNull(adaptedCommit);
assertEquals(commit, adaptedCommit.getRevCommit());
assertEquals(repository.getDirectory(), adaptedCommit.getRepository().getDirectory());
IEditorInput input = editor.getEditorInput();
assertNotNull(input);
SWTBotMultiPageEditor botEditor = bot.multipageEditorByTitle(input.getName());
assertNotNull(botEditor);
assertTrue(botEditor.getPageCount() > 1);
for (String name : botEditor.getPagesTitles()) botEditor.activatePage(name);
botEditor.close();
}
Aggregations