Fix UI Tests for Git Clone
[egit/spearce.git] / org.eclipse.egit.ui.test / src / org / eclipse / egit / ui / wizards / clone / WorkingCopyPage.java
blob2a627c570304c58af6758751643d33cfe4e8c35f
1 /*******************************************************************************
2 * Copyright (C) 2009, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2010, Ketan Padegaonkar <KetanPadegaonkar@gmail.com>
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * which accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
9 *******************************************************************************/
10 package org.eclipse.egit.ui.wizards.clone;
12 import static org.eclipse.swtbot.swt.finder.SWTBotAssert.assertText;
13 import static org.eclipse.swtbot.swt.finder.waits.Conditions.shellCloses;
15 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
16 import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell;
18 public class WorkingCopyPage {
20 private static final SWTWorkbenchBot bot = new SWTWorkbenchBot();
22 public void assertDirectory(String localDir) {
23 assertText(localDir, bot.textWithLabel("Directory:"));
26 public void assertBranch(String branch) {
27 assertText(branch, bot.comboBoxWithLabel("Initial branch:"));
30 public void assertRemoteName(String remoteName) {
31 assertText(remoteName, bot.textWithLabel("Remote name:"));
34 public void waitForCreate() {
35 bot.button("Finish").click();
37 // TODO: pass the repo url in via the constructor from the first page.
38 SWTBotShell shell = bot.shell("Cloning from git://repo.or.cz/egit.git");
40 // This is not a performance test. Allow lots of time to complete
41 bot.waitUntil(shellCloses(shell), 120000);
44 public void assertWorkingCopyExists() {
45 String dirName = bot.textWithLabel("Directory:").getText();
46 String message = " " + dirName + " is not an empty directory.";
47 // check if the text box exists
48 bot.text(message);
51 public void setRemoteName(String string) {
52 bot.textWithLabel("Remote name:").setText(string);
55 public void setDirectory(String string) {
56 bot.textWithLabel("Directory:").setText(string);