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_OPACITY_H 17 #define UI_TEST_OPACITY_H 18 19 #include "components/root_view.h" 20 #include "components/text_adapter.h" 21 #include "components/ui_arc_label.h" 22 #include "components/ui_button.h" 23 #include "components/ui_image_animator.h" 24 #include "components/ui_image_view.h" 25 #include "components/ui_label.h" 26 #include "components/ui_label_button.h" 27 #include "components/ui_list.h" 28 #include "components/ui_scroll_view.h" 29 #include "ui_test.h" 30 namespace OHOS { 31 class UITestOpacity : public UITest { 32 public: UITestOpacity()33 UITestOpacity() {} ~UITestOpacity()34 ~UITestOpacity() {} 35 void SetUp() override; 36 void TearDown() override; 37 const UIView* GetTestView() override; 38 39 /** 40 * @brief Test UILabel 41 */ 42 void UIKitOpacityTestUILabel001(); 43 44 /** 45 * @brief Test UILabel exception value 46 */ 47 void UIKitOpacityTestUILabel002(); 48 49 /** 50 * @brief Test UIButton 51 */ 52 void UIKitOpacityTestUIButton001(); 53 54 /** 55 * @brief Test UIButton image 56 */ 57 void UIKitOpacityTestUIButton002(); 58 59 /** 60 * @brief Test UILabelButton 61 */ 62 void UIKitOpacityTestUILabelButton001(); 63 64 /** 65 * @brief Test UIArcLabel 66 */ 67 void UIKitOpacityTestUIArcLabel001(); 68 69 /** 70 * @brief Test UIImageView 71 */ 72 void UIKitOpacityTestUIImageView001(); 73 74 /** 75 * @brief Test UIImageAnimator 76 */ 77 void UIKitOpacityTestUIImageAnimator001(); 78 79 /** 80 * @brief Test UIView 81 */ 82 void UIKitOpacityTestUIView001(); 83 84 /** 85 * @brief Test UIViewGroup 86 */ 87 void UIKitOpacityTestUIViewGroup001(); 88 89 /** 90 * @brief Test UIList 91 */ 92 void UIKitOpacityTestUIList001(); 93 94 /** 95 * @brief Test UIScrollView 96 */ 97 void UIKitOpacityTestUIScrollView001(); 98 99 /** 100 * @brief Test UISwipeView 101 */ 102 void UIKitOpacityTestUISwipeView001(); 103 104 private: 105 UIViewGroup* CreateTestCaseGroup(const char* title) const; 106 UILabel* CreateTestCaseUILabel(const char* title, uint8_t opaScale) const; 107 UIButton* CreateTestCaseUIButton(uint8_t opaScale) const; 108 UILabelButton* CreateTestCaseUILabelButton(const char* title, uint8_t opaScale) const; 109 UIArcLabel* CreateTestCaseUIArcLabel(const char* title, uint8_t opaScale) const; 110 UIImageView* CreateTestCaseUIImageView(const char* path, uint8_t opaScale) const; 111 UIImageAnimatorView* CreateTestCaseUIImageAnimator(const ImageAnimatorInfo imageAnimatorInfo[], 112 uint8_t opaScale) const; 113 UIView* CreateTestCaseUIView(uint8_t opaScale) const; 114 UIList* CreateTestCaseUIList(uint8_t opaScale) const; 115 116 UIScrollView* container_ = nullptr; 117 }; 118 } 119 #endif // UI_TEST_OPACITY_H 120