package StockTradeWindows;
import DisplayProject.DisplayProjectTestUtils;
import java.lang.String;
import org.fest.swing.core.ComponentFinder;
import org.fest.swing.fixture.FrameFixture;
import org.fest.swing.fixture.JButtonFixture;
import org.fest.swing.fixture.JTableFixture;
import org.fest.swing.fixture.JTextComponentFixture;
public class CustomerWindowWidgets {
public static JTextComponentFixture getqq_CustomerGrid_CustomerName(FrameFixture frame) {
return frame.textBox("CustomerName");
}
public static JTextComponentFixture enterCustomerGrid_CustomerName(FrameFixture frame, String value) {
return DisplayProjectTestUtils.setTextValue(getqq_CustomerGrid_CustomerName(frame), value);
}
public static JTextComponentFixture checkCustomerGrid_CustomerNameIs(FrameFixture frame, String value) {
return DisplayProjectTestUtils.checkTextValue(getqq_CustomerGrid_CustomerName(frame), value);
}
public static JTextComponentFixture getqq_CustomerGrid_PhoneNumber(FrameFixture frame) {
return frame.textBox("PhoneNumber");
}
public static JTextComponentFixture enterCustomerGrid_PhoneNumber(FrameFixture frame, String value) {
return DisplayProjectTestUtils.setTextValue(getqq_CustomerGrid_PhoneNumber(frame), value);
}
public static JTextComponentFixture checkCustomerGrid_PhoneNumberIs(FrameFixture frame, String value) {
return DisplayProjectTestUtils.checkTextValue(getqq_CustomerGrid_PhoneNumber(frame), value);
}
public static JTextComponentFixture getqq_CustomerGrid_CashBalance(FrameFixture frame) {
return frame.textBox("CashBalance");
}
public static JTextComponentFixture enterCustomerGrid_CashBalance(FrameFixture frame, String value) {
return DisplayProjectTestUtils.setTextValue(getqq_CustomerGrid_CashBalance(frame), value);
}
public static JTextComponentFixture checkCustomerGrid_CashBalanceIs(FrameFixture frame, String value) {
return DisplayProjectTestUtils.checkTextValue(getqq_CustomerGrid_CashBalance(frame), value);
}
public static JTableFixture getqq_CustomerGrid_HoldingList(FrameFixture frame) {
return frame.table("HoldingList");
}
public static JTextComponentFixture getqq_CustomerGrid_HoldingListArray_StockName(FrameFixture frame) {
return frame.textBox("StockName");
}
public static JTextComponentFixture enterCustomerGrid_HoldingListArray_StockName(FrameFixture frame, String value) {
return DisplayProjectTestUtils.setTextValue(getqq_CustomerGrid_HoldingListArray_StockName(frame), value);
}
public static JTextComponentFixture checkCustomerGrid_HoldingListArray_StockNameIs(FrameFixture frame, String value) {
return DisplayProjectTestUtils.checkTextValue(getqq_CustomerGrid_HoldingListArray_StockName(frame), value);
}
public static JTextComponentFixture getqq_CustomerGrid_HoldingListArray_Quantity(FrameFixture frame) {
return frame.textBox("Quantity");
}
public static JTextComponentFixture enterCustomerGrid_HoldingListArray_Quantity(FrameFixture frame, String value) {
return DisplayProjectTestUtils.setTextValue(getqq_CustomerGrid_HoldingListArray_Quantity(frame), value);
}
public static JTextComponentFixture checkCustomerGrid_HoldingListArray_QuantityIs(FrameFixture frame, String value) {
return DisplayProjectTestUtils.checkTextValue(getqq_CustomerGrid_HoldingListArray_Quantity(frame), value);
}
public static JTextComponentFixture getqq_CustomerGrid_HoldingListArray_Price(FrameFixture frame) {
return frame.textBox("Price");
}
public static JTextComponentFixture enterCustomerGrid_HoldingListArray_Price(FrameFixture frame, String value) {
return DisplayProjectTestUtils.setTextValue(getqq_CustomerGrid_HoldingListArray_Price(frame), value);
}
public static JTextComponentFixture checkCustomerGrid_HoldingListArray_PriceIs(FrameFixture frame, String value) {
return DisplayProjectTestUtils.checkTextValue(getqq_CustomerGrid_HoldingListArray_Price(frame), value);
}
public static JButtonFixture getqq_BuyBtn(FrameFixture frame) {
return frame.button("BuyBtn");
}
public static void clickBuyBtn(FrameFixture frame) {
DisplayProjectTestUtils.waitForIdle();
getqq_BuyBtn(frame).click();
}
public static JButtonFixture getqq_SellBtn(FrameFixture frame) {
return frame.button("SellBtn");
}
public static void clickSellBtn(FrameFixture frame) {
DisplayProjectTestUtils.waitForIdle();
getqq_SellBtn(frame).click();
}
public static JButtonFixture getqq_ExitBtn(FrameFixture frame) {
return frame.button("ExitBtn");
}
public static void clickExitBtn(FrameFixture frame) {
DisplayProjectTestUtils.waitForIdle();
getqq_ExitBtn(frame).click();
}
/** The name of the window */
public static final String cWINDOW_NAME = "CustomerWindow";
/**
* Return the FrameFixture corresponding to an instance of CustomerWindow
*/
public static FrameFixture getWindow(ComponentFinder finder) {
return DisplayProjectTestUtils.findFrameWithName(finder, cWINDOW_NAME);
}
/**
* Return the window which is a child of the passed frame which is an instance of CustomerWindow. This allows access
* to the underlying data models, in case it is desired to confirm that data entered in the windows is
* correctly mapped to the underlying model.
*/
public static CustomerWindow getActualWindow(FrameFixture frame) {
return (CustomerWindow)frame.target;
}
/**
* Find a CustomerWindow frame fixture which is a synchronous child of the passed parent window
* @param parentWin the parent window frame fixture which should have a CustomerWindow as a direct child.
* @return a frame fixture representing the CustomerWindow child
*/
public static FrameFixture getWindowAsChildOf(FrameFixture parentWin) {
return DisplayProjectTestUtils.findChildWithName(parentWin, cWINDOW_NAME);
}
public static FrameFixture getWindowAsAsyncChildOf(FrameFixture parentWin) {
FrameFixture frame = getWindow(parentWin.robot.finder());
DisplayProjectTestUtils.pushThreadForAsyncWindow(frame);
return frame;
}
}