fix: show complete CBB result details
This commit is contained in:
1 parent
86837155ea
commit
2d6acc1180
2 files changed
+64
-3
No files matched your search
@@ -290,3 +290,33 @@ def test_large_catalog_local_filter_and_selection_remain_responsive(qtbot, tmp_p
|
||||
print(f'catalog rows={size} load={loaded:.3f}s local_actions={elapsed:.3f}s')
|
||||
assert elapsed < 2.0
|
||||
assert window.selected_records() == ()
|
||||
|
||||
|
||||
def test_double_click_shows_complete_skipped_reason(qtbot, tmp_path, monkeypatch):
|
||||
from PySide6.QtWidgets import QApplication, QDialog, QPlainTextEdit, QPushButton
|
||||
|
||||
window = load_window(qtbot, tmp_path, monkeypatch)
|
||||
window.show()
|
||||
reason = ('PCB_OPEN_SKIPPED: 检查未通过\n' +
|
||||
'\n'.join(f'共享数据库占用记录 {index}' for index in range(30)) +
|
||||
'\n完整路径 <library>/SymbolLibs/icdb.dat')
|
||||
window._progress({'block': 'Beta', 'stage': 'SKIPPED', 'detail': reason})
|
||||
row = window._row_by_name['Beta']
|
||||
item = window.cbb_table.item(row, 3)
|
||||
window.cbb_table.scrollToItem(item)
|
||||
position = window.cbb_table.visualItemRect(item).center()
|
||||
viewport = window.cbb_table.viewport()
|
||||
assert viewport.rect().contains(position)
|
||||
qtbot.mouseClick(viewport, Qt.LeftButton, pos=position)
|
||||
qtbot.mouseDClick(viewport, Qt.LeftButton, pos=position)
|
||||
dialogs = [dialog for dialog in window.findChildren(QDialog)
|
||||
if dialog.isVisible() and '结果详情' in dialog.windowTitle()]
|
||||
assert len(dialogs) == 1
|
||||
dialog = dialogs[0]
|
||||
text = dialog.findChild(QPlainTextEdit)
|
||||
assert text.isReadOnly()
|
||||
assert text.toPlainText() == reason
|
||||
copy, = [button for button in dialog.findChildren(QPushButton) if button.text() == '复制全文']
|
||||
qtbot.mouseClick(copy, Qt.LeftButton)
|
||||
assert QApplication.clipboard().text() == reason
|
||||
dialog.close()
|
||||
Reference in new issue
Block a user