## Copyright (c) 2022, NVIDIA CORPORATION.  All rights reserved.
##
## NVIDIA CORPORATION and its licensors retain all intellectual property
## and proprietary rights in and to this software, related documentation
## and any modifications thereto.  Any use, reproduction, disclosure or
## distribution of this software and related documentation without an express
## license agreement from NVIDIA CORPORATION is strictly prohibited.
##
import omni.kit.test
import carb
import omni.usd
import omni.kit.app
from omni.kit.test.async_unittest import AsyncTestCase
from omni.kit import ui_test

# duplicate of kit\source\extensions\omni.kit.window.preferences\python\omni\kit\window\preferences\tests\test_pages.py
# added here for coverage

class PreferencesTestPages(AsyncTestCase):
    # Before running each test
    async def setUp(self):
        omni.kit.window.preferences.show_preferences_window()

    async def test_show_pages(self):
        pages = omni.kit.window.preferences.get_page_list()
        page_names = [page._title for page in pages]
        # is list alpha sorted. Don't compare with fixed list as members can change
        self.assertEqual(page_names, sorted(page_names))
        for page in pages:
            omni.kit.window.preferences.select_page(page)
            await ui_test.human_delay(50)
