use of org.eclipse.egit.ui.common.PushWizardTester in project egit by eclipse.
the class PushTest method testPush.
@Test
public void testPush() throws Exception {
// change file
TestUtil.appendFileContent(file, "additional content", true);
// commit change
try (Git git = new Git(localRepository)) {
git.add().addFilepattern(SampleTestRepository.A_txt_name).call();
git.commit().setMessage("Change").call();
}
configurePush();
// push change
PushWizardTester wizardTester = new PushWizardTester();
RepoPropertiesPage repoPropertiesPage = wizardTester.openPushWizard(localRepository);
repoPropertiesPage.setPushDestination("push");
wizardTester.nextPage();
// now login dialog appears
LoginDialogTester loginDialogTester = new LoginDialogTester();
loginDialogTester.login("agitter", "letmein");
RefSpecPageTester refSpecPageTester = new RefSpecPageTester();
refSpecPageTester.waitUntilPageIsReady(1);
wizardTester.finish();
loginDialogTester.login("agitter", "letmein");
PushResultDialogTester pushResultDialogTester = new PushResultDialogTester();
bot.waitUntil(shellIsActive("Push Results: push"));
String expectedMessage = "Repository " + remoteRepository.getUri();
pushResultDialogTester.assertResultMessage(expectedMessage);
pushResultDialogTester.closeDialog();
}
Aggregations