mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-19 08:18:05 +02:00
Working on Python integration.
This commit is contained in:
parent
816b3a4ef6
commit
6db83660b6
7 changed files with 80 additions and 20 deletions
|
@ -18,7 +18,6 @@
|
|||
#include <quazip5/quazip.h>
|
||||
#include <quazip5/JlCompress.h>
|
||||
|
||||
#include "TestRailInterface.h"
|
||||
#include "ui/AutoTester.h"
|
||||
extern AutoTester* autoTester;
|
||||
|
||||
|
@ -839,16 +838,19 @@ void Test::createTestRailTestSuite() {
|
|||
}
|
||||
|
||||
QString outputDirectory = QFileDialog::getExistingDirectory(nullptr, "Please select a folder to store generated files in",
|
||||
parent, QFileDialog::ShowDirsOnly);
|
||||
parent, QFileDialog::ShowDirsOnly);
|
||||
|
||||
// If user cancelled then restore previous selection and return
|
||||
// If user cancelled then return
|
||||
if (outputDirectory == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
TestRailInterface testRailInterface;
|
||||
testRailInterface.createTestSuite(_testDirectory, outputDirectory, autoTester->getSelectedUser(),
|
||||
autoTester->getSelectedBranch());
|
||||
if (_testRailCreateMode == PYTHON) {
|
||||
////createTestRailPythonTestSuite();
|
||||
} else {
|
||||
_testRailInterface.createTestSuiteXML(_testDirectory, outputDirectory, autoTester->getSelectedUser(),
|
||||
autoTester->getSelectedBranch());
|
||||
}
|
||||
}
|
||||
|
||||
QStringList Test::createListOfAll_imagesInDirectory(const QString& imageFormat, const QString& pathToImageDirectory) {
|
||||
|
@ -919,3 +921,7 @@ QString Test::getExpectedImagePartialSourceDirectory(const QString& filename) {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
void Test::setTestRailCreateMode(TestRailCreateMode testRailCreateMode) {
|
||||
_testRailCreateMode = testRailCreateMode;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "ImageComparer.h"
|
||||
#include "ui/MismatchWindow.h"
|
||||
#include "TestRailInterface.h"
|
||||
|
||||
class Step {
|
||||
public:
|
||||
|
@ -33,6 +34,11 @@ public:
|
|||
StepList stepList;
|
||||
};
|
||||
|
||||
enum TestRailCreateMode {
|
||||
PYTHON,
|
||||
XML
|
||||
};
|
||||
|
||||
class Test {
|
||||
public:
|
||||
Test();
|
||||
|
@ -50,6 +56,7 @@ public:
|
|||
void createMDFile(const QString& topLevelDirectory);
|
||||
|
||||
void createTestsOutline();
|
||||
|
||||
void createTestRailTestSuite();
|
||||
|
||||
bool compareImageLists(bool isInteractiveMode, QProgressBar* progressBar);
|
||||
|
@ -72,6 +79,8 @@ public:
|
|||
|
||||
ExtractedText getTestScriptLines(QString testFileName);
|
||||
|
||||
void setTestRailCreateMode(TestRailCreateMode testRailCreateMode);
|
||||
|
||||
private:
|
||||
const QString TEST_FILENAME { "test.js" };
|
||||
const QString TEST_RESULTS_FOLDER { "TestResults" };
|
||||
|
@ -116,6 +125,10 @@ private:
|
|||
const QString PATH_SEPARATOR{ "." };
|
||||
|
||||
bool _exitWhenComplete{ false };
|
||||
|
||||
TestRailInterface _testRailInterface;
|
||||
|
||||
TestRailCreateMode _testRailCreateMode { PYTHON };
|
||||
};
|
||||
|
||||
#endif // hifi_test_h
|
|
@ -16,10 +16,10 @@
|
|||
#include <QMessageBox>
|
||||
#include <QTextStream>
|
||||
|
||||
void TestRailInterface::createTestSuite(const QString& testDirectory,
|
||||
const QString& outputDirectory,
|
||||
const QString& user,
|
||||
const QString& branch) {
|
||||
void TestRailInterface::createTestSuiteXML(const QString& testDirectory,
|
||||
const QString& outputDirectory,
|
||||
const QString& user,
|
||||
const QString& branch) {
|
||||
QDomProcessingInstruction instruction = document.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
|
||||
document.appendChild(instruction);
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
class TestRailInterface {
|
||||
public:
|
||||
void createTestSuite(const QString& testDirectory,
|
||||
const QString& outputDirectory,
|
||||
const QString& user,
|
||||
const QString& branch);
|
||||
void createTestSuiteXML(const QString& testDirectory,
|
||||
const QString& outputDirectory,
|
||||
const QString& user,
|
||||
const QString& branch);
|
||||
|
||||
QDomElement processDirectory(const QString& directory, const QString& user, const QString& branch, const QDomElement& element);
|
||||
QDomElement processTest(const QString& fullDirectory, const QString& test, const QString& user, const QString& branch, const QDomElement& element);
|
||||
|
|
|
@ -100,6 +100,14 @@ void AutoTester::on_closeButton_clicked() {
|
|||
exit(0);
|
||||
}
|
||||
|
||||
void AutoTester::on_createPythonScriptRadioButton_clicked() {
|
||||
_test->setTestRailCreateMode(PYTHON);
|
||||
}
|
||||
|
||||
void AutoTester::on_createXMLScriptRadioButton_clicked() {
|
||||
_test->setTestRailCreateMode(XML);
|
||||
}
|
||||
|
||||
void AutoTester::downloadImage(const QUrl& url) {
|
||||
_downloaders.emplace_back(new Downloader(url, this));
|
||||
connect(_downloaders[_index], SIGNAL (downloaded()), _signalMapper, SLOT (map()));
|
||||
|
|
|
@ -46,9 +46,13 @@ private slots:
|
|||
void on_createAllMDFilesButton_clicked();
|
||||
void on_createTestsOutlineButton_clicked();
|
||||
void on_createTestRailTestSuiteButton_clicked();
|
||||
|
||||
void on_hideTaskbarButton_clicked();
|
||||
void on_showTaskbarButton_clicked();
|
||||
|
||||
void on_createPythonScriptRadioButton_clicked();
|
||||
void on_createXMLScriptRadioButton_clicked();
|
||||
|
||||
void on_closeButton_clicked();
|
||||
|
||||
void saveImage(int index);
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>612</width>
|
||||
<height>553</height>
|
||||
<width>645</width>
|
||||
<height>570</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -232,9 +232,9 @@
|
|||
<widget class="QPushButton" name="createTestRailTestSuiteButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>330</x>
|
||||
<y>90</y>
|
||||
<width>220</width>
|
||||
<x>409</x>
|
||||
<y>100</y>
|
||||
<width>141</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -242,13 +242,42 @@
|
|||
<string>Create TestRail Test Suite</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="createPythonScriptRadioButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>100</y>
|
||||
<width>95</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Python</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QRadioButton" name="createXMLScriptRadioButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>310</x>
|
||||
<y>120</y>
|
||||
<width>95</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>XML</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menuBar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>612</width>
|
||||
<width>645</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
Loading…
Reference in a new issue