1 /* 2 * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef UI_TEST_BOX_PROGRESS_H 17 #define UI_TEST_BOX_PROGRESS_H 18 19 #include "components/ui_box_progress.h" 20 #include "components/ui_label_button.h" 21 #include "components/ui_scroll_view.h" 22 #include "ui_test.h" 23 24 namespace OHOS { 25 class UITestBoxProgress : public UITest, public UIView::OnClickListener { 26 public: UITestBoxProgress()27 UITestBoxProgress() {} ~UITestBoxProgress()28 ~UITestBoxProgress() {} 29 void SetUp() override; 30 void TearDown() override; 31 const UIView* GetTestView() override; 32 33 void SetUpButton(UILabelButton* btn, const char* title, int16_t x, int16_t y); 34 void SetUpLabel(const char* title, int16_t x, int16_t y) const; 35 36 bool OnClick(UIView& view, const ClickEvent& event) override; 37 38 void UIKitBoxProgressTestUIBoxProgress001(); 39 void UIKitBoxProgressTestSetRange002(); 40 void UIKitBoxProgressTestSetValue003(); 41 void UIKitBoxProgressTestSetImage004(); 42 void UIKitBoxProgressTestSetStyle005(); 43 void UIKitBoxProgressTestGetStyle006(); 44 void UIKitBoxProgressTestSetCapType007(); 45 void UIKitBoxProgressTestSetDirection008(); 46 void UIKitBoxProgressTestEnableBackground009(); 47 void UIKitBoxProgressTestSetStep010(); 48 void UIKitBoxProgressTestSetValidSize011(); 49 void UIKitBoxProgressTestSetBorderAndPadding012(); 50 51 private: 52 UIScrollView* container_ = nullptr; 53 UIScrollView* scroll_ = nullptr; 54 UIBoxProgress* boxProgress_ = nullptr; 55 UIViewGroup* uiViewGroupFrame_ = nullptr; 56 57 UILabelButton* resetBtn_ = nullptr; 58 UILabelButton* incWidthBtn_ = nullptr; 59 UILabelButton* incHeightBtn_ = nullptr; 60 UILabelButton* decWidthBtn_ = nullptr; 61 UILabelButton* decHeightBtn_ = nullptr; 62 UILabelButton* incProgressBtn_ = nullptr; 63 UILabelButton* decProgressBtn_ = nullptr; 64 UILabelButton* incMinProgressBtn_ = nullptr; 65 UILabelButton* decMinProgressBtn_ = nullptr; 66 UILabelButton* incMaxProgressBtn_ = nullptr; 67 UILabelButton* decMaxProgressBtn_ = nullptr; 68 UILabelButton* stepBtn_ = nullptr; 69 UILabelButton* dirL2RBtn_ = nullptr; 70 UILabelButton* dirR2LBtn_ = nullptr; 71 UILabelButton* dirT2BBtn_ = nullptr; 72 UILabelButton* dirB2TBtn_ = nullptr; 73 UILabelButton* imageBtn_ = nullptr; 74 UILabelButton* noImageBtn_ = nullptr; 75 UILabelButton* setStyleBtn_ = nullptr; 76 UILabelButton* getStyleBtn_ = nullptr; 77 UILabelButton* roundCapBtn_ = nullptr; 78 UILabelButton* noneCapBtn_ = nullptr; 79 UILabelButton* enableBgBtn_ = nullptr; 80 UILabelButton* disableBgBtn_ = nullptr; 81 UILabelButton* borderIncBtn_ = nullptr; 82 UILabelButton* borderDecBtn_ = nullptr; 83 UILabelButton* paddingLeftIncBtn_ = nullptr; 84 UILabelButton* paddingRightIncBtn_ = nullptr; 85 UILabelButton* paddingTopIncBtn_ = nullptr; 86 UILabelButton* paddingBottomIncBtn_ = nullptr; 87 }; 88 } // namespace OHOS 89 #endif // UI_TEST_BOX_PROGRESS_H 90