1 /* 2 * Copyright (c) 2022 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_EDIT_TEXT_H 17 #define UI_TEST_EDIT_TEXT_H 18 19 #include "common/input_method_manager.h" 20 #include "components/ui_edit_text.h" 21 #include "components/ui_label.h" 22 #include "components/ui_label_button.h" 23 #include "components/ui_scroll_view.h" 24 #include "ui_test.h" 25 26 namespace OHOS { 27 class UITestEditText : public UITest, public UIView::OnClickListener, public UIEditText::OnChangeListener { 28 public: UITestEditText()29 UITestEditText() {} ~UITestEditText()30 ~UITestEditText() {} 31 void SetUp() override; 32 void TearDown() override; 33 const UIView* GetTestView() override; 34 35 void UIKitUIEditTextTestDisplay001(); 36 37 bool OnClick(UIView& view, const ClickEvent& event) override; 38 void OnChange(UIView& view, const char* value) override; 39 40 private: 41 UIScrollView* container_ = nullptr; 42 UILabel* changeHint_ = nullptr; 43 UIEditText* SetupEditText(const char* value, const char* placeholder, const char* viewId); 44 }; 45 } // namespace OHOS 46 #endif // UI_TEST_EDIT_TEXT_H 47