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 constexpr char* UI_TEST_EDIT_TEXT_1 = "editName"; 28 constexpr char* UI_TEST_EDIT_TEXT_2 = "inputName"; 29 constexpr char* UI_TEST_EDIT_TEXT_3 = "editPwd"; 30 constexpr char* UI_TEST_EDIT_TEXT_4 = "inputPwd"; 31 constexpr char* UI_TEST_EDIT_TEXT_5 = "redPwd"; 32 class UITestEditText : public UITest, public UIView::OnClickListener, public UIEditText::OnChangeListener { 33 public: UITestEditText()34 UITestEditText() {} ~UITestEditText()35 ~UITestEditText() {} 36 void SetUp() override; 37 void TearDown() override; 38 const UIView* GetTestView() override; 39 40 void UIKitUIEditTextTestDisplay001(); 41 42 bool OnClick(UIView& view, const ClickEvent& event) override; 43 void OnChange(UIView& view, const char* value) override; 44 45 private: 46 UIScrollView* container_ = nullptr; 47 UILabel* changeHint_ = nullptr; 48 UIEditText* SetupEditText(const char* value, const char* placeholder, const char* viewId); 49 }; 50 } // namespace OHOS 51 #endif // UI_TEST_EDIT_TEXT_H 52