|
44 | 44 |
|
45 | 45 | import os |
46 | 46 | import pytest |
47 | | -DISPLAY = os.getenv('DISPLAY') |
48 | | -if not DISPLAY: # Avoid failing unit tests in system without X11 |
49 | | - pytest.skip("Skipped because of missing DISPLAY", allow_module_level=True) |
| 47 | +# DISPLAY = os.getenv('DISPLAY') |
| 48 | +# if not DISPLAY: # Avoid failing unit tests in system without X11 |
| 49 | +# pytest.skip("Skipped because of missing DISPLAY", allow_module_level=True) |
50 | 50 | import wx |
51 | 51 | import shutil |
52 | 52 | import sys |
|
60 | 60 | from robotide.editor import EditorPlugin, EditorCreator |
61 | 61 | from robotide.editor.kweditor import KeywordEditor |
62 | 62 | from robotide.editor.editors import TestCaseFileEditor, WelcomePage |
| 63 | +from robotide.editor.popupwindow import HtmlPopupWindow |
63 | 64 | from robotide.editor.macroeditors import TestCaseEditor |
64 | 65 | from robotide.preferences import RideSettings |
65 | 66 | from robotide.namespace import Namespace |
@@ -114,6 +115,12 @@ def __init__(self, parent): |
114 | 115 | def SetupScrolling(self): |
115 | 116 | pass |
116 | 117 |
|
| 118 | + def GetScrollPixelsPerUnit(self): |
| 119 | + return (20, 20) |
| 120 | + |
| 121 | + def GetViewStart(self): |
| 122 | + return (10, 10) |
| 123 | + |
117 | 124 |
|
118 | 125 | class MainFrame(wx.Frame, _FakeScrolledPanel): |
119 | 126 | notebook = None |
@@ -445,6 +452,36 @@ def test_contentassist_dialog(self): |
445 | 452 | # wx.CallLater(5000, self.app.ExitMainLoop) |
446 | 453 | # self.app.MainLoop() |
447 | 454 |
|
| 455 | + def test_htmlpopupwindow_dialog_simple(self): |
| 456 | + dlg = HtmlPopupWindow(self.frame, (400, 200), False, True) |
| 457 | + dlg.set_content("Example without title") |
| 458 | + dlg.show_at((1000, 200)) |
| 459 | + shown=dlg.IsShown() |
| 460 | + print(f"DEBUG: test_z_kweditor.py: test_htmlpopupwindow_dialog_simple shown={shown}") |
| 461 | + assert shown is True |
| 462 | + wx.CallLater(4000, dlg.hide) |
| 463 | + # Uncomment next lines if you want to see the app |
| 464 | + wx.CallLater(5000, self.app.ExitMainLoop) |
| 465 | + self.app.MainLoop() |
| 466 | + |
| 467 | + def test_htmlpopupwindow_dialog_title(self): |
| 468 | + dlg = HtmlPopupWindow(self._panel, (400, 200), True, True) |
| 469 | + dlg.set_content("Example with title", "This is the Title") |
| 470 | + dlg.show_at((1000, 100)) |
| 471 | + shown=dlg.IsShown() |
| 472 | + assert shown is True |
| 473 | + pw_size = dlg.pw_size |
| 474 | + pw_pos = dlg.screen_position |
| 475 | + print(f"DEBUG: test_z_kweditor.py: test_htmlpopupwindow_dialog_title pw_size={pw_size} scree_pos={pw_pos}") |
| 476 | + event=wx.KeyEvent() |
| 477 | + dlg._detach(event) |
| 478 | + title = dlg._detached_title |
| 479 | + print(f"DEBUG: test_z_kweditor.py: test_htmlpopupwindow_dialog_title title={title}") |
| 480 | + wx.CallLater(4000, dlg.hide) |
| 481 | + # Uncomment next lines if you want to see the app |
| 482 | + wx.CallLater(5000, self.app.ExitMainLoop) |
| 483 | + self.app.MainLoop() |
| 484 | + |
448 | 485 | def test_contentassist_text_editor(self): |
449 | 486 | suggestions = SuggestionSource(None, self.app.project.controller) |
450 | 487 | dlg = ContentAssistTextEditor(self._grid, suggestions, (400, 400)) |
|
0 commit comments