예제 #1
0
 public void RestaurantFormInitializeTest()
 {
     Robot.SetForm(RESTAURANT_SIDE_FORM_TEXT);
     Robot.ClickTabControl("Category Manager");
     Robot.AssertButtonEnable("ButtonDeleteCategory", false);
     Robot.AssertButtonEnable("ButtonSaveCategory", false);
     Robot.AssertButtonEnable("ButtonAddCategory", true);
 }
예제 #2
0
 public void RestaurantFormIntializeTest()
 {
     Robot.SetForm(RESTAURANT_SIDE_FORM_TEXT);
     Robot.AssertButtonEnable("ButtonDeleteMeal", false);
     Robot.AssertButtonEnable("ButtonBrowse", false);
     Robot.AssertButtonEnable("ButtonSaveMeal", false);
     Robot.ClickButton(BUTTON_ADD_MEAL);
 }
예제 #3
0
 public void RestaurantFormEditCategoryTest()
 {
     Robot.SetForm(RESTAURANT_SIDE_FORM_TEXT);
     Robot.ClickTabControl("Category Manager");
     Robot.ClickListViewByValue("ListBoxCategory", "壽司");
     Robot.SetEdit("TextBoxCategoryName", "修改餐點種類");
     Robot.ClickButton("ButtonSaveCategory");
     Robot.ClickListViewByValue("ListBoxCategory", "修改餐點種類");
     Robot.AssertEdit("TextBoxCategoryName", "修改餐點種類");
 }
예제 #4
0
 public void RestaurantFormAddCategoryTest()
 {
     Robot.SetForm(RESTAURANT_SIDE_FORM_TEXT);
     Robot.ClickTabControl("Category Manager");
     Robot.ClickButton("ButtonAddCategory");
     Robot.SetEdit("TextBoxCategoryName", "測試新增餐點");
     Robot.ClickButton("ButtonSaveCategory");
     Robot.AssertButtonEnable("ButtonSaveCategory", false);
     Robot.ClickListViewByValue("ListBoxCategory", "測試新增餐點");
     Robot.AssertEdit("TextBoxCategoryName", "測試新增餐點");
     Robot.ClickButton("ButtonDeleteCategory");
 }
예제 #5
0
 public void StartUpFormTest()
 {
     Robot.ClickButton(START_CUSTOMER_FORM);
     Robot.SetForm(CUSTOMER_SIDE_FORM_TEXT);
     Robot.AssertButtonEnable(BUTTON_START_CUSTOMER, false);
     Robot.CloseWindow(CUSTOMER_SIDE_FORM_TEXT);
     Robot.SetForm(START_UP_FORM_TEXT);
     Robot.ClickButton(START_RESTAURANT_FORM);
     Robot.AssertButtonEnable(BUTTON_START_RESTAURANT, false);
     Robot.CloseWindow(RESTAURANT_SIDE_FORM_TEXT);
     Robot.ClickButton(BUTTON_EXIT);
     // 若要為這個測試產生程式碼,請在捷徑功能表上選取 [產生自動程式化 UI 測試的程式碼],並選取其中一個功能表項目。
 }
예제 #6
0
 public void RestaurantFormAddMealTest()
 {
     Robot.SetForm(RESTAURANT_SIDE_FORM_TEXT);
     Robot.ClickButton("ButtonAddNewMeal");
     Robot.SetEdit("TextBoxMealName", "新增餐點");
     Robot.SetEdit("TextBoxMealPrice", "70");
     Robot.SetEdit("ComboBoxCategory", "飲料");
     Robot.ClickButton("ButtonBrowse");
     Robot.SelectFileByOpenFileDialog(OPEN_FILE_TITLE, OPEN_FILE_PATH.Trim('/').Split('/'));
     Robot.SetEdit(TEXT_BOX_MEAL_DESCRIPTION, TEXT_BOX_MEAL_DESCRIPTION_VALUE);
     Robot.ClickButton("ButtonSaveMeal");
     Robot.ClickListViewByValue(LIST_BOX_MEALS, "新增餐點");
     Robot.AssertEdit(TEXT_BOX_MEAL_NAME, "新增餐點");
     Robot.AssertEdit(TEXT_BOX_MEAL_PRICE, "70");
     Robot.AssertEdit("ComboBoxCategory", "飲料");
     Robot.AssertEdit("TextBoxPath", "/Resources/Assets/Sushi/4.jpg");
 }
예제 #7
0
        public void CustomerSideInitializeTest()
        {
            Robot.SetForm(CUSTOMER_SIDE_FORM_TEXT);
            Robot.AssertText(LABEL_PAGE_NAME, LABEL_PAGE_TEXT_1_2);
            Robot.ClickButton(BUTTON_NEXT_PAGE);
            Robot.AssertText(LABEL_PAGE_NAME, LABEL_PAGE_TEXT_2_2);
            Robot.ClickButton(BUTTON_PREVIOUS_PAGE);
            Robot.AssertText(LABEL_PAGE_NAME, LABEL_PAGE_TEXT_1_2);
            Robot.ClickTabControl(TAB_CONTROL_DESSERT);
            Robot.AssertText(LABEL_PAGE_NAME, LABEL_PAGE_TEXT_1_1);
            Robot.ClickButton(BUTTON_MEAL_2);
            Robot.AssertEdit(RICH_TEXTBOX, RICH_TEXTBOX_VALUE);
            Robot.ClickButton(BUTTON_ADD);
            Robot.AssertDataGridViewByIndex(DATA_GRID_VIEW_NAME, 1.ToString(), _stringMeal);

            Robot.CloseWindow(CUSTOMER_SIDE_FORM_TEXT);
        }
예제 #8
0
 public void CustomerSideDataGridViewTest()
 {
     Robot.SetForm(CUSTOMER_SIDE_FORM_TEXT);
     Robot.ClickButton(BUTTON_MEAL_1);
     Robot.ClickButton(BUTTON_ADD);
     Robot.ClickButton(BUTTON_MEAL_2);
     Robot.ClickButton(BUTTON_ADD);
     Robot.ClickButton(BUTTON_MEAL_7);
     Robot.ClickButton(BUTTON_ADD);
     Robot.ClickTabControl(TAB_CONTROL_DESSERT);
     Robot.ClickButton(BUTTON_MEAL_2);
     Robot.AssertEdit(RICH_TEXTBOX, RICH_TEXTBOX_VALUE);
     Robot.ClickButton(BUTTON_ADD);
     Robot.ClickTabControl(TAB_CONTROL_DRINKS);
     Robot.ClickButton(BUTTON_MEAL_3);
     Robot.ClickButton(BUTTON_ADD);
     Robot.ClickButton(BUTTON_MEAL_1);
     Robot.ClickButton(BUTTON_ADD);
     Robot.AssertDataGridViewByIndex(DATA_GRID_VIEW_NAME, 4.ToString(), _stringMeal);
     Robot.AssertText(LABEL_TOTAL_PRICE, LABEL_TOTAL_PRICE_1);
     Robot.SetDataGridViewQuantity(DATA_GRID_VIEW_NAME, 4.ToString(), 5.ToString());
     Robot.DeleteDataGridViewRowByIndex(DATA_GRID_VIEW_NAME, 2.ToString());
     Robot.AssertText(LABEL_TOTAL_PRICE, LABEL_TOTAL_PRICE_2);
 }