diff --git a/test/uitest/test_chart/ui_test_chart_pillar.cpp b/test/uitest/test_chart/ui_test_chart_pillar.cpp index 1cbdc5d5e277f0766e9e1ef4c671aaddab7ae057..1b87006e8ddcf69be91ae1441375798aee1a3b44 100644 --- a/test/uitest/test_chart/ui_test_chart_pillar.cpp +++ b/test/uitest/test_chart/ui_test_chart_pillar.cpp @@ -121,22 +121,22 @@ void UITestChartPillar::UIKit_ChartPillar_Test_AddDataSerial_001() positionY_ = lastY_ + 10; // 10: increase y-coordinate positionX_ = 48; // 48: x-coordinate - SetUpButton(addDataSerialBtn_, "添加数据 "); + SetUpButton(addDataSerialBtn_, "添加数据 ", UI_TEST_ADD_DATA); positionX_ = addDataSerialBtn_->GetX() + addDataSerialBtn_->GetWidth() + g_blank; positionY_ = addDataSerialBtn_->GetY(); - SetUpButton(deleteDataSerialBtn_, "删除数据 "); + SetUpButton(deleteDataSerialBtn_, "删除数据 ", UI_TEST_DELETE_DATA); positionX_ = deleteDataSerialBtn_->GetX() + deleteDataSerialBtn_->GetWidth() + g_blank; positionY_ = deleteDataSerialBtn_->GetY(); - SetUpButton(clearDataSerialBtn_, "清空数据 "); + SetUpButton(clearDataSerialBtn_, "清空数据 ", UI_TEST_CLEAR_DATA); } void UITestChartPillar::UIKit_ChartPillar_Test_EnableReverse_002() { reverseBtn_ = new UILabelButton(); positionX_ = 48; // 48: x-coordinate - SetUpButton(reverseBtn_, "翻转 "); + SetUpButton(reverseBtn_, "翻转 ", UI_TEST_FLIP); } void UITestChartPillar::UIKit_ChartPillar_Test_SetAxisLineColor_003() @@ -144,7 +144,7 @@ void UITestChartPillar::UIKit_ChartPillar_Test_SetAxisLineColor_003() setAxisColorBtn_ = new UILabelButton(); positionX_ = reverseBtn_->GetX() + reverseBtn_->GetWidth() + g_blank; positionY_ = reverseBtn_->GetY(); - SetUpButton(setAxisColorBtn_, "坐标轴颜色 "); + SetUpButton(setAxisColorBtn_, "坐标轴颜色 ", UI_TEST_AXIS_COLOR); } void UITestChartPillar::UIKit_ChartPillar_Test_SetAxisLineVisible_004() @@ -152,7 +152,7 @@ void UITestChartPillar::UIKit_ChartPillar_Test_SetAxisLineVisible_004() setAxisVisibleBtn_ = new UILabelButton(); positionX_ = setAxisColorBtn_->GetX() + setAxisColorBtn_->GetWidth() + g_blank; positionY_ = setAxisColorBtn_->GetY(); - SetUpButton(setAxisVisibleBtn_, "坐标轴不可见"); + SetUpButton(setAxisVisibleBtn_, "坐标轴不可见", UI_TEST_AXIS_NOT_VISIBLE); } bool UITestChartPillar::OnClick(UIView& view, const ClickEvent& event) @@ -194,9 +194,9 @@ bool UITestChartPillar::OnClick(UIView& view, const ClickEvent& event) return true; } -void UITestChartPillar::SetUpButton(UILabelButton* btn, const char* title) +void UITestChartPillar::SetUpButton(UILabelButton* btn, const char* title, const char* id) { - if (btn == nullptr) { + if (btn == nullptr || title == nullptr || id == nullptr) { return; } container_->Add(btn); @@ -211,6 +211,7 @@ void UITestChartPillar::SetUpButton(UILabelButton* btn, const char* title) btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(id); container_->Invalidate(); } diff --git a/test/uitest/test_chart/ui_test_chart_pillar.h b/test/uitest/test_chart/ui_test_chart_pillar.h index 7fb3058f6729569aa8fc92794ad7fc322787cd89..51bdecb0d38596c7e19ed1165e44593e81daf064 100644 --- a/test/uitest/test_chart/ui_test_chart_pillar.h +++ b/test/uitest/test_chart/ui_test_chart_pillar.h @@ -23,6 +23,13 @@ #include "ui_test.h" namespace OHOS { +constexpr char* UI_TEST_ADD_DATA = "add_data"; +constexpr char* UI_TEST_DELETE_DATA = "delete_data"; +constexpr char* UI_TEST_CLEAR_DATA = "clear_data"; +constexpr char* UI_TEST_FLIP = "flip"; +constexpr char* UI_TEST_AXIS_COLOR = "axis_color"; +constexpr char* UI_TEST_AXIS_NOT_VISIBLE = "axis_not_visible"; + class UITestChartPillar : public UITest, public UIView::OnClickListener { public: UITestChartPillar() : dataSerial_() {} @@ -31,7 +38,7 @@ public: void TearDown() override; const UIView* GetTestView() override; - void SetUpButton(UILabelButton* btn, const char* title); + void SetUpButton(UILabelButton* btn, const char* title, const char* id); bool OnClick(UIView& view, const ClickEvent& event) override; diff --git a/test/uitest/test_chart/ui_test_chart_polyline.cpp b/test/uitest/test_chart/ui_test_chart_polyline.cpp index 94675b5d18e71a29d130c06d29da5897d0f74c7a..04d554037a62d4b8408774bd67fb242178ea7fe4 100644 --- a/test/uitest/test_chart/ui_test_chart_polyline.cpp +++ b/test/uitest/test_chart/ui_test_chart_polyline.cpp @@ -150,29 +150,29 @@ void UITestChartPolyline::UIKit_ChartPolyline_Test_AddDataSerial_001() positionX_ = VIEW_DISTANCE_TO_LEFT_SIDE; positionY_ = lastY_ + 10; // 10: increase y-coordinate - SetUpButton(addDataSerialBtn_, "添加数据 "); + SetUpButton(addDataSerialBtn_, "添加数据 ", UI_TEST_POLYLINE_ADD_DATA); positionX_ = addDataSerialBtn_->GetX() + addDataSerialBtn_->GetWidth() + g_blank; positionY_ = addDataSerialBtn_->GetY(); - SetUpButton(deleteDataSerialBtn_, "删除数据 "); + SetUpButton(deleteDataSerialBtn_, "删除数据 ", UI_TEST_POLYLINE_DELETE_DATA); positionX_ = deleteDataSerialBtn_->GetX() + deleteDataSerialBtn_->GetWidth() + g_blank; positionY_ = deleteDataSerialBtn_->GetY(); - SetUpButton(clearDataSerialBtn_, "清空数据 "); + SetUpButton(clearDataSerialBtn_, "清空数据 ", UI_TEST_POLYLINE_CLEAR_DATA); positionX_ = VIEW_DISTANCE_TO_LEFT_SIDE; - SetUpButton(topPointBtn_, "最高点 "); + SetUpButton(topPointBtn_, "最高点 ", UI_TEST_POLYLINE_HIGHESET_POINT); positionX_ = topPointBtn_->GetX() + topPointBtn_->GetWidth() + g_blank; positionY_ = topPointBtn_->GetY(); - SetUpButton(bottomPointBtn_, "最低点 "); + SetUpButton(bottomPointBtn_, "最低点 ", UI_TEST_POLYLINE_LOWEST_POINT); positionX_ = bottomPointBtn_->GetX() + bottomPointBtn_->GetWidth() + g_blank; positionY_ = bottomPointBtn_->GetY(); - SetUpButton(headPointBtn_, "最新点 "); + SetUpButton(headPointBtn_, "最新点 ", UI_TEST_POLYLINE_NEW_POINT); } void UITestChartPolyline::UIKit_ChartPolyline_Test_EnableReverse_002() { reverseBtn_ = new UILabelButton(); positionX_ = VIEW_DISTANCE_TO_LEFT_SIDE; - SetUpButton(reverseBtn_, "翻转 "); + SetUpButton(reverseBtn_, "翻转 ", UI_TEST_POLYLINE_FLIP); SetLastPos(reverseBtn_); } @@ -181,7 +181,7 @@ void UITestChartPolyline::UIKit_ChartPolyline_Test_SetGradientBottom_003() gradientBottomBtn_ = new UILabelButton(); positionX_ = reverseBtn_->GetX() + reverseBtn_->GetWidth() + g_blank; positionY_ = reverseBtn_->GetY(); - SetUpButton(gradientBottomBtn_, "填充底部位置 "); + SetUpButton(gradientBottomBtn_, "填充底部位置 ", UI_TEST_POLYLINE_FILL_BOTTOM); SetLastPos(gradientBottomBtn_); } namespace { @@ -307,15 +307,15 @@ void UITestChartPolyline::UIKit_ChartPolyline_Test_AddPoints_004() // 2: half of screen width positionX_ = Screen::GetInstance().GetWidth() / 2 + VIEW_DISTANCE_TO_LEFT_SIDE; positionY_ = lastY_ + 10; // 10: increase y-coordinate - SetUpButton(addPointsBtn_, "添加点 "); + SetUpButton(addPointsBtn_, "添加点 ", UI_TEST_POLYLINE_ADD_POINT); positionX_ = addPointsBtn_->GetX() + addPointsBtn_->GetWidth() + g_blank; positionY_ = addPointsBtn_->GetY(); - SetUpButton(smoothBtn_, "平滑化 "); + SetUpButton(smoothBtn_, "平滑化 ", UI_TEST_POLYLINE_SMOOTHING); positionX_ = smoothBtn_->GetX() + smoothBtn_->GetWidth() + g_blank; positionY_ = smoothBtn_->GetY(); - SetUpButton(hidePointsBtn_, "隐藏点 "); + SetUpButton(hidePointsBtn_, "隐藏点 ", UI_TEST_POLYLINE_HIDE_POINT); } bool UITestChartPolyline::OnClick(UIView& view, const ClickEvent& event) @@ -384,9 +384,9 @@ bool UITestChartPolyline::ClickExpand(UIView& view, UIChartDataSerial::PointStyl return true; } -void UITestChartPolyline::SetUpButton(UILabelButton* btn, const char* title) +void UITestChartPolyline::SetUpButton(UILabelButton* btn, const char* title, const char* id) { - if (btn == nullptr) { + if (btn == nullptr || title == nullptr || id == nullptr) { return; } container_->Add(btn); @@ -401,6 +401,7 @@ void UITestChartPolyline::SetUpButton(UILabelButton* btn, const char* title) btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(id); container_->Invalidate(); } diff --git a/test/uitest/test_chart/ui_test_chart_polyline.h b/test/uitest/test_chart/ui_test_chart_polyline.h index 4e34c5bc4342a5be00dcde0ac1ff2ccb6881035d..1ede2d819c722bff056a7e17e5321c2afe5d2250 100644 --- a/test/uitest/test_chart/ui_test_chart_polyline.h +++ b/test/uitest/test_chart/ui_test_chart_polyline.h @@ -23,6 +23,19 @@ #include "ui_test.h" namespace OHOS { +constexpr char* UI_TEST_POLYLINE_ADD_DATA = "add_data"; +constexpr char* UI_TEST_POLYLINE_DELETE_DATA = "delete_data"; +constexpr char* UI_TEST_POLYLINE_CLEAR_DATA = "clear_data"; +constexpr char* UI_TEST_POLYLINE_HIGHESET_POINT = "highest_point"; +constexpr char* UI_TEST_POLYLINE_LOWEST_POINT = "lowest_point"; +constexpr char* UI_TEST_POLYLINE_NEW_POINT = "new_point"; +constexpr char* UI_TEST_POLYLINE_FLIP = "flip"; +constexpr char* UI_TEST_POLYLINE_FILL_BOTTOM = "fill_bottom"; + +constexpr char* UI_TEST_POLYLINE_ADD_POINT = "add_point"; +constexpr char* UI_TEST_POLYLINE_SMOOTHING = "smoothing"; +constexpr char* UI_TEST_POLYLINE_HIDE_POINT = "hide_point"; + class UITestChartPolyline : public UITest, public UIView::OnClickListener { public: UITestChartPolyline() {} @@ -31,7 +44,7 @@ public: void TearDown() override; const UIView* GetTestView() override; - void SetUpButton(UILabelButton* btn, const char* title); + void SetUpButton(UILabelButton* btn, const char* title, const char* id); bool OnClick(UIView& view, const ClickEvent& event) override; bool ClickExpand(UIView& view, UIChartDataSerial::PointStyle pointStyle); diff --git a/test/uitest/test_event_injector/ui_test_event_injector.cpp b/test/uitest/test_event_injector/ui_test_event_injector.cpp index f73c1c7513bf9b56d6e8ea17618ead748854c3b7..1f7307a9afc3f4dcd80d9d10e10f512201c89852 100644 --- a/test/uitest/test_event_injector/ui_test_event_injector.cpp +++ b/test/uitest/test_event_injector/ui_test_event_injector.cpp @@ -224,56 +224,56 @@ void UITestEventInjector::UIKit_Event_Injector_Key_Event_004() void UITestEventInjector::UIKit_Event_Injector_Up_to_Down_005() { upToDownBtn_ = new UILabelButton(); - SetUpButton(upToDownBtn_, "up to down"); + SetUpButton(upToDownBtn_, "up to down", UI_TEST_UP_TO_DOWN); } void UITestEventInjector::UIKit_Event_Injector_Down_to_Up_006() { downToUpBtn_ = new UILabelButton(); - SetUpButton(downToUpBtn_, "down to up"); + SetUpButton(downToUpBtn_, "down to up", UI_TEST_DOWN_TO_UP); } void UITestEventInjector::UIKit_Event_Injector_Left_to_Right_007() { leftToRightBtn_ = new UILabelButton(); - SetUpButton(leftToRightBtn_, "left to right"); + SetUpButton(leftToRightBtn_, "left to right", UI_TEST_LEFT_TO_RIGHT); } void UITestEventInjector::UIKit_Event_Injector_Right_to_Left_008() { rightToLeftBtn_ = new UILabelButton(); - SetUpButton(rightToLeftBtn_, "right to left"); + SetUpButton(rightToLeftBtn_, "right to left", UI_TEST_RIGHT_TO_LEFT); } void UITestEventInjector::UIKit_Event_Injector_ULeft_to_LRight_009() { uLeftTolRightBtn_ = new UILabelButton(); - SetUpButton(uLeftTolRightBtn_, "uLeft to lRight"); + SetUpButton(uLeftTolRightBtn_, "uLeft to lRight", UI_TEST_ULEFT_TO_LRIGHT); } void UITestEventInjector::UIKit_Event_Injector_LRight_to_ULeft_010() { lRightTouLeftBtn_ = new UILabelButton(); - SetUpButton(lRightTouLeftBtn_, "lRight to uleft"); + SetUpButton(lRightTouLeftBtn_, "lRight to uleft", UI_TEST_LRIGHT_TO_ULEFT); } void UITestEventInjector::IncreaseDragTime() { increaseDragTimeBtn_ = new UILabelButton(); - SetUpButton(increaseDragTimeBtn_, "increase drag time"); + SetUpButton(increaseDragTimeBtn_, "increase drag time", UI_TEST_INCREASE_DRAG_TIME); } void UITestEventInjector::DecreaseDragTime() { decreaseDragTimeBtn_ = new UILabelButton(); - SetUpButton(decreaseDragTimeBtn_, "decrease drag time"); + SetUpButton(decreaseDragTimeBtn_, "decrease drag time", UI_TEST_DECREASE_DRAG_TIME); } void UITestEventInjector::DragTimeDisplay() { DragTimeDisplayBtn_ = new UILabelButton(); std::string dragTimestr = "dragTime:" + std::to_string(dragTime_); - SetUpButton(DragTimeDisplayBtn_, dragTimestr.c_str()); + SetUpButton(DragTimeDisplayBtn_, dragTimestr.c_str(), UI_TEST_SET_DRAGE_TIME); } void UITestEventInjector::InnerTest(const char* title, @@ -373,9 +373,9 @@ void UITestEventInjector::SetLastPos(UIView* view) positionY_ = lastY_ + 8 * GAP; /* 8:ratio */ } -void UITestEventInjector::SetUpButton(UILabelButton* btn, const char* title) +void UITestEventInjector::SetUpButton(UILabelButton* btn, const char* title, const char* id) { - if (btn == nullptr) { + if (btn == nullptr || title == nullptr || id == nullptr) { return; } layout_->Add(btn); @@ -389,6 +389,7 @@ void UITestEventInjector::SetUpButton(UILabelButton* btn, const char* title) btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(id); } void UITestEventInjector::SetDragTimeDisplay(uint16_t dragTime) diff --git a/test/uitest/test_event_injector/ui_test_event_injector.h b/test/uitest/test_event_injector/ui_test_event_injector.h index abd6c8322a5e7daf168973681d06046d60169285..d5254389eae70b425249adca0352621e660fe2ca 100644 --- a/test/uitest/test_event_injector/ui_test_event_injector.h +++ b/test/uitest/test_event_injector/ui_test_event_injector.h @@ -29,6 +29,17 @@ namespace OHOS { class TestEventInjectorView; + +constexpr char* UI_TEST_UP_TO_DOWN = "up_to_down"; +constexpr char* UI_TEST_DOWN_TO_UP = "down_to_up"; +constexpr char* UI_TEST_LEFT_TO_RIGHT = "left_to_right"; +constexpr char* UI_TEST_RIGHT_TO_LEFT = "right_to_left"; +constexpr char* UI_TEST_ULEFT_TO_LRIGHT = "uleft_to_lright"; +constexpr char* UI_TEST_LRIGHT_TO_ULEFT = "lright_to_uleft"; +constexpr char* UI_TEST_INCREASE_DRAG_TIME = "increase_drag_time"; +constexpr char* UI_TEST_DECREASE_DRAG_TIME = "decrease_drag_time"; +constexpr char* UI_TEST_SET_DRAGE_TIME = "set_drage_time"; + class UITestEventInjector : public UITest, public UIView::OnClickListener { public: UITestEventInjector() {} @@ -78,7 +89,7 @@ private: void InnerTest(const char* title, bool touchable, bool draggable, bool dragParent, const char* btnTitle, UILabelButton* btn, TestEventInjectorView*& testView); void SetLastPos(UIView* view); - void SetUpButton(UILabelButton* btn, const char* title); + void SetUpButton(UILabelButton* btn, const char* title, const char* id); void SetUpScrollView(); void IncreaseDragTime(); void DecreaseDragTime(); diff --git a/test/uitest/test_focus_manager/ui_test_focus_manager.cpp b/test/uitest/test_focus_manager/ui_test_focus_manager.cpp index d35b83967bc3a96f23121d3e6ef91c92dda3287e..3bcd8fb0510e6cdd9dfe61ee08268d0a6c603633 100644 --- a/test/uitest/test_focus_manager/ui_test_focus_manager.cpp +++ b/test/uitest/test_focus_manager/ui_test_focus_manager.cpp @@ -354,32 +354,36 @@ void UITestFocusManager::UIKit_Focus_Manager_Test_001() clearFocusListener_ = static_cast(new ClearFocusOnClickListener()); } /* 10: x, 10: y */ - SetUpButton("向左 ", 10, 10, btnViewGroup, requestFocusByDirectionLeftListener_); + SetUpButton("向左 ", 10, 10, btnViewGroup, requestFocusByDirectionLeftListener_, UI_TEST_TOWRADS_LEFT); /* 150: x, 10: y */ - SetUpButton("向右 ", 150, 10, btnViewGroup, requestFocusByDirectionRightListener_); + SetUpButton("向右 ", 150, 10, btnViewGroup, requestFocusByDirectionRightListener_, UI_TEST_TOWRADS_RIGHT); /* 10: x, 60: y */ - SetUpButton("向上 ", 10, 60, btnViewGroup, requestFocusByDirectionUpListener_); + SetUpButton("向上 ", 10, 60, btnViewGroup, requestFocusByDirectionUpListener_, UI_TEST_TOWRADS_UP); /* 150: x, 60: y */ - SetUpButton("向下 ", 150, 60, btnViewGroup, requestFocusByDirectionDownListener_); + SetUpButton("向下 ", 150, 60, btnViewGroup, requestFocusByDirectionDownListener_, UI_TEST_TOWRADS_DOWN); /* 10: x, 110: y */ - SetUpButton("2可获焦 ", 10, 110, btnViewGroup, setFocusableViewListener_); + SetUpButton("2可获焦 ", 10, 110, btnViewGroup, setFocusableViewListener_, UI_TEST_2_FOCUSABLE); /* 150: x, 110: y */ - SetUpButton("2不可获焦 ", 150, 110, btnViewGroup, setFocusableViewListener1_); + SetUpButton("2不可获焦 ", 150, 110, btnViewGroup, setFocusableViewListener1_, UI_TEST_2_UNFOCUSABLE); /* 10: x, 160: y */ - SetUpButton("设置4容器拦截 ", 10, 160, btnViewGroup, setGroupInterceptListener_); + SetUpButton("设置4容器拦截 ", 10, 160, btnViewGroup, setGroupInterceptListener_, UI_TEST_4_INTERCEPT); /* 150: x, 160: y */ - SetUpButton("取消4容器拦截 ", 150, 160, btnViewGroup, setGroupInterceptListener1_); + SetUpButton("取消4容器拦截 ", 150, 160, btnViewGroup, setGroupInterceptListener1_, UI_TEST_4_CANCEL_INTERCEPT); /* 10: x, 210: y */ - SetUpButton("重置焦点 ", 10, 210, btnViewGroup, resetFocusListener_); + SetUpButton("重置焦点 ", 10, 210, btnViewGroup, resetFocusListener_, UI_TEST_RESET_FOCUS); /* 150: x, 210: y */ - SetUpButton("清除焦点 ", 150, 210, btnViewGroup, clearFocusListener_); + SetUpButton("清除焦点 ", 150, 210, btnViewGroup, clearFocusListener_, UI_TEST_CLEAR_FOCUS); FocusManager::GetInstance()->RequestFocus(viewGroup1->GetChildById("1")); } UILabelButton* UITestFocusManager::SetUpButton(const char* title, int16_t x, int16_t y, UIViewGroup* viewGroup, - UIView::OnClickListener* listener) + UIView::OnClickListener* listener, const char* id) { + if (viewGroup == nullptr || title == nullptr || id == nullptr) { + return nullptr; + } + UILabelButton* btn = new UILabelButton(); btn->SetPosition(x, y, BUTTON_WIDHT2, BUTTON_HEIGHT1); btn->SetText(title); @@ -391,6 +395,7 @@ UILabelButton* UITestFocusManager::SetUpButton(const char* title, int16_t x, int btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(id); viewGroup->Add(btn); return btn; } diff --git a/test/uitest/test_focus_manager/ui_test_focus_manager.h b/test/uitest/test_focus_manager/ui_test_focus_manager.h index 422846e6e4d16dabfd02c3cafc366101e667dde2..72b335c1490f595bb50521d8b9591c20e85b95d9 100644 --- a/test/uitest/test_focus_manager/ui_test_focus_manager.h +++ b/test/uitest/test_focus_manager/ui_test_focus_manager.h @@ -24,6 +24,17 @@ #include "ui_test.h" namespace OHOS { +constexpr char* UI_TEST_TOWRADS_LEFT = "towards_left"; +constexpr char* UI_TEST_TOWRADS_RIGHT = "towards_right"; +constexpr char* UI_TEST_TOWRADS_UP = "towards_up"; +constexpr char* UI_TEST_TOWRADS_DOWN = "towards_down"; +constexpr char* UI_TEST_2_FOCUSABLE = "2_focusable"; +constexpr char* UI_TEST_2_UNFOCUSABLE = "2_unfocusable"; +constexpr char* UI_TEST_4_INTERCEPT = "4_intercept"; +constexpr char* UI_TEST_4_CANCEL_INTERCEPT = "4_cancel_intercept"; +constexpr char* UI_TEST_RESET_FOCUS = "reset_focus"; +constexpr char* UI_TEST_CLEAR_FOCUS = "clear_focus"; + class UITestFocusManager : public UITest { public: UITestFocusManager() {} @@ -39,7 +50,7 @@ private: const char* text, bool focusable); UIViewGroup* CreateTestUIViewGroup(UIViewGroup* parent, bool focusable, bool interceptFocus); UILabelButton* SetUpButton(const char* title, int16_t x, int16_t y, UIViewGroup* viewGroup, - UIView::OnClickListener* listener); + UIView::OnClickListener* listener, const char* id); UIScrollView* container_ = nullptr; UIView::OnFocusListener* testOnFocusListener_ = nullptr; UIView::OnClickListener* requestFocusByDirectionLeftListener_ = nullptr; diff --git a/test/uitest/test_picker/ui_test_ui_picker.cpp b/test/uitest/test_picker/ui_test_ui_picker.cpp index d9584207d735a0a8d738da4e805df68d9719b311..8f68035762e4f8dee38b53de805d737662357f5e 100644 --- a/test/uitest/test_picker/ui_test_ui_picker.cpp +++ b/test/uitest/test_picker/ui_test_ui_picker.cpp @@ -123,11 +123,11 @@ void UITestUIPicker::UIKit_Picker_Test_Base_001() selectIndex_->SetPosition(positionX_ + 40, label->GetY() + g_blank); // 40: increase x-coordinate positionY_ += label->GetY() + g_blank; container_->Add(selectIndex_); - SetUpButton(setLoopBtn_, "开启循环 "); - SetUpButton(setLoopOffBtn_, "关闭循环 "); - SetUpButton(setSelectBtn_, "定位到第5个 "); - SetUpButton(setLeftToRightBtn_, "从左往右 "); - SetUpButton(setRightToLeftBtn_, "从右往左 "); + SetUpButton(setLoopBtn_, "开启循环 ", UI_TEST_START_LOOP); + SetUpButton(setLoopOffBtn_, "关闭循环 ", UI_TEST_STOP_LOOP); + SetUpButton(setSelectBtn_, "定位到第5个 ", UI_TEST_GO_TO_THE_FIFTH); + SetUpButton(setLeftToRightBtn_, "从左往右 ", UI_TEST_FROM_LEFT_TO_RIGHT); + SetUpButton(setRightToLeftBtn_, "从右往左 ", UI_TEST_FROM_RIGHT_TO_LEFT); container_->Add(picker1_); SetLastPos(picker1_); } @@ -194,6 +194,7 @@ void UITestUIPicker::UIKit_Picker_Test_Time_Picker_001() setMarginBtn_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); setMarginBtn_->SetOnClickListener(this); setMarginBtn_->SetText("增加margin"); + setMarginBtn_->SetViewId(UI_TEST_PICKER_ADD_MARGIN); if (picker2_ == nullptr) { picker2_ = new UITimePicker(); @@ -241,9 +242,9 @@ bool UITestUIPicker::OnClick(UIView& view, const ClickEvent& event) return true; } -void UITestUIPicker::SetUpButton(UILabelButton* btn, const char* title) +void UITestUIPicker::SetUpButton(UILabelButton* btn, const char* title, const char* id) { - if (btn == nullptr) { + if (btn == nullptr || title == nullptr || id == nullptr) { return; } container_->Add(btn); @@ -258,6 +259,7 @@ void UITestUIPicker::SetUpButton(UILabelButton* btn, const char* title) btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(id); container_->Invalidate(); } diff --git a/test/uitest/test_picker/ui_test_ui_picker.h b/test/uitest/test_picker/ui_test_ui_picker.h index fe17057d3481f302519e5c7b20cb4ff45d2b9f02..400d598d884580c1bfb2f9b899be3329aa7768b6 100644 --- a/test/uitest/test_picker/ui_test_ui_picker.h +++ b/test/uitest/test_picker/ui_test_ui_picker.h @@ -25,6 +25,13 @@ #include "ui_test.h" namespace OHOS { +constexpr char* UI_TEST_START_LOOP = "start_loop"; +constexpr char* UI_TEST_STOP_LOOP = "stop_loop"; +constexpr char* UI_TEST_GO_TO_THE_FIFTH = "go_to_the_fifth"; +constexpr char* UI_TEST_FROM_LEFT_TO_RIGHT = "from_left_to_right"; +constexpr char* UI_TEST_FROM_RIGHT_TO_LEFT = "from_right_to_left"; +constexpr char* UI_TEST_PICKER_ADD_MARGIN = "add_margin"; + class UITestUIPicker : public UITest, UIView::OnClickListener, UIPicker::SelectedListener, UITimePicker::SelectedListener { public: @@ -43,7 +50,7 @@ public: private: void SetLastPos(UIView* view); - void SetUpButton(UILabelButton* btn, const char* title); + void SetUpButton(UILabelButton* btn, const char* title, const char* id); UILabelButton* setLoopBtn_ = nullptr; UILabelButton* setLoopOffBtn_ = nullptr; UILabelButton* setSelectBtn_ = nullptr; diff --git a/test/uitest/test_transform/ui_test_transform.cpp b/test/uitest/test_transform/ui_test_transform.cpp index 3922b9b2e9a437acc59211da11195da44b2005f6..f597f2acfe6c399974ef500f635306009bab2984 100644 --- a/test/uitest/test_transform/ui_test_transform.cpp +++ b/test/uitest/test_transform/ui_test_transform.cpp @@ -83,38 +83,38 @@ void UITestTransform::AddRadioGroup() int16_t y = 50; AddLable(lableX, y, "Auto"); AddRadioButton(GetRect(RADIO_X, y + RADIO_OFFSET, RADIO_SIZE, RADIO_SIZE), - "RB", new StateChangeListener(ImageScaleMode::AUTO, this))->SetState( + "RB", new StateChangeListener(ImageScaleMode::AUTO, this), UI_TEST_AUTO)->SetState( UICheckBox::UICheckBoxState::SELECTED); y += STEP; AddLable(lableX, y, "Tiling"); AddRadioButton(GetRect(RADIO_X, y + RADIO_OFFSET, RADIO_SIZE, RADIO_SIZE), - "RB", new StateChangeListener(ImageScaleMode::TILING, this)); + "RB", new StateChangeListener(ImageScaleMode::TILING, this), UI_TEST_TILING); y += STEP; AddLable(lableX, y, "Cover"); AddRadioButton(GetRect(RADIO_X, y + RADIO_OFFSET, RADIO_SIZE, RADIO_SIZE), - "RB", new StateChangeListener(ImageScaleMode::COVER, this)); + "RB", new StateChangeListener(ImageScaleMode::COVER, this), UI_TEST_COVER); y += STEP; AddLable(lableX, y, "Contain"); AddRadioButton(GetRect(RADIO_X, y + RADIO_OFFSET, RADIO_SIZE, RADIO_SIZE), - "RB", new StateChangeListener(ImageScaleMode::CONTAIN, this)); + "RB", new StateChangeListener(ImageScaleMode::CONTAIN, this), UI_TEST_CONTAIN); y += STEP; AddLable(lableX, y, "Fill"); AddRadioButton(GetRect(RADIO_X, y + RADIO_OFFSET, RADIO_SIZE, RADIO_SIZE), - "RB", new StateChangeListener(ImageScaleMode::FILL, this)); + "RB", new StateChangeListener(ImageScaleMode::FILL, this), UI_TEST_FILL); y += STEP; AddLable(lableX, y, "Center"); AddRadioButton(GetRect(RADIO_X, y + RADIO_OFFSET, RADIO_SIZE, RADIO_SIZE), - "RB", new StateChangeListener(ImageScaleMode::CENTER, this)); + "RB", new StateChangeListener(ImageScaleMode::CENTER, this), UI_TEST_CENTER); y += STEP; AddLable(lableX, y, "Scale Down"); AddRadioButton(GetRect(RADIO_X, y + RADIO_OFFSET, RADIO_SIZE, RADIO_SIZE), - "RB", new StateChangeListener(ImageScaleMode::SCALE_DOWN, this)); + "RB", new StateChangeListener(ImageScaleMode::SCALE_DOWN, this), UI_TEST_SCALE_DOWN); } void UITestTransform::TearDown() @@ -136,9 +136,9 @@ const UIView* UITestTransform::GetTestView() return container_; } -void UITestTransform::SetUpButton(UILabelButton* btn, const char* title) +void UITestTransform::SetUpButton(UILabelButton* btn, const char* title, const char* id) { - if (btn == nullptr) { + if (btn == nullptr || title == nullptr || id == nullptr) { return; } layout_->Add(btn); @@ -152,24 +152,25 @@ void UITestTransform::SetUpButton(UILabelButton* btn, const char* title) btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(id); } void UITestTransform::UIKit_Transform_Test_Rotate_001() { rotateBtn_ = new UILabelButton(); - SetUpButton(rotateBtn_, "旋转"); + SetUpButton(rotateBtn_, "旋转", UI_TEST_ROTATE); } void UITestTransform::UIKit_Transform_Test_Scale_002() { scaleBtn_ = new UILabelButton(); - SetUpButton(scaleBtn_, "缩放"); + SetUpButton(scaleBtn_, "缩放", UI_TEST_ZOOM); } void UITestTransform::UIKit_Transform_Test_Translate_003() { translateBtn_ = new UILabelButton(); - SetUpButton(translateBtn_, "平移"); + SetUpButton(translateBtn_, "平移", UI_TEST_TRANSLATION); } bool UITestTransform::OnClick(UIView& view, const ClickEvent& event) @@ -256,7 +257,8 @@ UILabel* UITestTransform::AddLable(int16_t x, int16_t y, const char* data) return label; } -UIRadioButton* UITestTransform::AddRadioButton(Rect rect, const char* name, UICheckBox::OnChangeListener* listener) +UIRadioButton* UITestTransform::AddRadioButton(Rect rect, const char* name, + UICheckBox::OnChangeListener* listener, const char* id) { if (listener == nullptr || name == nullptr) { return nullptr; @@ -265,6 +267,7 @@ UIRadioButton* UITestTransform::AddRadioButton(Rect rect, const char* name, UICh container_->Add(radioButton); radioButton->SetListener(listener); radioButton->SetPosition(rect.GetX(), rect.GetY(), rect.GetWidth(), rect.GetHeight()); + radioButton->SetViewId(id); if (radioButton->GetState() == UICheckBox::SELECTED) { listener->OnChange(UICheckBox::SELECTED); } diff --git a/test/uitest/test_transform/ui_test_transform.h b/test/uitest/test_transform/ui_test_transform.h index ac4f6473ccf730e3b5f420fb88affde176975682..b329d9db78472746f7841a03e425433019fbeafd 100644 --- a/test/uitest/test_transform/ui_test_transform.h +++ b/test/uitest/test_transform/ui_test_transform.h @@ -36,6 +36,17 @@ enum ImageScaleMode { SCALE_DOWN, }; +constexpr char* UI_TEST_ROTATE = "rotate"; +constexpr char* UI_TEST_ZOOM = "zoom"; +constexpr char* UI_TEST_TRANSLATION = "translation"; +constexpr char* UI_TEST_AUTO = "auto"; +constexpr char* UI_TEST_TILING = "tiling"; +constexpr char* UI_TEST_COVER = "cover"; +constexpr char* UI_TEST_CONTAIN = "contain"; +constexpr char* UI_TEST_FILL = "fill"; +constexpr char* UI_TEST_CENTER = "center"; +constexpr char* UI_TEST_SCALE_DOWN = "scale_down"; + class UITestTransform : public UITest, public UIView::OnClickListener { public: UITestTransform() {} @@ -44,7 +55,7 @@ public: void TearDown() override; const UIView* GetTestView() override; - void SetUpButton(UILabelButton* btn, const char* title); + void SetUpButton(UILabelButton* btn, const char* title, const char* id); bool OnClick(UIView& view, const ClickEvent& event) override; @@ -57,7 +68,8 @@ public: private: void AddRadioGroup(); UILabel* AddLable(int16_t x, int16_t y, const char* data); - UIRadioButton* AddRadioButton(Rect rect, const char* name, UICheckBox::OnChangeListener* listener); + UIRadioButton* AddRadioButton(Rect rect, const char* name, + UICheckBox::OnChangeListener* listener, const char* id); Rect GetRect(int16_t x, int16_t y, int16_t w, int16_t h) const { return Rect(x, y, x + w - 1, y + h - 1); diff --git a/test/uitest/test_ui_analog_clock/ui_test_analog_clock.cpp b/test/uitest/test_ui_analog_clock/ui_test_analog_clock.cpp index e50583496f4c8e7f67c0af57b7322b54fadd30f6..cab7fc0d8cdf9018fe91b588f35776bf27851e61 100644 --- a/test/uitest/test_ui_analog_clock/ui_test_analog_clock.cpp +++ b/test/uitest/test_ui_analog_clock/ui_test_analog_clock.cpp @@ -206,7 +206,7 @@ void UITestAnalogClock::CreateButtons001(UIViewGroup* group, UIImageView* curFac if ((group == nullptr) || (curFace == nullptr) || (clock == nullptr)) { return; } - UILabelButton* button1 = SetUpButton("切换模式"); + UILabelButton* button1 = SetUpButton("切换模式", UI_TEST_SWITCH_MODE_1); group->Add(button1); // 58: increase x-position; 48: y-position button1->SetPosition(curFace->GetWidth() + 58, 48, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -216,7 +216,7 @@ void UITestAnalogClock::CreateButtons001(UIViewGroup* group, UIImageView* curFac } button1->SetOnClickListener(changeModeListener_); - UILabelButton* button2 = SetUpButton("左移"); + UILabelButton* button2 = SetUpButton("左移", UI_TEST_SHIF_LEFT_1); group->Add(button2); // 58: increase x-position; 58: increase y-position button2->SetPosition(curFace->GetWidth() + 58, BUTTON_HEIGHT + 58, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -228,7 +228,7 @@ void UITestAnalogClock::CreateButtons001(UIViewGroup* group, UIImageView* curFac } button2->SetOnClickListener(clickMoveLeftListener_); - UILabelButton* button3 = SetUpButton("右移"); + UILabelButton* button3 = SetUpButton("右移", UI_TEST_SHIF_RIGHT_1); group->Add(button3); // 58: increase x-position; 148: y-position button3->SetPosition(curFace->GetWidth() + 58, 148, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -240,7 +240,7 @@ void UITestAnalogClock::CreateButtons001(UIViewGroup* group, UIImageView* curFac } button3->SetOnClickListener(clickMoveRightListener_); - UILabelButton* button4 = SetUpButton("上移"); + UILabelButton* button4 = SetUpButton("上移", UI_TEST_SHIF_UP_1); group->Add(button4); // 58: increase x-position; 198: y-position button4->SetPosition(curFace->GetWidth() + 58, 198, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -252,7 +252,7 @@ void UITestAnalogClock::CreateButtons001(UIViewGroup* group, UIImageView* curFac } button4->SetOnClickListener(clickMoveTopListener_); - UILabelButton* button5 = SetUpButton("下移"); + UILabelButton* button5 = SetUpButton("下移", UI_TEST_SHIF_DOWN_1); group->Add(button5); // 58: increase x-position; 248: y-position button5->SetPosition(curFace->GetWidth() + 58, 248, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -320,7 +320,7 @@ void UITestAnalogClock::CreateButtons002(UIViewGroup* group, UIImageView* curFac if ((group == nullptr) || (curFace == nullptr) || (clock == nullptr)) { return; } - UILabelButton* button1 = SetUpButton("切换模式"); + UILabelButton* button1 = SetUpButton("切换模式", UI_TEST_SWITCH_MODE_2); group->Add(button1); // 58: increase x-coordinate; 48: y-coordinate button1->SetPosition(curFace->GetWidth() + 58, 48, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -330,7 +330,7 @@ void UITestAnalogClock::CreateButtons002(UIViewGroup* group, UIImageView* curFac } button1->SetOnClickListener(changeModeListener1_); - UILabelButton* button2 = SetUpButton("左移"); + UILabelButton* button2 = SetUpButton("左移", UI_TEST_SHIF_LEFT_2); group->Add(button2); // 58: increase x-coordinate; 98: y-coordinate button2->SetPosition(curFace->GetWidth() + 58, 98, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -342,7 +342,7 @@ void UITestAnalogClock::CreateButtons002(UIViewGroup* group, UIImageView* curFac } button2->SetOnClickListener(clickMoveLeftListener1_); - UILabelButton* button3 = SetUpButton("右移"); + UILabelButton* button3 = SetUpButton("右移", UI_TEST_SHIF_RIGHT_2); group->Add(button3); // 58: increase x-coordinate; 148: y-coordinate button3->SetPosition(curFace->GetWidth() + 58, 148, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -354,7 +354,7 @@ void UITestAnalogClock::CreateButtons002(UIViewGroup* group, UIImageView* curFac } button3->SetOnClickListener(clickMoveRightListener1_); - UILabelButton* button4 = SetUpButton("上移"); + UILabelButton* button4 = SetUpButton("上移", UI_TEST_SHIF_UP_2); group->Add(button4); // 58: increase x-coordinate; 198: y-coordinate button4->SetPosition(curFace->GetWidth() + 58, 198, BUTTON_WIDTH, BUTTON_HEIGHT); @@ -365,7 +365,7 @@ void UITestAnalogClock::CreateButtons002(UIViewGroup* group, UIImageView* curFac TestBtnOnClickMovePositionListener::MoveType::MOVE_TOP, 10)); // 10: move value } button4->SetOnClickListener(clickMoveTopListener1_); - UILabelButton* button5 = SetUpButton("下移"); + UILabelButton* button5 = SetUpButton("下移", UI_TEST_SHIF_DOWN_2); group->Add(button5); // 58: increase x-coordinate; 248: y-coordinate button5->SetPosition(curFace->GetWidth() + 58, 248, BUTTON_WIDTH, BUTTON_HEIGHT); diff --git a/test/uitest/test_ui_analog_clock/ui_test_analog_clock.h b/test/uitest/test_ui_analog_clock/ui_test_analog_clock.h index 9f43405c9f6a3c33d3ccd90ace0b4804e17af9a7..1e7fd27f761ad15b53a7083b35b35894059bd66a 100644 --- a/test/uitest/test_ui_analog_clock/ui_test_analog_clock.h +++ b/test/uitest/test_ui_analog_clock/ui_test_analog_clock.h @@ -40,6 +40,18 @@ private: int16_t count_ = 0; }; +constexpr char* UI_TEST_SWITCH_MODE_1 = "switch_mode_1"; +constexpr char* UI_TEST_SHIF_LEFT_1 = "shift_left_1"; +constexpr char* UI_TEST_SHIF_RIGHT_1 = "shift_right_1"; +constexpr char* UI_TEST_SHIF_UP_1 = "shift_up_1"; +constexpr char* UI_TEST_SHIF_DOWN_1 = "shift_down_1"; + +constexpr char* UI_TEST_SWITCH_MODE_2 = "switch_mode_2"; +constexpr char* UI_TEST_SHIF_LEFT_2 = "shift_left_2"; +constexpr char* UI_TEST_SHIF_RIGHT_2 = "shift_right_2"; +constexpr char* UI_TEST_SHIF_UP_2 = "shift_up_2"; +constexpr char* UI_TEST_SHIF_DOWN_2 = "shift_down_2"; + class UITestAnalogClock : public UITest { public: UITestAnalogClock() {} @@ -69,7 +81,7 @@ private: UIView::OnClickListener* clickMoveRightListener1_ = nullptr; UIView::OnClickListener* clickMoveTopListener1_ = nullptr; UIView::OnClickListener* clickMoveBottomListener1_ = nullptr; - UILabelButton* SetUpButton(const char* title) + UILabelButton* SetUpButton(const char* title, const char* id) { UILabelButton* btn = new UILabelButton(); btn->Resize(BUTTON_WIDHT2, BUTTON_HEIGHT2); @@ -81,6 +93,7 @@ private: btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(id); return btn; } }; diff --git a/test/uitest/test_view_bitmap/ui_test_view_bitmap.cpp b/test/uitest/test_view_bitmap/ui_test_view_bitmap.cpp index 8d870066250c0718095697e3b17f41565c901e39..b3dd12b6d9530d17568464b0c9f56da6e8a17a94 100644 --- a/test/uitest/test_view_bitmap/ui_test_view_bitmap.cpp +++ b/test/uitest/test_view_bitmap/ui_test_view_bitmap.cpp @@ -163,6 +163,7 @@ void UITestViewBitmap::UIKit_Bitmap_Test_GetViewBitmap_001() btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(UI_TEST_COMPONENT_SCREENSHOT); } void UITestViewBitmap::UIKit_Bitmap_Test_GetScreenBitmap_001() @@ -180,5 +181,6 @@ void UITestViewBitmap::UIKit_Bitmap_Test_GetScreenBitmap_001() btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn->SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn->SetViewId(UI_TEST_FULL_SCREEN_CAPTURE); } } // namespace OHOS diff --git a/test/uitest/test_view_bitmap/ui_test_view_bitmap.h b/test/uitest/test_view_bitmap/ui_test_view_bitmap.h index f7b24994c6d3b26de81c3fb14c62c550b1c1e936..593785caf6ac875ec3994b4f6d3c1b328da1aeae 100644 --- a/test/uitest/test_view_bitmap/ui_test_view_bitmap.h +++ b/test/uitest/test_view_bitmap/ui_test_view_bitmap.h @@ -21,6 +21,9 @@ #include "ui_test.h" namespace OHOS { +constexpr char* UI_TEST_COMPONENT_SCREENSHOT = "component_screenshot"; +constexpr char* UI_TEST_FULL_SCREEN_CAPTURE = "full_screen_capture"; + class UITestViewBitmap : public UITest { public: UITestViewBitmap() {} diff --git a/test/uitest/test_view_bounds/ui_test_view_bounds.cpp b/test/uitest/test_view_bounds/ui_test_view_bounds.cpp index 6014b3a1fe9a12f52035cc243201fc181049fbae..83b88c24602c4b910c40751ca7b3e69ff404b8e3 100644 --- a/test/uitest/test_view_bounds/ui_test_view_bounds.cpp +++ b/test/uitest/test_view_bounds/ui_test_view_bounds.cpp @@ -121,6 +121,7 @@ void UITestViewBounds::UIKitViewBoundsSetState001() toggle->SetHeight(50); // 50: height toggle->LayoutCenterOfParent(); toggle->LayoutRightOfParent(5); // 5: offset + toggle->SetViewId(UI_TEST_SHOW_VIEW_BOUNDS); if (viewBoundsChangeListener_ != nullptr) { delete viewBoundsChangeListener_; } diff --git a/test/uitest/test_view_bounds/ui_test_view_bounds.h b/test/uitest/test_view_bounds/ui_test_view_bounds.h index 884a9ae70acc1827a78bb06f8b43d22fd886ac5a..da072e33a3bcab03657646a714a1b4ae8eb7d07a 100644 --- a/test/uitest/test_view_bounds/ui_test_view_bounds.h +++ b/test/uitest/test_view_bounds/ui_test_view_bounds.h @@ -25,6 +25,7 @@ #include "ui_test.h" namespace OHOS { +constexpr char* UI_TEST_SHOW_VIEW_BOUNDS = "show_view_bounds"; class UITestViewBounds : public UITest { public: UITestViewBounds() {} diff --git a/test/uitest/test_view_percent/ui_test_view_percent.cpp b/test/uitest/test_view_percent/ui_test_view_percent.cpp index c7231484192e952387ee507cd7164c7a88c118c7..a47c76611d91c1852030fa40c07af97ae43a1607 100644 --- a/test/uitest/test_view_percent/ui_test_view_percent.cpp +++ b/test/uitest/test_view_percent/ui_test_view_percent.cpp @@ -110,9 +110,9 @@ void UITestViewPercent::InitView() gridLayout->SetRows(1); // set gridlayout row as 1 gridLayout->SetCols(3); // set gridlayout column as 3 - SetUpButton(*gridLayout, *resetfBtn_, "reset"); - SetUpButton(*gridLayout, *BiggerBtn_, "Bigger"); - SetUpButton(*gridLayout, *SmallerBtn_, "Smaller"); + SetUpButton(*gridLayout, *resetfBtn_, "reset", UI_TEST_RESET); + SetUpButton(*gridLayout, *BiggerBtn_, "Bigger", UI_TEST_BIGGER); + SetUpButton(*gridLayout, *SmallerBtn_, "Smaller", UI_TEST_SMALLER); gridLayout->LayoutChildren(true); container_->LayoutChildren(true); } diff --git a/test/uitest/test_view_percent/ui_test_view_percent.h b/test/uitest/test_view_percent/ui_test_view_percent.h index f9ea2066fb2ba5df8c10b2f5f14327dbcfcf463a..942d166cd9e3b85cf2b69982001f149c0849323c 100644 --- a/test/uitest/test_view_percent/ui_test_view_percent.h +++ b/test/uitest/test_view_percent/ui_test_view_percent.h @@ -27,6 +27,9 @@ #include "ui_test.h" namespace OHOS { +constexpr char* UI_TEST_RESET = "reset"; +constexpr char* UI_TEST_BIGGER = "bigger"; +constexpr char* UI_TEST_SMALLER = "smaller"; class UITestViewPercent : public UITest, public UIView::OnClickListener { public: UITestViewPercent() {} @@ -37,8 +40,12 @@ public: bool OnClick(UIView& view, const ClickEvent& event) override; private: - void SetUpButton(Layout& controller, UILabelButton& btn, const std::string title) + void SetUpButton(Layout& controller, UILabelButton& btn, const std::string title, const char* id) { + if (id == nullptr) { + return; + } + controller.Add(&btn); btn.Resize(BUTTON_WIDHT1, BUTTON_HEIGHT1); btn.SetText(title.c_str()); @@ -50,6 +57,7 @@ private: btn.SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::RELEASED); btn.SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::PRESSED); btn.SetStyleForState(STYLE_BACKGROUND_COLOR, BUTTON_STYLE_BACKGROUND_COLOR_VALUE, UIButton::INACTIVE); + btn.SetViewId(id); } void InitView(); void InitFlexLayout(); diff --git a/tools/server/test_case/analog_clock_test.json b/tools/server/test_case/analog_clock_test.json new file mode 100644 index 0000000000000000000000000000000000000000..4c95658cae072e87da24a07f66a917da4002b399 --- /dev/null +++ b/tools/server/test_case/analog_clock_test.json @@ -0,0 +1,148 @@ +{ + "testInfo": [ + { + "className": "ui_analog_clock_test_01", + "pageNav": ["Analog_Clock"], + "testSteps": [ + { + "viewID": "shift_left_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_right_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_up_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_down_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "ui_analog_clock_test_02", + "pageNav": ["Analog_Clock"], + "testSteps": [ + { + "viewID": "switch_mode_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_left_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_right_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_up_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_down_1", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "ui_analog_clock_test_03", + "pageNav": ["Analog_Clock"], + "testSteps": [ + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -600], + "saveCheckPoint": false + }, + { + "viewID": "shift_left_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_right_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_up_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_down_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "ui_analog_clock_test_03", + "pageNav": ["Analog_Clock"], + "testSteps": [ + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -600], + "saveCheckPoint": false + }, + { + "viewID": "switch_mode_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_left_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_right_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_up_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": false + }, + { + "viewID": "shift_down_2", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/char_polyline_test.json b/tools/server/test_case/char_polyline_test.json new file mode 100644 index 0000000000000000000000000000000000000000..b5864bfef573ac44f72f9376af11228be52b568e --- /dev/null +++ b/tools/server/test_case/char_polyline_test.json @@ -0,0 +1,184 @@ +{ + "testInfo": [ + { + "className": "chart_polylin_test_01", + "pageNav": ["Chart_Polyline"], + "testSteps": [ + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "delete_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "highest_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "lowest_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "new_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "flip", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "fill_bottom", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "clear_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "chart_polylin_test_02", + "pageNav": ["Chart_Polyline"], + "testSteps": [ + { + "viewID": "clear_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "flip", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "fill_bottom", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "highest_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "lowest_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "new_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "delete_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "delete_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "chart_polylin_test_03", + "pageNav": ["Chart_Polyline"], + "testSteps": [ + { + "viewID": "add_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "smoothing", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "hide_point", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/chart_pillar_test.json b/tools/server/test_case/chart_pillar_test.json new file mode 100644 index 0000000000000000000000000000000000000000..5dc65d427f380ab7c32f1eeb0dc953843aeda756 --- /dev/null +++ b/tools/server/test_case/chart_pillar_test.json @@ -0,0 +1,100 @@ +{ + "testInfo": [ + { + "className": "ui_chart_pillar_test_01", + "pageNav": ["Chart_Pillar"], + "testSteps": [ + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "delete_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "clear_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "flip", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "axis_color", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "axis_not_visible", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "ui_chart_pillar_test_02", + "pageNav": ["Chart_Pillar"], + "testSteps": [ + { + "viewID": "clear_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "delete_data", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "flip", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "axis_color", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "axis_not_visible", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/digital_clock_test.json b/tools/server/test_case/digital_clock_test.json new file mode 100644 index 0000000000000000000000000000000000000000..1464a4d5b75498dd694c230ec3581529a0bde0f2 --- /dev/null +++ b/tools/server/test_case/digital_clock_test.json @@ -0,0 +1,22 @@ +{ + "testInfo": [ + { + "className": "ui_digital_clock_test_01", + "pageNav": ["Digital_Clock"], + "testSteps": [ + { + "viewID": "", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -200], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/focus_manager_test.json b/tools/server/test_case/focus_manager_test.json new file mode 100644 index 0000000000000000000000000000000000000000..1d979826493f8805dda131b01680b8187e66809f --- /dev/null +++ b/tools/server/test_case/focus_manager_test.json @@ -0,0 +1,412 @@ +{ + "testInfo": [ + { + "className": "focus_test_get_focus_01", + "pageNav": ["FocusManager"], + "testSteps": [ + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_left", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_up", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "focus_test_get_focus_02", + "pageNav": ["FocusManager"], + "testSteps": [ + { + "viewID": "2_unfocusable", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_left", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_up", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "focus_test_get_focus_03", + "pageNav": ["FocusManager"], + "testSteps": [ + { + "viewID": "UI_TEST_4_INTERCEPT", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_left", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_up", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "focus_test_get_focus_04", + "pageNav": ["FocusManager"], + "testSteps": [ + { + "viewID": "UI_TEST_4_INTERCEPT", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_left", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "reset_focus", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "focus_test_get_focus_05", + "pageNav": ["FocusManager"], + "testSteps": [ + { + "viewID": "4_intercept", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_left", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "clear_focus", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "focus_test_get_focus_06", + "pageNav": ["FocusManager"], + "testSteps": [ + { + "viewID": "clear_focus", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "reset_focus", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "2_unfocusable", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "2_focusable", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_left", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "4_intercept", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "4_cancel_intercept", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "towards_up", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "reset_focus", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "clear_focus", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/opacity_test.json b/tools/server/test_case/opacity_test.json new file mode 100644 index 0000000000000000000000000000000000000000..f2b87d617e6a144fea6e6d8a1a1fda081b0d44cf --- /dev/null +++ b/tools/server/test_case/opacity_test.json @@ -0,0 +1,34 @@ +{ + "testInfo": [ + { + "className": "ui_opacity_test_01", + "pageNav": ["Opacity"], + "testSteps": [ + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -150], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -300], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -450], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -600], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/qrcode_test.json b/tools/server/test_case/qrcode_test.json new file mode 100644 index 0000000000000000000000000000000000000000..9399f8b08468b49d77bdd3b704fecb173989406c --- /dev/null +++ b/tools/server/test_case/qrcode_test.json @@ -0,0 +1,34 @@ +{ + "testInfo": [ + { + "className": "ui_qrcode_test_01", + "pageNav": ["UIQrcode"], + "testSteps": [ + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -150], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -300], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -450], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -600], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/transform_test.json b/tools/server/test_case/transform_test.json new file mode 100644 index 0000000000000000000000000000000000000000..88980bb9d6a1ead879582fdbeb28f96b61cd3a87 --- /dev/null +++ b/tools/server/test_case/transform_test.json @@ -0,0 +1,220 @@ +{ + "testInfo": [ + { + "className": "transform_test_01", + "pageNav": ["Transform"], + "testSteps": [ + { + "viewID": "rotate", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "auto", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "tiling", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "cover", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "contain", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "fill", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "center", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "scale_Down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "transform_test_02", + "pageNav": ["Transform"], + "testSteps": [ + { + "viewID": "zoom", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "auto", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "tiling", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "cover", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "contain", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "fill", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "center", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "scale_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "transform_test_03", + "pageNav": ["Transform"], + "testSteps": [ + { + "viewID": "translation", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "auto", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "tiling", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "cover", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "contain", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "fill", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "center", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "scale_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "transform_test_04", + "pageNav": ["Transform"], + "testSteps": [ + { + "viewID": "rotate", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "zoom", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "translation", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "translation", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "zoom", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "rotate", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "rotate", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "scale_down", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/ui_picker_test.json b/tools/server/test_case/ui_picker_test.json new file mode 100644 index 0000000000000000000000000000000000000000..8812ad32d7ad1bf5c61b2e1238b84ec42a988c3c --- /dev/null +++ b/tools/server/test_case/ui_picker_test.json @@ -0,0 +1,40 @@ +{ + "testInfo": [ + { + "className": "ui_picker_01", + "pageNav": ["UIPicker"], + "testSteps": [ + { + "viewID": "go_to_the_fifth", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "from_left_to_right", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "from_right_to_left", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_margin", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "add_margin", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/view_bitmap_test.json b/tools/server/test_case/view_bitmap_test.json new file mode 100644 index 0000000000000000000000000000000000000000..c56e627b325f443b1a589aba110a35f85e657245 --- /dev/null +++ b/tools/server/test_case/view_bitmap_test.json @@ -0,0 +1,40 @@ +{ + "testInfo": [ + { + "className": "view_bitmap_01", + "pageNav": ["View Bitmap"], + "testSteps": [ + { + "viewID": "component_screenshot", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "full_screen_capture", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "view_bitmap_02", + "pageNav": ["View Bitmap"], + "testSteps": [ + { + "viewID": "full_screen_capture", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "component_screenshot", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/view_bounds_test.json b/tools/server/test_case/view_bounds_test.json new file mode 100644 index 0000000000000000000000000000000000000000..0914a02156d01939cc30ad6aeb35237b2e9c3ccc --- /dev/null +++ b/tools/server/test_case/view_bounds_test.json @@ -0,0 +1,52 @@ +{ + "testInfo": [ + { + "className": "ui_view_bounds_test_01", + "pageNav": ["View Bounds"], + "testSteps": [ + { + "viewID": "show_view_bounds", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "show_view_bounds", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -500], + "saveCheckPoint": true + } + ] + }, + { + "className": "ui_view_bounds_test_02", + "pageNav": ["View Bounds"], + "testSteps": [ + { + "viewID": "show_view_bounds", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -500], + "saveCheckPoint": true + }, + { + "viewID": "show_view_bounds", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/view_group_test.json b/tools/server/test_case/view_group_test.json new file mode 100644 index 0000000000000000000000000000000000000000..790f54e9ba4d9ed4c0eb8625e2108bbf09587449 --- /dev/null +++ b/tools/server/test_case/view_group_test.json @@ -0,0 +1,118 @@ +{ + "testInfo": [ + { + "className": "uiviewgroup_test_01", + "pageNav": ["UIViewGroup"], + "testSteps": [ + { + "viewID": "addBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "removeBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "removeAddBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "uiviewgroup_test_02", + "pageNav": ["UIViewGroup"], + "testSteps": [ + { + "viewID": "addBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "addBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "removeBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "removeAddBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "removeBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "uiviewgroup_test_03", + "pageNav": ["UIViewGroup"], + "testSteps": [ + { + "viewID": "addTwiceBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "addMultiParentBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "addSelfBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + }, + { + "className": "uiviewgroup_test_04", + "pageNav": ["UIViewGroup"], + "testSteps": [ + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -300], + "saveCheckPoint": false + }, + { + "viewID": "insertTwiceBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "insertMultiParentBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "addSelfBtn", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/server/test_case/view_percent_test.json b/tools/server/test_case/view_percent_test.json new file mode 100644 index 0000000000000000000000000000000000000000..8131ffe8d369b4cd79ac43a62f5717e7648ff0d0 --- /dev/null +++ b/tools/server/test_case/view_percent_test.json @@ -0,0 +1,100 @@ +{ + "testInfo": [ + { + "className": "ui_view_percent_test_01", + "pageNav": ["View_Percent"], + "testSteps": [ + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -300], + "saveCheckPoint": true + }, + { + "viewID": "bigger", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "bigger", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "smaller", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "smaller", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "reset", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0,500], + "saveCheckPoint": true + } + ] + }, + { + "className": "ui_view_percent_test_02", + "pageNav": ["View_Percent"], + "testSteps": [ + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0, -300], + "saveCheckPoint": true + }, + { + "viewID": "smaller", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "bigger", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "smaller", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "smaller", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "bigger", + "eventID": 0, + "eventValue": [], + "saveCheckPoint": true + }, + { + "viewID": "graphic_ui_test_case_id", + "eventID": 1, + "eventValue": [0,500], + "saveCheckPoint": true + } + ] + } + ] +} \ No newline at end of file