-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automated testing #25
Comments
I briefly played with from PyQt5 import QtCore
from ginga.misc.log import get_logger
from ginga.misc.ModuleManager import ModuleManager
from ginga.misc.Settings import Preferences
from ginga.rv.Control import GingaShell
def test1(qtbot, tmpdir):
logger = get_logger("my viewer", null=True)
gs = GingaShell(logger, None, ModuleManager(logger),
Preferences(basefolder=tmpdir.strpath, logger=logger))
w = gs.w.menubar
qtbot.addWidget(w.widget)
qtbot.mouseClick(w.get_menu("Channel".get_menu("Add Channel")),
QtCore.Qt.LeftButton)
# But pop-up dialog that is Button inside HBox inside VBox!
# How to click OK here? There is option to mock the whole dialog pop-up (https://pytest-qt.readthedocs.io/en/latest/note_dialogs.html) but wouldn't that defeat the purpose of GUI testing? Regardless, I am not sure if this is the correct solution as this purely tests Qt interactions, while Ginga supports a few other backends (e.g., GTK, GTK3, and Jupyter notebook) and has its own toolkit-agnostic widgets. Ideally, it would be nice to write the test only one time but can work for different backends being used (too ambitious?). http://www.sikuli.org/ was also suggested but it appears to be Java/JavaScript/Jython intensive and its stance on Python 3 is unclear ("Python (language level 2.7) supported by the Jython interpreter"). xref sikuli/sikuli#48 |
Looks like Jython is not yet PY3 compatible -- https://stackoverflow.com/questions/2351008/when-will-jython-support-python-3 (latest update in late 2017 with no solid timeline given). |
Ideas: http://stackoverflow.com/questions/1616228/pyqt-gui-testing
The text was updated successfully, but these errors were encountered: