From de8d77416e0ae504409f29711e1781561096bd5a Mon Sep 17 00:00:00 2001
From: afnanramadhan <13521011@std.stei.itb.ac.id>
Date: Wed, 19 Apr 2023 16:43:49 +0700
Subject: [PATCH] add: test list latihan

---
 src/test_listlatihan2.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 src/test_listlatihan2.py

diff --git a/src/test_listlatihan2.py b/src/test_listlatihan2.py
new file mode 100644
index 0000000..1452fac
--- /dev/null
+++ b/src/test_listlatihan2.py
@@ -0,0 +1,25 @@
+from PyQt6.QtWidgets import QApplication
+from listlatihan2 import listLatihan2
+from PyQt6.QtCore import Qt, QSize, pyqtSignal
+from PyQt6.QtGui import QIcon, QPixmap, QCursor, QFont, QMovie
+from PyQt6.QtWidgets import (QWidget, QApplication, QWidget,
+                             QLabel, QVBoxLayout, QHBoxLayout, QPushButton, QScrollArea, QDialog)
+import pytest
+
+@pytest.fixture
+def app():
+    app = listLatihan2()
+    yield app
+
+def test_window(app,qtbot):
+    # cek window title
+    assert app.windowTitle() == "FitU - Daftar Latihan"
+    assert app.height() == 720
+    assert app.width() == 1280
+    assert len(app.findChildren(QPushButton)) == 20
+
+def test_listLat(app,qtbot):
+    # cek jumlah latihan yang ditampilkan apakah berisi 16 latihan
+    assert len(app.listLat) == 16
+    assert isinstance(app.findChild(QScrollArea), QScrollArea)
+    assert len(app.findChild(QScrollArea).findChildren(QPushButton)) == len(app.listLat)
-- 
GitLab