File indexing completed on 2024-05-19 05:41:56
0001 // mainwindow_test_tool_selection.t.cpp -*-C++-*- 0002 0003 /* Copyright 2023 Codethink Ltd <codethink@codethink.co.uk> 0004 // SPDX-License-Identifier: Apache-2.0 0005 // 0006 // Licensed under the Apache License, Version 2.0 (the "License"); 0007 // you may not use this file except in compliance with the License. 0008 // You may obtain a copy of the License at 0009 // 0010 // http://www.apache.org/licenses/LICENSE-2.0 0011 // 0012 // Unless required by applicable law or agreed to in writing, software 0013 // distributed under the License is distributed on an "AS IS" BASIS, 0014 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0015 // See the License for the specific language governing permissions and 0016 // limitations under the License. 0017 */ 0018 0019 #include <ct_lvtqtc_graphicsscene.h> 0020 #include <ct_lvtqtc_graphicsview.h> 0021 #include <ct_lvtqtc_lakosrelation.h> 0022 #include <ct_lvttst_fixture_qt.h> 0023 0024 #include <apptesting_fixture.h> 0025 #include <catch2-local-includes.h> 0026 #include <variant> 0027 0028 #include <preferences.h> 0029 0030 // in a header 0031 Q_DECLARE_LOGGING_CATEGORY(LogTest) 0032 0033 // in one source file 0034 Q_LOGGING_CATEGORY(LogTest, "log.test") 0035 0036 using namespace Codethink::lvtldr; 0037 0038 TEST_CASE_METHOD(CodeVisApplicationTestFixture, "Tool Selection Works") 0039 { 0040 Preferences::self()->useDefaults(true); 0041 REQUIRE(isShowingWelcomePage()); 0042 QTest::qWait(1000); 0043 0044 clickOn(Menubar::File::NewProject{}); 0045 REQUIRE(isShowingGraphPage()); 0046 QTest::qWait(1000); 0047 0048 // if this passes, we are not crashing. 0049 // We need to lock for navigation to add new elements on the view. 0050 clickOn(Sidebar::ManipulationTool::NewPackage{"abc"}); 0051 0052 QTest::qWait(1000); 0053 REQUIRE(isAnyToolSelected()); 0054 }