Files
o3de/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/ViewportTitleDlgCommands_test.py
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

57 lines
1.9 KiB
Python
Executable File

"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
#
# This is a pytest module to test the in-Editor Python API from ViewportTitleDlg
#
import pytest
pytest.importorskip('test_tools')
import time
import logging
import os
import shutil
from test_tools import WINDOWS_LAUNCHER
import test_tools.shared.log_monitor
import test_tools.launchers.phase
import test_tools.builtin.fixtures as fixtures
# Use the built-in workspace and editor fixtures.
# These will configure the requested project and run the editor.
workspace = fixtures.use_fixture(fixtures.builtin_workspace_fixture, scope='function')
editor = fixtures.use_fixture(fixtures.editor, scope='function')
logger = logging.getLogger(__name__)
@pytest.mark.SUITE_sandbox
@pytest.mark.parametrize("platform,configuration,project,spec", [
pytest.param("win_x64_vs2017", "profile", "AutomatedTesting", "all", marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")),
])
class TestViewportTitleDlgAutomation(object):
def test_ViewportTitleDlg_API(self, request, editor, project):
logger.debug("Running automated test for ViewportTitleDlg")
request.addfinalizer(editor.ensure_stopped)
editor.deploy()
editor.launch(["--exec", "@engroot@/Tests/hydra/ViewportTitleDlgCommands.cfg"])
editorlog_file = os.path.join(editor.workspace.release.paths.project_log(), 'Editor.log')
expected_lines = [
"toggle_helpers works",
"is_helpers_shown works"
]
test_tools.shared.log_monitor.monitor_for_expected_lines(editor, editorlog_file, expected_lines)
# Rely on the test script to quit after running
editor.run(test_tools.launchers.phase.WaitForLauncherToQuit(editor, 10))