更新
This commit is contained in:
@@ -10,7 +10,14 @@ os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
|
||||
import pytest
|
||||
from PySide6.QtCore import QPoint
|
||||
from PySide6.QtGui import QImage
|
||||
from PySide6.QtWidgets import QAbstractItemView, QApplication, QComboBox, QFrame, QWidget
|
||||
from PySide6.QtWidgets import (
|
||||
QAbstractItemView,
|
||||
QApplication,
|
||||
QComboBox,
|
||||
QFrame,
|
||||
QPushButton,
|
||||
QWidget,
|
||||
)
|
||||
|
||||
from doctor_workstation.ui.pages import prescription_library as library_module
|
||||
from doctor_workstation.ui.pages import prescriptions as prescriptions_module
|
||||
@@ -201,6 +208,20 @@ def test_desktop_sizes_keep_rows_and_pager_visible_and_aligned(
|
||||
if kind == "issued":
|
||||
filters = page.findChild(QFrame, "PrescriptionFilterBar")
|
||||
assert filters is not None and 84 <= filters.height() <= 92
|
||||
actions_host = page.table.cellWidget(0, 2)
|
||||
assert actions_host is not None
|
||||
row_edit = next(
|
||||
button
|
||||
for button in actions_host.findChildren(QPushButton)
|
||||
if button.accessibleName() == "编辑处方"
|
||||
)
|
||||
edit_top_left = row_edit.mapTo(page.table.viewport(), row_edit.rect().topLeft())
|
||||
edit_bottom_right = row_edit.mapTo(
|
||||
page.table.viewport(), row_edit.rect().bottomRight()
|
||||
)
|
||||
assert row_edit.text() == "编辑"
|
||||
assert page.table.viewport().rect().contains(edit_top_left)
|
||||
assert page.table.viewport().rect().contains(edit_bottom_right)
|
||||
else:
|
||||
filters = page.findChild(QFrame, "PrescriptionLibraryFilterBar")
|
||||
assert filters is not None
|
||||
|
||||
Reference in New Issue
Block a user