Skip to content

Commit

Permalink
Add basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tbruno25 committed Jul 18, 2024
1 parent bd01064 commit e399197
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path
from time import sleep

import dearpygui.dearpygui as dpg
import pyautogui
import pytest
from can_explorer.app import CanExplorer
Expand Down Expand Up @@ -80,8 +81,26 @@ def virtual_gui(request, process):
save_screenshot(request)


def test_gui_launch_basic(virtual_gui):
pytest.skip("Todo")
def test_gui_launch_basic(app, controller, tag):
assert dpg.is_dearpygui_running()

# Check if the main window was created
assert dpg.does_item_exist(tag.header)
assert dpg.does_item_exist(tag.body)
assert dpg.does_item_exist(tag.footer)

# Check if key UI elements exist
assert dpg.does_item_exist(tag.main_button)
assert dpg.does_item_exist(tag.clear_button)
assert dpg.does_item_exist(tag.plot_buffer_slider)
assert dpg.does_item_exist(tag.plot_height_slider)

# Check if the settings tab exists
assert dpg.does_item_exist(tag.settings_tab)

# Verify initial state
assert not controller.is_active()
assert dpg.get_item_label(tag.main_button) == "Start"


def test_gui_must_be_inactive_to_apply_settings(app, tag, controller):
Expand Down

0 comments on commit e399197

Please sign in to comment.