import os
import unittest
import pathlib
import carb
import carb.input
import omni.kit.test
import omni.ui as ui
from pathlib import Path
from omni.kit import ui_test
from omni.ui.tests.test_base import OmniUiTest
from omni.kit.test_suite.helpers import get_test_data_path


class TestDebugMenu(OmniUiTest):
    async def setUp(self):
        pass

    async def tearDown(self):
        pass

    async def test_debug_menu(self):
        DebugWindowName = "omni.kit.menu.utils debug"

        # hotkey - show_menu_debug_window
        await ui_test.emulate_keyboard_press(carb.input.KeyboardInput.M, carb.input.KEYBOARD_MODIFIER_FLAG_CONTROL + carb.input.KEYBOARD_MODIFIER_FLAG_ALT + carb.input.KEYBOARD_MODIFIER_FLAG_SHIFT)
        await ui_test.human_delay(50)

        golden_img_dir = pathlib.Path(get_test_data_path(__name__, "golden_img"))
        await self.docked_test_window(
            window=ui.Workspace.get_window(DebugWindowName),
            width=450,
            height=300)

        await self.finalize_test(golden_img_dir=golden_img_dir, golden_img_name="test_debug_window.png")
        await ui_test.human_delay(50)

        ui.Workspace.show_window(DebugWindowName, False)
