Exemplo n.º 1
0
 public void AddMealTest()
 {
     Robot.ClickTabControl(MEAL_MANAMER);
     Robot.ClickButton(MEAL.AddNewMealButton.ToString());
     Robot.SetEdit(MEAL.MealNameTextBox.ToString(), "NewMeal");
     Robot.SetEdit(MEAL.MealPriceTextBox.ToString(), "999");
     Robot.SetComboBox(MEAL.MealCategoryComboBox.ToString(), "Beverage");
     Robot.ClickButton(MEAL.BrowseButton.ToString());
     Robot.SendKeyEnterToOpenFileDialog();
     Robot.ClickButton(MEAL.TriggerMealButton.ToString());
     Robot.AssertListViewItemByIndex(MEAL.MealListBox.ToString(), 29, "NewMeal");
 }
 private void RunScriptTestDataGridView()
 {
     Robot.ClickButton("Start the Cutomer Program (Frontend)");
     Robot.SetForm("POS-Customer Side");
     Robot.ClickButton("大麥克\n69元");
     Robot.ClickTabControl("點心");
     Robot.ClickButton("薯餅\n32元");
     Robot.ClickTabControl("飲料");
     Robot.ClickButton("冰奶茶(大)\n45元");
     Robot.ClickButton("冰奶茶(大)\n45元");
     Robot.ClickButton("orderMeal");
     Robot.DeleteDataGridViewRowByIndex("dataGridView", "4");
 }
Exemplo n.º 3
0
 public void TestCategory()
 {
     string[] openFileString = { "Resources", "dessert", "Apple-Pie_thumb5.png" };
     Robot.SetForm("StartUp");
     Robot.ClickButton("restaurant");
     Robot.SetForm("PosRestaurantSideForm");
     Robot.ClickTabControl("Category Manager");
     Robot.ClickButton("addCategoryButton");
     Robot.AssertButtonEnable("saveCategoryButton", false);
     Robot.SetEdit("categoryNameTextBox", "玩具\n");
     Robot.AssertButtonEnable("saveCategoryButton", true);
     Robot.ClickButton("saveCategoryButton");
 }
Exemplo n.º 4
0
        public void SelectTabControlTest()
        {
            int total = 0;

            Robot.ClickTabControl(CATEGORY.Dessert.ToString());
            Robot.ClickButton("月餅");
            total += 200;
            Robot.AssertDataGridViewByIndex(HOST.DataGridView.ToString(), "1", new string[] { "Delete", "月餅", "Dessert", "200", "1", "200" });
            Robot.ClickTabControl(CATEGORY.Hambugers.ToString());
            Robot.ClickButton("牛肉麵");
            total += 85;
            Robot.AssertDataGridViewByIndex(HOST.DataGridView.ToString(), "2", new string[] { "Delete", "牛肉麵", "Hambugers", "85", "1", "85" });
            Robot.AssertText(HOST.CostLabel.ToString(), string.Format("Total:{0}:NTD", total));
            Robot.AssertDataItemsInDataGridView(HOST.DataGridView.ToString(), 2);
        }
 private void RunScriptTestModifiedMeal()
 {
     Robot.ClickButton("Start the Cutomer Program (Frontend)");
     Robot.ClickButton("Start the Restaurant Program (Backend)");
     Robot.SetForm("POS-Customer Side");
     Robot.ClickButton("大麥克\n69元");
     Robot.ClickButton("orderMeal");
     Robot.SetForm("POS-Restaurant Side");
     Robot.ClickTabControl("Meal Manager");
     Robot.ClickListViewByValue("mealListBox", "大麥克");
     Robot.SetEdit("mealNameBox", "Bigmac");
     Robot.SetEdit("mealDescriptionBox", "Delicious bigmac!");
     Robot.SetEdit("mealPriceBox", "99");
     Robot.SetComboBox("mealCategoryBox", "點心");
     Robot.ClickButton("Browse");
     Robot.SelectFileByOpenFileDialog("開啟", new string[] { "temp.jpg" });
     Robot.ClickButton("mealSave");
     Robot.SetForm("POS-Customer Side");
 }
Exemplo n.º 6
0
 public void TestAddMeal()
 {
     Robot.SetForm("StartUp");
     Robot.ClickButton("client");
     Robot.SetForm("POS-Customer Side");
     Robot.ClickButton("orderButton1");
     Robot.ClickButton("addMeal");
     Robot.ClickButton("addMeal");
     Robot.AssertText("totalPriceLabel", "Total:178元");
     Robot.ClickButton("nextPage");
     Robot.ClickButton("orderButton2");
     Robot.ClickButton("addMeal");
     Robot.AssertText("totalPriceLabel", "Total:237元");
     Robot.ClickTabControl("甜點");
     Robot.ClickButton("orderButton1");
     Robot.ClickButton("addMeal");
     Robot.AssertText("totalPriceLabel", "Total:286元");
     Robot.DeleteDataGridViewRowByIndex("mealsListDataGridView", "1");
     Robot.AssertText("totalPriceLabel", "Total:108元");
 }
 private void RunScriptAllOrder()
 {
     Robot.ClickButton("Start the Cutomer Program (Frontend)");
     Robot.SetForm("POS-Customer Side");
     Robot.ClickButton("大麥克\n69元");
     Robot.ClickButton("雙層牛肉吉事堡\n59元");
     Robot.ClickButton("安格斯黑牛堡\n99元");
     Robot.ClickButton("嫩煎雞腿堡\n79元");
     Robot.ClickButton("麥香雞\n49元");
     Robot.ClickButton("麥克雞塊(6塊)\n59元");
     Robot.ClickButton("麥克雞塊(9塊)\n89元");
     Robot.ClickButton("勁辣雞腿堡\n69元");
     Robot.ClickButton("麥脆雞(2塊)\n104元");
     Robot.ClickButton("Next Page");
     Robot.ClickButton("麥脆雞(3塊)\n156元");
     Robot.ClickButton("黃金起司豬排堡\n49元");
     Robot.ClickButton("麥香魚\n49元");
     Robot.ClickButton("千島黃金蝦堡\n69元");
     Robot.ClickButton("BLT 安格斯黑牛堡\n109元");
     Robot.ClickButton("BLT 辣脆雞腿堡\n109元");
     Robot.ClickButton("orderMeal");
     Robot.ClickButton("Previous Page");
     Robot.ClickTabControl("點心");
     Robot.ClickButton("薯條(小包)\n32元");
     Robot.ClickButton("薯條(中包)\n42元");
     Robot.ClickButton("薯條(大包)\n55元");
     Robot.ClickButton("薯餅\n32元");
     Robot.ClickButton("蘋果派\n32元");
     Robot.ClickButton("水果袋\n39元");
     Robot.ClickButton("orderMeal");
     Robot.ClickTabControl("飲料");
     Robot.ClickButton("可口可樂(大)\n40元");
     Robot.ClickButton("雪碧(大)\n40元");
     Robot.ClickButton("冰紅茶(大)\n40元");
     Robot.ClickButton("冰綠茶(大)\n40元");
     Robot.ClickButton("冰奶茶(大)\n45元");
     Robot.ClickButton("柳橙汁(大)\n45元");
     Robot.ClickButton("orderMeal");
 }
Exemplo n.º 8
0
        private void AssertFinalHost()
        {
            int total = 0;

            Robot.ClickTabControl("Dessert");
            Robot.ClickButton("月餅");

            Robot.ClickTabControl("Beverage");
            Robot.ClickButton("ModifyMeal");

            Robot.ClickNumericUpDownButtonInDataGridView(HOST.DataGridView.ToString(), 0, 4, Robot.NumericDirect.UP, 3);
            Robot.AssertDataGridViewByIndex(HOST.DataGridView.ToString(), "1", new string[] { "Delete", "月餅", "Dessert", "200", "7", (200 * 7).ToString() });

            Robot.ClickNumericUpDownButtonInDataGridView(HOST.DataGridView.ToString(), 1, 4, Robot.NumericDirect.UP, 3);
            Robot.AssertDataGridViewByIndex(HOST.DataGridView.ToString(), "2", new string[] { "Delete", "ModifyMeal", "Beverage", "999", "8", (999 * 8).ToString() });

            Robot.ClickNumericUpDownButtonInDataGridView(HOST.DataGridView.ToString(), 0, 4, Robot.NumericDirect.DOWN, 1);
            Robot.AssertDataGridViewByIndex(HOST.DataGridView.ToString(), "1", new string[] { "Delete", "月餅", "Dessert", "200", "6", (200 * 6).ToString() });

            total += 200 * 6 + 999 * 8;
            Robot.AssertText(HOST.CostLabel.ToString(), string.Format("Total:{0}:NTD", total));
        }
Exemplo n.º 9
0
        private void HostScript()
        {
            int total = 0;

            Robot.ClickTabControl("Dessert");
            Robot.ClickButton("月餅");

            Robot.ClickTabControl("Hambugers");
            Robot.ClickButton("牛肉麵");

            Robot.ClickNumericUpDownButtonInDataGridView(HOST.DataGridView.ToString(), 0, 4, Robot.NumericDirect.UP, 3);
            Robot.AssertDataGridViewByIndex(HOST.DataGridView.ToString(), "1", new string[] { "Delete", "月餅", "Dessert", "200", "4", (200 * 4).ToString() });

            Robot.ClickNumericUpDownButtonInDataGridView(HOST.DataGridView.ToString(), 1, 4, Robot.NumericDirect.UP, 3);
            Robot.AssertDataGridViewByIndex(HOST.DataGridView.ToString(), "2", new string[] { "Delete", "牛肉麵", "Hambugers", "85", "4", (85 * 4).ToString() });

            Robot.ClickNumericUpDownButtonInDataGridView(HOST.DataGridView.ToString(), 0, 4, Robot.NumericDirect.DOWN, 1);
            Robot.AssertDataGridViewByIndex(HOST.DataGridView.ToString(), "1", new string[] { "Delete", "月餅", "Dessert", "200", "3", (200 * 3).ToString() });

            total = 200 * 3 + 85 * 4;
            Robot.AssertText(HOST.CostLabel.ToString(), string.Format("Total:{0}:NTD", total));
        }
 private void RunScriptTestAddMeal()
 {
     Robot.ClickButton("Start the Restaurant Program (Backend)");
     Robot.SetForm("POS-Restaurant Side");
     Robot.ClickTabControl("Meal Manager");
     Robot.ClickButton("addMeal");
     Robot.SetEdit("mealNameBox", "smallmac");
     Robot.SetEdit("mealDescriptionBox", "Delicious smallmac!");
     Robot.SetEdit("mealPriceBox", "19");
     Robot.SetComboBox("mealCategoryBox", "漢堡");
     Robot.ClickButton("Browse");
     Robot.SelectFileByOpenFileDialog("開啟", new string[] { "1.jpg" });
     Robot.ClickButton("mealSave");
     Robot.ClickListViewByValue("mealListBox", "大麥克");
     Robot.ClickButton("deleteMeal");
     Robot.CloseWindow("POS-Restaurant Side");
     Robot.SetForm("StartUp");
     Robot.ClickButton("Start the Cutomer Program (Frontend)");
     Robot.SetForm("POS-Customer Side");
     Robot.ClickButton("Next Page");
     Robot.ClickButton("smallmac\n19元");
     Robot.ClickButton("orderMeal");
 }
 private void RunScriptTestQTY()
 {
     Robot.SetDataGridViewQuantity("dataGridView", "3", "2");
     Robot.ClickTabControl("漢堡");
 }