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_CIRCLE_PROGRESS_H 17 #define UI_TEST_CIRCLE_PROGRESS_H 18 19 #include "components/ui_circle_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 UITestCircleProgress : public UITest, public UIView::OnClickListener { 26 public: UITestCircleProgress()27 UITestCircleProgress() {} ~UITestCircleProgress()28 ~UITestCircleProgress() {} 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 UIKitCircleProgressTestUICircleProgress001(); 39 void UIKitCircleProgressTestSetValue002(); 40 void UIKitCircleProgressTestSetImage003(); 41 void UIKitCircleProgressTestSetStyle004(); 42 void UIKitCircleProgressTestGetStyle005(); 43 void UIKitCircleProgressTestSetCapType006(); 44 void UIKitCircleProgressTestSetStep007(); 45 void UIKitCircleProgressTestSetRange008(); 46 void UIKitCircleProgressTestEnableBackground009(); 47 void UIKitCircleProgressTestSetCenter010(); 48 void UIKitCircleProgressTestSetRadius011(); 49 void UIKitCircleProgressTestSetLineWidth012(); 50 void UIKitCircleProgressTestSetImagePosition013(); 51 void UIKitCircleProgressTestSetLineColor014(); 52 void UIKitCircleProgressTestSetAngle015(); 53 void UIKitCircleProgressTestHideRoundCap016(); 54 55 private: 56 UIScrollView* container_ = nullptr; 57 UIScrollView* scroll_ = nullptr; 58 UICircleProgress* circleProgress_ = nullptr; 59 UIViewGroup* uiViewGroupFrame_ = nullptr; 60 61 UILabelButton* resetBtn_ = 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* centerXBtn_ = nullptr; 69 UILabelButton* centerYBtn_ = nullptr; 70 UILabelButton* incRadiusBtn_ = nullptr; 71 UILabelButton* decRadiusBtn_ = nullptr; 72 UILabelButton* incWidthBtn_ = nullptr; 73 UILabelButton* decWidthBtn_ = nullptr; 74 UILabelButton* incStartAngleBtn_ = nullptr; 75 UILabelButton* decStartAngleBtn_ = nullptr; 76 UILabelButton* incEndAngleBtn_ = nullptr; 77 UILabelButton* decEndAngleBtn_ = nullptr; 78 UILabelButton* swapAngleBtn_ = nullptr; 79 UILabelButton* stepBtn_ = nullptr; 80 UILabelButton* imageBtn_ = nullptr; 81 UILabelButton* noImageBtn_ = nullptr; 82 UILabelButton* setStyleBtn_ = nullptr; 83 UILabelButton* getStyleBtn_ = nullptr; 84 UILabelButton* roundCapBtn_ = nullptr; 85 UILabelButton* noneCapBtn_ = nullptr; 86 UILabelButton* enableBgBtn_ = nullptr; 87 UILabelButton* disableBgBtn_ = nullptr; 88 UILabelButton* imgPosXBtn_ = nullptr; 89 UILabelButton* imgPosYBtn_ = nullptr; 90 UILabelButton* lineColorBtn_ = nullptr; 91 UILabelButton* showroundCap_ = nullptr; 92 UILabelButton* unshowroundCap_ = nullptr; 93 }; 94 } // namespace OHOS 95 #endif // UI_TEST_CIRCLE_PROGRESS_H 96