From 5784f4cd875c61f388104208f12fdf5e3777eb45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Tue, 10 Oct 2023 16:14:02 +0200 Subject: [PATCH] feat(Storybook): Open tests dir from the app --- storybook/src/Storybook/PageToolBar.qml | 3 +++ storybook/testsrunner.cpp | 5 +++++ storybook/testsrunner.h | 1 + 3 files changed, 9 insertions(+) diff --git a/storybook/src/Storybook/PageToolBar.qml b/storybook/src/Storybook/PageToolBar.qml index 74f4fe8ea..0f75f1fd9 100644 --- a/storybook/src/Storybook/PageToolBar.qml +++ b/storybook/src/Storybook/PageToolBar.qml @@ -140,5 +140,8 @@ ToolBar { ? `Please add valid tests to ${testRunnerControls.testFileName} file` : "" } + + onAccepted: Qt.openUrlExternally(Qt.resolvedUrl(TestsRunner.testsPath())) + Component.onCompleted: standardButton(Dialog.Ok).text = "Open tests folder" } } diff --git a/storybook/testsrunner.cpp b/storybook/testsrunner.cpp index 5a1087c7b..ae952170c 100644 --- a/storybook/testsrunner.cpp +++ b/storybook/testsrunner.cpp @@ -49,3 +49,8 @@ QObject* TestsRunner::runTests(const QString& fileName) return testRunnerProcess; } + +QString TestsRunner::testsPath() const +{ + return m_testsBasePath; +} diff --git a/storybook/testsrunner.h b/storybook/testsrunner.h index 1b1d18f72..96218f92c 100644 --- a/storybook/testsrunner.h +++ b/storybook/testsrunner.h @@ -11,6 +11,7 @@ public: Q_INVOKABLE int testsCount(const QString& path); Q_INVOKABLE QObject* runTests(const QString& path); + Q_INVOKABLE QString testsPath() const; private: QString m_testRunnerExecutablePath;